diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2019-06-28 20:03:41 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-02 04:15:46 +0200 |
commit | e33d2b74d805af0e4c8060f41040595ba105a520 (patch) | |
tree | 0952dd1b3f4617a5309a0070b192e247122b3aca /net/wireless/.gitignore | |
parent | Merge branch 'vsock-virtio-fixes' (diff) | |
download | linux-e33d2b74d805af0e4c8060f41040595ba105a520.tar.xz linux-e33d2b74d805af0e4c8060f41040595ba105a520.zip |
idr: fix overflow case for idr_for_each_entry_ul()
idr_for_each_entry_ul() is buggy as it can't handle overflow
case correctly. When we have an ID == UINT_MAX, it becomes an
infinite loop. This happens when running on 32-bit CPU where
unsigned long has the same size with unsigned int.
There is no better way to fix this than casting it to a larger
integer, but we can't just 64 bit integer on 32 bit CPU. Instead
we could just use an additional integer to help us to detect this
overflow case, that is, adding a new parameter to this macro.
Fortunately tc action is its only user right now.
Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR")
Reported-by: Li Shuang <shuali@redhat.com>
Tested-by: Davide Caratti <dcaratti@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Chris Mi <chrism@mellanox.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wireless/.gitignore')
0 files changed, 0 insertions, 0 deletions