bpf: sock recvbuff must be limited by rmem_max in bpf_setsockopt()
commitd74f30ef8972099e2bcc1c8a212f9418c6eebd7c
authorYafang Shao <laoar.shao@gmail.com>
Wed, 23 Jan 2019 04:37:19 +0000 (23 12:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:03:20 +0000 (13 14:03 -0700)
tree25be1889d96a59e4ec36a73bb1a739c32beb40d4
parent27a0e499a313796fbc56b0ba7d2d2171cc3d4ac3
bpf: sock recvbuff must be limited by rmem_max in bpf_setsockopt()

[ Upstream commit c9e4576743eeda8d24dedc164d65b78877f9a98c ]

When sock recvbuff is set by bpf_setsockopt(), the value must by
limited by rmem_max. It is the same with sendbuff.

Fixes: 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf")
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Lawrence Brakmo <brakmo@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/filter.c