From: David Miller <davem@davemloft.net>
To: keescook@chromium.org
Cc: netdev@vger.kernel.org, mchong@google.com, i@flanker017.me,
kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org,
kaber@trash.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: ping: check minimum size on ICMP header length
Date: Mon, 05 Dec 2016 13:19:32 -0500 (EST) [thread overview]
Message-ID: <20161205.131932.1911368739049813377.davem@davemloft.net> (raw)
In-Reply-To: <20161203005853.GA117599@beast>
From: Kees Cook <keescook@chromium.org>
Date: Fri, 2 Dec 2016 16:58:53 -0800
> diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
> index 205e2000d395..8257be3f032c 100644
> --- a/net/ipv4/ping.c
> +++ b/net/ipv4/ping.c
> @@ -654,7 +654,7 @@ int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
> void *user_icmph, size_t icmph_len) {
> u8 type, code;
>
> - if (len > 0xFFFF)
> + if (len > 0xFFFF || len < icmph_len)
> return -EMSGSIZE;
As suggested by Lorenzo, please use -EINVAL here.
Thanks.
prev parent reply other threads:[~2016-12-05 18:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-03 0:58 [PATCH] net: ping: check minimum size on ICMP header length Kees Cook
2016-12-05 3:35 ` Lorenzo Colitti
2016-12-05 18:19 ` 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=20161205.131932.1911368739049813377.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=i@flanker017.me \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=keescook@chromium.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mchong@google.com \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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 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).