]> git.baikalelectronics.ru Git - kernel.git/commit
taprio: add null check on sched_nest to avoid potential null pointer dereference
authorColin Ian King <colin.king@canonical.com>
Sun, 5 May 2019 21:50:19 +0000 (22:50 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 19:15:33 +0000 (12:15 -0700)
commitc8e16dba7bdbaed68ae15c14db0860a15bb82978
tree15be8d9d00472467adc4850bc77c49a457405d84
parentbdf9ce2c5905e3f5e94ebc89549b482f417f46e8
taprio: add null check on sched_nest to avoid potential null pointer dereference

The call to nla_nest_start_noflag can return a null pointer and currently
this is not being checked and this can lead to a null pointer dereference
when the null pointer sched_nest is passed to function nla_nest_end. Fix
this by adding in a null pointer check.

Addresses-Coverity: ("Dereference null return value")
Fixes: 674ce249fa94 ("taprio: Add support adding an admin schedule")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_taprio.c