diff options
| author | Piotr Zalewski <[email protected]> | 2024-11-06 19:46:30 +0000 |
|---|---|---|
| committer | Kent Overstreet <[email protected]> | 2024-11-07 21:48:21 +0000 |
| commit | f9f0a5390dcef1f96cc506a2cf7d50c8e348fa3d (patch) | |
| tree | aeb0f4cfd7560359fb335d4a280931e99dd9aabe /tools/perf/scripts/python/syscall-counts-by-pid.py | |
| parent | bcachefs: btree_cache.freeable list fixes (diff) | |
| download | kernel-f9f0a5390dcef1f96cc506a2cf7d50c8e348fa3d.tar.gz kernel-f9f0a5390dcef1f96cc506a2cf7d50c8e348fa3d.zip | |
bcachefs: Change OPT_STR max to be 1 less than the size of choices array
Change OPT_STR max value to be 1 less than the "ARRAY_SIZE" of "_choices"
array. As a result, remove -1 from (opt->max-1) in bch2_opt_to_text.
The "_choices" array is a null-terminated array, so computing the maximum
using "ARRAY_SIZE" without subtracting 1 yields an incorrect result. Since
bch2_opt_validate don't subtract 1, as bch2_opt_to_text does, values
bigger than the actual maximum would pass through option validation.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=bee87a0c3291c06aa8c6
Fixes: 63c4b2545382 ("bcachefs: Better superblock opt validation")
Suggested-by: Kent Overstreet <[email protected]>
Signed-off-by: Piotr Zalewski <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts-by-pid.py')
0 files changed, 0 insertions, 0 deletions
