diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2019-11-03 12:36:43 +0100 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2019-11-03 12:36:43 +0100 |
commit | f6341c5af4e6e15041be39976d16deca789555fa (patch) | |
tree | 46eddef8563735d4465c1903d662e5b790ac44be /lib/globtest.c | |
parent | radix tree: Remove radix_tree_iter_find (diff) | |
download | linux-f6341c5af4e6e15041be39976d16deca789555fa.tar.xz linux-f6341c5af4e6e15041be39976d16deca789555fa.zip |
idr: Fix integer overflow in idr_for_each_entry
If there is an entry at INT_MAX then idr_for_each_entry() will increment
id after handling it. This is undefined behaviour, and is caught by
UBSAN. Adding 1U to id forces the operation to be carried out as an
unsigned addition which (when assigned to id) will result in INT_MIN.
Since there is never an entry stored at INT_MIN, idr_get_next() will
return NULL, ending the loop as expected.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'lib/globtest.c')
0 files changed, 0 insertions, 0 deletions