diff options
author | Jan Kara <[email protected]> | 2013-11-12 15:11:19 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2013-11-13 12:09:33 +0900 |
commit | 1310a5a99d900ee30b9f171146406bde0c6c2bd4 (patch) | |
tree | ebc404cf6c46c842244445221cdbce51fece9609 /net/lapb/lapb_subr.c | |
parent | d049f74f2dbe71354d43d393ac3a188947811348 (diff) |
rbtree: fix rbtree_postorder_for_each_entry_safe() iterator
The iterator rbtree_postorder_for_each_entry_safe() relies on pointer
underflow behavior when testing for loop termination. In particular it
expects that
&rb_entry(NULL, type, field)->field
is NULL. But the result of this expression is not defined by a C standard
and some gcc versions (e.g. 4.3.4) assume the above expression can never
be equal to NULL. The net result is an oops because the iteration is not
properly terminated.
Fix the problem by modifying the iterator to avoid pointer underflows.
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Cody P Schafer <[email protected]>
Cc: Michel Lespinasse <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Artem Bityutskiy <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Jozsef Kadlecsik <[email protected]>
Cc: Pablo Neira Ayuso <[email protected]>
Cc: Patrick McHardy <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Cc: <[email protected]> [3.12.x]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions