Skip to content
Commit 8132323e authored by Johannes Krude's avatar Johannes Krude Committed by Greg Kroah-Hartman
Browse files

bpf, offload: Replace bitwise AND by logical AND in bpf_prog_offload_info_fill



commit e20d3a05 upstream.

This if guards whether user-space wants a copy of the offload-jited
bytecode and whether this bytecode exists. By erroneously doing a bitwise
AND instead of a logical AND on user- and kernel-space buffer-size can lead
to no data being copied to user-space especially when user-space size is a
power of two and bigger then the kernel-space buffer.

Fixes: fcfb126d ("bpf: add new jited info fields in bpf_dev_offload and bpf_prog_info")
Signed-off-by: default avatarJohannes Krude <johannes@krude.de>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/bpf/20200212193227.GA3769@phlox.h.transitiv.net


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2463a30f
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