diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-10-16 15:57:06 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-10-16 15:57:06 -0700 |
commit | f3dd3f4680d43b6c857a3fbe38c445d28fa62e14 (patch) | |
tree | 47843370fc9fba7477f5c842a06d33c64f1c8600 /bpf_filter.c | |
parent | a7f69da5b4939ad107f773eedca07838b05b4fab (diff) |
Don't shift by more than 31 bit positions.
That's undefined in C, and there are currently-used processors on which
a shift of 32 bits, for example, shifts all the bits out and processors
on which it does no shift (i.e., the shift count is, or isn't, taken
modulo 32).
We'll treat it as shifting all the bits out.
Note that the BPF interpreter doesn't do this test, so the BPF machine's
behavior mirrors the behavior of the processor on which it's running.
We suggest you not write filter expressions, or BPF programs, that rely
on any particular behavior from shifts of more than 31 bits.
Credit to OSS-Fuzz for finding this issue.
Diffstat (limited to 'bpf_filter.c')
0 files changed, 0 insertions, 0 deletions