Re: netlink: Add netlink_bound helper and use it in netlink_getname
From: Tejun Heo
Date: Sat Sep 26 2015 - 16:18:06 EST
Hello,
On Sun, Sep 27, 2015 at 04:10:41AM +0800, Herbert Xu wrote:
> Well guess what the bug that you have discovered supposedly due to
> a missing barrier in netlink_connect has nothing to do with the
> barrier. Instead it is caused by a logical error elsewhere that
> would have gone unnoticed otherwise.
It's a combination of two problems. The garbage port number is a
logical error but there still is an ordering problem there between
->bound and ->portid. We need to test ->bind there again because of
the garbage port problem.
> So I retain my position that blindly adding barriers do not make
> bugs go away. Instead you need to have real understanding of what
That's a dishonest summary of what I've been saying.
> the code is doing and every spot where a barrier may be needed must
> be audited manually.
What I've been saying is that we do need to be careful and audit each
barrier usages but at the same time there are established patterns
that we can use to make the process significantly easier and more
reliable.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/