Skip to content
Commit 794eb6bf authored by Jesper Juhl's avatar Jesper Juhl Committed by David S. Miller
Browse files

[NETLABEL]: Fix NULL deref in netlbl_unlabel_staticlist_gen() if ifindex not found



dev_get_by_index() may return NULL if nothing is found. In 
net/netlabel/netlabel_unlabeled.c::netlbl_unlabel_staticlist_gen() the 
function is called, but the return value is never checked. If it returns 
NULL then we'll deref a NULL pointer on the very next line.
I checked the callers, and I don't think this can actually happen today, 
but code changes over time and in the future it might happen and it does 
no harm to be defensive and check for the failure, so that if/when it 
happens we'll fail gracefully instead of crashing.

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Acked-by: default avatarPaul Moore <paul.moore@hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f5ba2d32
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment