[PATCH] remove null dereference from netlink/link.h

Thomas Haller thaller at redhat.com
Fri Feb 12 04:25:04 PST 2016


On Thu, 2016-02-11 at 12:38 -0800, Nick Lewycky wrote:
> On Thu, Jan 28, 2016 at 07:49:31PM -0800, Nick Lewycky wrote:
> > Replace a null pointer dereference with a use of the 'offsetof'
> > macro in stddef.h.
> > 
> > Signed-off-by: Nick Lewycky <nlewycky at google.com>
> > 


> Ping!
> 
> This patch fixes a UBSan complaint in libnl. Right now ubsan flags
> the null dereference in any execution of this macro. This article
> does a good job of describing ubsan: http://developerblog.redhat.com/
> 2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/
> 
> My patch is that doesn't touch the nearby null dereference inside
> typeof(). That doesn't need to be changed because that expression
> won't be evaluated. The exact wording in the gcc manual is "The
> operand of typeof is evaluated for its side effects if and only if it
> is an expression of variably modified type or the name of such a
> type".
> 
> Please review!


Hi Nick,


patch merged as
https://github.com/thom311/libnl/commit/58396ae2ae7c91fb95d1de9654be5b12fd2343d2

Thanks,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20160212/a27da708/attachment.sig>


More information about the libnl mailing list