]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
bpf: Add sanity check for upper ptr_limit
authorPiotr Krysiuk <piotras@gmail.com>
Tue, 16 Mar 2021 08:47:02 +0000 (09:47 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:39:34 +0000 (15:39 -0500)
commit24d7115dc7e95e044ebb25d9ad4e1cda5e3d8c79
treef09a41b7cf32bde1e826cdb822bbff36dcd59b72
parentd555d84ea377a05ea58ffb537a65c35cdd9e42f9
bpf: Add sanity check for upper ptr_limit

BugLink: https://bugs.launchpad.net/bugs/1921710
commit 1b1597e64e1a610c7a96710fc4717158e98a08b3 upstream.

Given we know the max possible value of ptr_limit at the time of retrieving
the latter, add basic assertions, so that the verifier can bail out if
anything looks odd and reject the program. Nothing triggered this so far,
but it also does not hurt to have these.

Signed-off-by: Piotr Krysiuk <piotras@gmail.com>
Co-developed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kernel/bpf/verifier.c