bpf: Fix SO_RCVBUF/SO_SNDBUF handling in _bpf_setsockopt().
authorKuniyuki Iwashima <kuniyu@amazon.co.jp>
Tue, 4 Jan 2022 01:31:48 +0000 (10:31 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 5 Jan 2022 22:15:42 +0000 (14:15 -0800)
commit04c350b1ae6bdb12b84009a4d0bf5ab4e621c47b
tree6cde31e1e89f7e4d8b7e8e6e2017c0d59a58b494
parenta5bebc4f00dee47113eed48098c68e88b5ba70e8
bpf: Fix SO_RCVBUF/SO_SNDBUF handling in _bpf_setsockopt().

The commit 4057765f2dee ("sock: consistent handling of extreme
SO_SNDBUF/SO_RCVBUF values") added a change to prevent underflow
in setsockopt() around SO_SNDBUF/SO_RCVBUF.

This patch adds the same change to _bpf_setsockopt().

Fixes: 4057765f2dee ("sock: consistent handling of extreme SO_SNDBUF/SO_RCVBUF values")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220104013153.97906-2-kuniyu@amazon.co.jp
net/core/filter.c