netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BROKEN Re: [PATCH] netlink: 2-clause nla_ok()
@ 2016-12-05 14:56 Alexey Dobriyan
  2016-12-05 15:09 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2016-12-05 14:56 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

David, please do

    git revert 4f7df337fe79bba1e4c2d525525d63b5ba186bbd

I'm an idiot.

All rationale in the commit would be correct if reading "nla_len"
didn't require memory access. But it does.

    return rem >= (int)sizeof(*nla) &&
               nla->nla_len >= sizeof(*nla) &&
               nla->nla_len <= remaining;

Those logical ands ensure that memory access is not done
if "rem" is small enough to even fetch ->nla_len.

Maybe someone could vouch that other checks prevent
this kind of situation from happening but not me.
How very embarrassing.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-13 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 14:56 BROKEN Re: [PATCH] netlink: 2-clause nla_ok() Alexey Dobriyan
2016-12-05 15:09 ` Johannes Berg
2016-12-13 19:30   ` [PATCH net-next] netlink: revert broken, broken "2-clause nla_ok()" Alexey Dobriyan
2016-12-13 19:55     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).