Skip to content
Commit 02531b55 authored by Loris Reiff's avatar Loris Reiff Committed by Greg Kroah-Hartman
Browse files

bpf, cgroup: Fix problematic bounds check

[ Upstream commit f4a2da75 ]

Since ctx.optlen is signed, a larger value than max_value could be
passed, as it is later on used as unsigned, which causes a WARN_ON_ONCE
in the copy_to_user.

Fixes: 0d01da6a

 ("bpf: implement getsockopt and setsockopt hooks")
Signed-off-by: default avatarLoris Reiff <loris.reiff@liblor.ch>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Reviewed-by: default avatarStanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/bpf/20210122164232.61770-2-loris.reiff@liblor.ch
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9146fffc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment