mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
bpf: don't indicate success when copy_from_user fails
err in bpf_prog_get_info_by_fd() still holds 0 at that time from prior
check_uarg_tail_zero() check. Explicitly return -EFAULT instead, so
user space can be notified of buggy behavior.
Fixes: 1e27097690 ("bpf: Add BPF_OBJ_GET_INFO_BY_FD")
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
c9f2c1ae12
commit
89b096898a
1 changed files with 1 additions and 1 deletions
|
|
@ -1289,7 +1289,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
|
|||
info_len = min_t(u32, sizeof(info), info_len);
|
||||
|
||||
if (copy_from_user(&info, uinfo, info_len))
|
||||
return err;
|
||||
return -EFAULT;
|
||||
|
||||
info.type = prog->type;
|
||||
info.id = prog->aux->id;
|
||||
|
|
|
|||
Loading…
Reference in a new issue