[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <565D84A4.3080408@iogearbox.net>
Date: Tue, 01 Dec 2015 12:29:40 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: David Laight <David.Laight@...LAB.COM>,
'Marcelo Ricardo Leitner' <marcelo.leitner@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "linux-sctp@...r.kernel.org" <linux-sctp@...r.kernel.org>,
Vlad Yasevich <vyasevich@...il.com>,
Neil Horman <nhorman@...driver.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"syzkaller@...glegroups.com" <syzkaller@...glegroups.com>,
"dvyukov@...gle.com" <dvyukov@...gle.com>,
"kcc@...gle.com" <kcc@...gle.com>,
"glider@...gle.com" <glider@...gle.com>,
"sasha.levin@...cle.com" <sasha.levin@...cle.com>,
"edumazet@...gle.com" <edumazet@...gle.com>
Subject: Re: [PATCH] sctp: use GFP_USER for user-controlled kmalloc
On 12/01/2015 11:46 AM, David Laight wrote:
> From: Marcelo Ricardo Leitner
>> Sent: 30 November 2015 16:33
>> Dmitry Vyukov reported that the user could trigger a kernel warning by
>> using a large len value for getsockopt SCTP_GET_LOCAL_ADDRS, as that
>> value directly affects the value used as a kmalloc() parameter.
>>
>> This patch thus switches the allocation flags from all user-controllable
>> kmalloc size to GFP_USER to put some more restrictions on it and also
>> disables the warn, as they are not necessary.
>
> ISTM that the code should put some 'sanity limit' on that
> size before allocating the kernel buffer.
One could do that in addition, but this buffer has just a short lifetime
and by using GFP_USER hardwall restrictions apply already.
--
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