diff options
author | Eric Dumazet <edumazet@google.com> | 2017-08-15 05:26:17 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-15 17:07:52 -0700 |
commit | 187e5b3ac84d3421d2de3aca949b2791fbcad554 (patch) | |
tree | 44a56af785355119f067c75a799d55fd3789ca86 /net/sched/sch_htb.c | |
parent | b3dc8f772fab5b2d284b780830fd56494491e493 (diff) |
ipv4: fix NULL dereference in free_fib_info_rcu()
If fi->fib_metrics could not be allocated in fib_create_info()
we attempt to dereference a NULL pointer in free_fib_info_rcu() :
m = fi->fib_metrics;
if (m != &dst_default_metrics && atomic_dec_and_test(&m->refcnt))
kfree(m);
Before my recent patch, we used to call kfree(NULL) and nothing wrong
happened.
Instead of using RCU to defer freeing while we are under memory stress,
it seems better to take immediate action.
This was reported by syzkaller team.
Fixes: 3fb07daff8e9 ("ipv4: add reference counting to metrics")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_htb.c')
0 files changed, 0 insertions, 0 deletions