Hello, Herbert.
On Fri, Sep 25, 2015 at 11:39:57AM +0800, Herbert Xu wrote:
> +static inline bool netlink_bound(struct netlink_sock *nlk)
> +{
> + bool bound = READ_ONCE(nlk->bound);
> +
> + /* Ensure nlk is hashed and visible. */
> + if (bound)
> + smp_rmb();
> +
> + r
Hello, Herbert.
On Fri, Sep 25, 2015 at 09:43:27AM +0800, Herbert Xu wrote:
> Well had you said this in the first place I would've fixed it a
> long time ago. There aren't any in-kernel users right now and
> even if there were they'd have to do a connect/bind/sendmsg on
> the same socket in two t
On Thu, Sep 24, 2015 at 08:24:56PM -0700, Linus Torvalds wrote:
>
> The above looks very suspicious.
You're right Linus. I've added the READ_ONCE there. The reason I
kept the conditional is because the helper is always called in a
context where the result is used as part of an if statement. Th
On Thu, Sep 24, 2015 at 6:43 PM, Herbert Xu wrote:
> On Thu, Sep 24, 2015 at 04:05:10PM -0400, Tejun Heo wrote:
>
> +static inline bool netlink_bound(struct netlink_sock *nlk)
> +{
> + /* Ensure nlk is hashed and visible. */
> + if (nlk->bound)
> + smp_rmb();
> +
> +
On Thu, Sep 24, 2015 at 04:05:10PM -0400, Tejun Heo wrote:
>
> > I've decided to apply this and queue it up for -stable.
Thanks Dave!
> This is mostly correct; however, if there are or can be in-kernel
> users which create the client side of netlink socket, it isn't. Let's
> say such in-kernel u