From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
LKML <linux-kernel@vger.kernel.org>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Network Development <netdev@vger.kernel.org>
Subject: Re: [PATCH] net: sched: Fix memory exposure from short TCA_U32_SEL
Date: Mon, 27 Aug 2018 07:46:32 -0400 [thread overview]
Message-ID: <d68f13e6-339a-2a40-9c0d-7549cd9aabb3@mojatatu.com> (raw)
In-Reply-To: <CAGXu5jJZ-BfJPA+m1BOuVVQxPb8SXpSRo+F2cVTF62C9JTyRXQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 354 bytes --]
On 2018-08-26 5:56 p.m., Kees Cook wrote:
> On Sun, Aug 26, 2018 at 10:30 AM, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>> We should add an nla_policy later.
>
> What's the right way to do that for cases like this?
Meant something like attached which you alluded-to in your comments
would give an upper bound (Max allowed keys is 128).
cheers,
jamal
[-- Attachment #2: patchlet --]
[-- Type: text/plain, Size: 706 bytes --]
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index d5d2a6dc3921..cb7a3fa0e728 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -761,7 +761,9 @@ static const struct nla_policy u32_policy[TCA_U32_MAX + 1] = {
[TCA_U32_HASH] = { .type = NLA_U32 },
[TCA_U32_LINK] = { .type = NLA_U32 },
[TCA_U32_DIVISOR] = { .type = NLA_U32 },
- [TCA_U32_SEL] = { .len = sizeof(struct tc_u32_sel) },
+ [TCA_U32_SEL] = { .type = NLA_BINARY,
+ .len = (sizeof(struct tc_u32_sel) +
+ (128*sizeof(struct tc_u32_key)) },
[TCA_U32_INDEV] = { .type = NLA_STRING, .len = IFNAMSIZ },
[TCA_U32_MARK] = { .len = sizeof(struct tc_u32_mark) },
[TCA_U32_FLAGS] = { .type = NLA_U32 },
next prev parent reply other threads:[~2018-08-27 11:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-26 5:58 Kees Cook
2018-08-26 6:15 ` Al Viro
2018-08-26 6:19 ` Kees Cook
2018-08-26 17:30 ` Jamal Hadi Salim
2018-08-26 21:56 ` Kees Cook
2018-08-27 11:46 ` Jamal Hadi Salim [this message]
2018-08-27 14:08 ` Kees Cook
2018-08-27 14:26 ` Roman Mashak
2018-08-26 17:32 ` Al Viro
2018-08-26 18:57 ` Joe Perches
2018-08-26 21:24 ` Al Viro
2018-08-26 22:26 ` Joe Perches
2018-08-26 22:43 ` Al Viro
2018-08-27 2:00 ` Julia Lawall
2018-08-27 2:35 ` Al Viro
2018-08-27 3:35 ` Julia Lawall
2018-08-27 4:04 ` Al Viro
2018-08-27 4:41 ` Julia Lawall
2018-08-27 1:59 ` Julia Lawall
2018-08-26 22:57 ` Al Viro
2018-08-27 11:57 ` Jamal Hadi Salim
2018-08-27 21:31 ` Cong Wang
2018-08-28 0:03 ` Al Viro
2018-08-28 15:59 ` Al Viro
2018-08-31 4:03 ` Al Viro
2018-08-29 19:07 ` Cong Wang
2018-08-29 21:33 ` Al Viro
2018-08-26 21:22 ` David Miller
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=d68f13e6-339a-2a40-9c0d-7549cd9aabb3@mojatatu.com \
--to=jhs@mojatatu.com \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=xiyou.wangcong@gmail.com \
/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®