]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: use GFP_USER for user-controlled kmalloc
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Mon, 30 Nov 2015 16:32:54 +0000 (14:32 -0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Dec 2015 04:39:46 +0000 (23:39 -0500)
commit7e8b0b21d8df05066bbdfbd726a4c2049e7d2a01
treedfe97a192eed6a74dc5e2518d0d2662a301f12a9
parent47750c359a057823fa82dffdbff48952b442ce56
sctp: use GFP_USER for user-controlled kmalloc

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.

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c