Davide Caratti
fd6d433865
net/sched: act_police: fix memory leak in case of invalid control action
...
when users set an invalid control action, kmemleak complains as follows:
# echo clear >/sys/kernel/debug/kmemleak
# ./tdc.py -e b48b
Test b48b: Add police action with exceed goto chain control action
All test results:
1..1
ok 1 - b48b # Add police action with exceed goto chain control action
about to flush the tap output if tests need to be skipped
done flushing skipped test tap output
# echo scan >/sys/kernel/debug/kmemleak
# cat /sys/kernel/debug/kmemleak
unreferenced object 0xffffa0fafbc3dde0 (size 96):
comm "tc", pid 2358, jiffies 4294922738 (age 17.022s)
hex dump (first 32 bytes):
2a 00 00 20 00 00 00 00 00 00 7d 00 00 00 00 00 *.. ......}.....
f8 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<00000000648803d2>] tcf_action_init_1+0x384/0x4c0
[<00000000cb69382e>] tcf_action_init+0x12b/0x1a0
[<00000000847ef0d4>] tcf_action_add+0x73/0x170
[<0000000093656e14>] tc_ctl_action+0x122/0x160
[<0000000023c98e32>] rtnetlink_rcv_msg+0x263/0x2d0
[<000000003493ae9c>] netlink_rcv_skb+0x4d/0x130
[<00000000de63f8ba>] netlink_unicast+0x209/0x2d0
[<00000000c3da0ebe>] netlink_sendmsg+0x2c1/0x3c0
[<000000007a9e0753>] sock_sendmsg+0x33/0x40
[<00000000457c6d2e>] ___sys_sendmsg+0x2a0/0x2f0
[<00000000c5c6a086>] __sys_sendmsg+0x5e/0xa0
[<00000000446eafce>] do_syscall_64+0x5b/0x180
[<000000004aa871f2>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[<00000000450c38ef>] 0xffffffffffffffff
change tcf_police_init() to avoid leaking 'new' in case TCA_POLICE_RESULT
contains TC_ACT_GOTO_CHAIN extended action.
Fixes: c08f5ed5d625 ("net/sched: act_police: disallow 'goto chain' on fallback control action")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-30 17:14:06 -08:00
..
2018-10-08 10:39:04 -07:00
2018-08-31 22:50:15 -07:00
2018-08-31 22:57:43 -07:00
2018-08-31 22:50:15 -07:00
2018-10-22 19:40:55 -07:00
2018-09-04 21:33:03 -07:00
2018-10-03 21:00:17 -07:00
2017-12-13 13:18:46 -05:00
2017-10-12 22:13:20 -07:00
2017-12-13 13:18:46 -05:00
2018-11-11 10:21:31 -08:00
2018-09-08 10:18:25 -07:00
2018-11-16 19:53:45 -08:00
2018-11-30 17:14:06 -08:00
2018-09-18 09:33:27 -07:00
2018-08-31 22:50:15 -07:00
2018-09-08 10:17:35 -07:00
2018-08-31 22:50:15 -07:00
2018-09-12 22:22:42 -07:00
2018-08-31 22:50:15 -07:00
2018-10-19 11:03:06 -07:00
2018-07-24 14:10:42 -07:00
2018-07-29 13:19:49 -07:00
2018-05-24 22:56:15 -04:00
2018-05-24 22:56:15 -04:00
2018-11-10 09:55:30 -08:00
2018-05-24 22:56:15 -04:00
2018-08-16 12:08:26 -07:00
2018-05-24 22:56:15 -04:00
2018-05-24 22:56:15 -04:00
2018-08-13 19:37:42 -07:00
2018-10-12 21:38:46 -07:00
2014-10-06 18:02:32 -04:00
2016-11-03 10:56:21 +01:00
2018-02-21 13:15:33 -05:00
2017-07-01 07:39:08 -07:00
2018-01-24 14:52:40 -05:00
2015-02-22 15:59:54 -05:00
2017-10-16 21:00:40 +01:00
2018-10-04 13:52:23 -07:00
2018-10-04 13:52:23 -07:00
2018-10-24 14:35:09 -07:00
2018-09-25 20:17:35 -07:00
2018-06-17 08:42:33 +09:00
2018-10-12 21:38:46 -07:00
2018-09-25 20:17:35 -07:00
2018-09-25 20:17:35 -07:00
2017-12-21 12:32:50 -05:00
2017-12-21 12:32:50 -05:00
2018-09-25 20:17:35 -07:00
2018-09-25 20:17:35 -07:00
2018-07-04 22:30:28 +09:00
2018-09-25 20:17:35 -07:00
2018-09-10 10:06:54 -07:00
2018-11-15 11:42:12 -08:00
2018-10-10 22:49:16 -07:00
2018-10-28 19:23:26 -07:00
2018-09-25 20:17:35 -07:00
2018-09-10 10:06:54 -07:00
2018-09-25 20:17:35 -07:00
2018-01-17 14:53:57 -05:00
2018-09-25 20:17:35 -07:00
2018-09-25 20:17:35 -07:00
2018-09-25 20:17:35 -07:00
2018-11-29 16:27:27 -08:00
2018-10-07 20:39:01 -07:00
2017-12-21 12:32:50 -05:00
2018-09-25 20:17:35 -07:00
2018-09-25 20:17:35 -07:00
2018-09-25 20:17:35 -07:00
2018-09-25 20:17:35 -07:00
2017-12-21 12:32:51 -05:00
2018-07-24 14:44:00 -07:00
2018-10-04 13:52:23 -07:00
2018-09-25 20:17:35 -07:00
2017-12-21 12:32:50 -05:00