From: Florian Westphal <fw@strlen.de>
To: David Miller <davem@davemloft.net>
Cc: fw@strlen.de, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] netlink: make getters tolerate NULL nla arg
Date: Sun, 19 Jan 2020 13:32:39 +0100 [thread overview]
Message-ID: <20200119123239.GB795@breakpoint.cc> (raw)
In-Reply-To: <20200117.040849.2032549448991143345.davem@davemloft.net>
David Miller <davem@davemloft.net> wrote:
> From: Florian Westphal <fw@strlen.de>
> Date: Thu, 16 Jan 2020 15:55:22 +0100
>
> > One recurring bug pattern triggered by syzbot is NULL dereference in
> > netlink code paths due to a missing "tb[NL_ARG_FOO] != NULL" test.
> >
> > At least some of these missing checks would not have crashed the kernel if
> > the various nla_get_XXX helpers would return 0 in case of missing arg.
> >
> > Make the helpers return 0 instead of crashing when a null nla is provided.
> > Even with allyesconfig the .text increase is only about 350 bytes.
> >
> > Signed-off-by: Florian Westphal <fw@strlen.de>
>
> Sorry, I think it's better to find out when code is trying to access
> attributes without verifying that they are even supplied.
Less than 24 hours after I saw this patch marked rejected syzbot
reported another incarnation of this pattern.
Would you consider a v2 with a WARN_ON_ONCE() added (and the
buildbot warning resolved)?
Thanks.
next prev parent reply other threads:[~2020-01-19 12:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 14:55 [PATCH net-next] netlink: make getters tolerate NULL nla arg Florian Westphal
2020-01-16 15:19 ` Toke Høiland-Jørgensen
2020-01-16 16:04 ` Florian Westphal
2020-01-16 16:23 ` Toke Høiland-Jørgensen
2020-01-17 10:39 ` Florian Westphal
2020-01-17 16:26 ` Toke Høiland-Jørgensen
2020-01-17 12:08 ` David Miller
2020-01-19 12:32 ` Florian Westphal [this message]
2020-01-19 14:08 ` David Miller
2020-01-17 22:28 ` kbuild test robot
2020-01-17 22:28 ` kbuild test robot
2020-01-18 9:40 ` kbuild test robot
2020-01-18 9:40 ` kbuild test robot
2020-01-24 15:47 ` kbuild test robot
2020-01-24 15:47 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200119123239.GB795@breakpoint.cc \
--to=fw@strlen.de \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.