From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, tgraf@suug.ch
Subject: Re: [PATCH] netlink: validate NLA_MSECS length
Date: Fri, 04 Nov 2011 17:48:33 -0400 (EDT) [thread overview]
Message-ID: <20111104.174833.2136311568196288477.davem@davemloft.net> (raw)
In-Reply-To: <1320314852.3950.36.camel@jlt3.sipsolutions.net>
From: Johannes Berg <johannes@sipsolutions.net>
Date: Thu, 03 Nov 2011 11:07:32 +0100
> From: Johannes Berg <johannes.berg@intel.com>
>
> L2TP for example uses NLA_MSECS like this:
> policy:
> [L2TP_ATTR_RECV_TIMEOUT] = { .type = NLA_MSECS, },
> code:
> if (info->attrs[L2TP_ATTR_RECV_TIMEOUT])
> cfg.reorder_timeout = nla_get_msecs(info->attrs[L2TP_ATTR_RECV_TIMEOUT]);
>
> As nla_get_msecs() is essentially nla_get_u64() plus the
> conversion to a HZ-based value, this will not properly
> reject attributes from userspace that aren't long enough
> and might overrun the message.
>
> Add NLA_MSECS to the attribute minlen array to check the
> size properly.
>
> Cc: Thomas Graf <tgraf@suug.ch>
> Cc: stable@vger.kernel.org
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Applied, thanks!
prev parent reply other threads:[~2011-11-04 21:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-03 10:07 [PATCH] netlink: validate NLA_MSECS length Johannes Berg
2011-11-04 21:48 ` David Miller [this message]
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=20111104.174833.2136311568196288477.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
--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