diff options
| author | Alexander Duyck <[email protected]> | 2015-03-10 21:39:34 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2015-03-10 22:36:56 +0000 |
| commit | ddb4b9a1328ea89733133e86cf1972d23891abfc (patch) | |
| tree | 39e6b01f93a37c97fa6721ff7fa0976cd44a0555 /net/switchdev/switchdev.c | |
| parent | macb: Fix merge error. (diff) | |
| download | kernel-ddb4b9a1328ea89733133e86cf1972d23891abfc.tar.gz kernel-ddb4b9a1328ea89733133e86cf1972d23891abfc.zip | |
fib_trie: Address possible NULL pointer dereference in resize
If the inflate call failed it would return NULL. As a result tp would be
set to NULL and cause use to trigger a NULL pointer dereference in
should_halve if the inflate failed on the first attempt.
In order to prevent this we should decrement max_work before we actually
attempt to inflate as this will force us to exit before attempting to halve
a node we should have inflated. In order to keep things symmetric between
inflate and halve I went ahead and also moved the decrement of max_work for
the halve case as well so we take care of that before we actually attempt
to halve the tnode.
Fixes: 88bae714 ("fib_trie: Add key vector to root, return parent key_vector in resize")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Alexander Duyck <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions
