[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHA+R7MtR-LaE56ByZ3arzFihwp5wn73Kq1i=vxMRHJ3Zo5MhA@mail.gmail.com>
Date: Mon, 14 Dec 2015 10:59:55 -0800
From: Cong Wang <cwang@...pensource.com>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] net: add validation for the socket syscall protocol argument
On Mon, Dec 14, 2015 at 8:17 AM, Hannes Frederic Sowa
<hannes@...essinduktion.org> wrote:
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -1098,6 +1098,9 @@ int __sock_create(struct net *net, int family, int type, int protocol,
> return -EAFNOSUPPORT;
> if (type < 0 || type >= SOCK_MAX)
> return -EINVAL;
> + /* upper bound should be tested by per-protocol .create callbacks */
> + if (protocol < 0)
> + return -EINVAL;
Why? At least bt_sock_create() and netlink_create() do both upper bound
and lower bound checks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists