Thread (12 messages) 12 messages, 3 authors, 2012-10-30

Re: [Patch net-next] ipv6: fix a potential NULL deref

flat view

From: Eric Dumazet <hidden>
Date: 2012-10-29 08:25:27

On Mon, 2012-10-29 at 15:25 +0800, Cong Wang wrote:
Oh, yeah, gcc should be smart enough to do calculation without deref it
given it has the offset and the address. And dst happens to be first
field of rt, so offset is 0, &rt->dst should be NULL too if rt is NULL.
There is no dereference, even if gcc was dumb, since dst is an embedded
struct, not a pointer to a struct.

This wont change in a near future.
But this will be a problem if someone moved dst inside rt, as there is
no comment saying dst has to be the first one?
I dont think this placement will change in a near future, it would break
lot of things.

I guess we can use a BUILD_BUG_ON() instead of a comment that
could be ignored.

Note we could move dst in rtable, if we change the NULL test in
dst_release with some if ((unsigned long)dst < 4000) condition

I'll send a patch against ip_rt_put()
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help