diff options
| author | Loris Reiff <[email protected]> | 2021-01-22 16:42:31 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2021-01-22 22:11:34 +0000 |
| commit | bb8b81e396f7afbe7c50d789e2107512274d2a35 (patch) | |
| tree | cd23fb2afd862ab950fe23fb80ba8cc20ed37cb7 /net/lapb/lapb_out.c | |
| parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klasse... (diff) | |
| download | kernel-bb8b81e396f7afbe7c50d789e2107512274d2a35.tar.gz kernel-bb8b81e396f7afbe7c50d789e2107512274d2a35.zip | |
bpf, cgroup: Fix optlen WARN_ON_ONCE toctou
A toctou issue in `__cgroup_bpf_run_filter_getsockopt` can trigger a
WARN_ON_ONCE in a check of `copy_from_user`.
`*optlen` is checked to be non-negative in the individual getsockopt
functions beforehand. Changing `*optlen` in a race to a negative value
will result in a `copy_from_user(ctx.optval, optval, ctx.optlen)` with
`ctx.optlen` being a negative integer.
Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks")
Signed-off-by: Loris Reiff <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Stanislav Fomichev <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions
