From: David Miller <davem@davemloft.net>
To: salyzyn@android.com
Cc: linux-kernel@vger.kernel.org, kernel-team@android.com,
netdev@vger.kernel.org, kuba@kernel.org, tgraf@suug.ch
Subject: Re: [PATCH] netlink: add buffer boundary checking
Date: Thu, 23 Jul 2020 12:19:30 -0700 (PDT) [thread overview]
Message-ID: <20200723.121930.163681559677190095.davem@davemloft.net> (raw)
In-Reply-To: <20200723182136.2550163-1-salyzyn@android.com>
From: Mark Salyzyn <salyzyn@android.com>
Date: Thu, 23 Jul 2020 11:21:32 -0700
> Many of the nla_get_* inlines fail to check attribute's length before
> copying the content resulting in possible out-of-boundary accesses.
> Adjust the inlines to perform nla_len checking, for the most part
> using the nla_memcpy function to faciliate since these are not
> necessarily performance critical and do not need a likely fast path.
>
> Signed-off-by: Mark Salyzyn <salyzyn@android.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: kernel-team@android.com
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Thomas Graf <tgraf@suug.ch>
> Fixes: bfa83a9e03cf ("[NETLINK]: Type-safe netlink messages/attributes interface")
Please, let's avoid stuff like this.
Now it is going to be expensive to move several small attributes,
which is common. And there's a multiplier when dumping, for example,
thousands of networking devices, routes, or whatever, and all of their
attributes in a dump.
If you can document actual out of bounds accesses, let's fix them. Usually
contextually the attribute type and size has been validated by the time we
execute these accessors.
I'm not applying this, sorry.
next prev parent reply other threads:[~2020-07-23 19:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-23 18:21 Mark Salyzyn
2020-07-23 19:19 ` David Miller [this message]
2020-07-23 19:35 ` Eric Dumazet
2020-07-23 20:13 ` Mark Salyzyn
2020-07-24 21:14 ` Jacob Keller
2020-07-24 21:45 ` Mark Salyzyn
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=20200723.121930.163681559677190095.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=kernel-team@android.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=salyzyn@android.com \
--cc=tgraf@suug.ch \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®