Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1280791

Re: [PATCH] sctp: use GFP_USER for user-controlled kmalloc

From Daniel Borkmann <daniel@iogearbox.net>
Newsgroups linux.kernel
Subject Re: [PATCH] sctp: use GFP_USER for user-controlled kmalloc
Date 2015-12-01 12:30 +0100
Message-ID <qARia-ww-1@gated-at.bofh.it> (permalink)
References <qAzEC-62E-15@gated-at.bofh.it> <qAzEC-62E-13@gated-at.bofh.it> <qAQFs-8sH-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] sctp: use GFP_USER for user-controlled kmalloc Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> - 2015-11-30 17:40 +0100
  RE: [PATCH] sctp: use GFP_USER for user-controlled kmalloc David Laight <David.Laight@ACULAB.COM> - 2015-12-01 11:50 +0100
    Re: [PATCH] sctp: use GFP_USER for user-controlled kmalloc Daniel Borkmann <daniel@iogearbox.net> - 2015-12-01 12:30 +0100
  Re: [PATCH] sctp: use GFP_USER for user-controlled kmalloc David Miller <davem@davemloft.net> - 2015-12-03 05:50 +0100

csiph-web