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-07-06 12:32:12 +02:00
2018-11-03 10:35:52 -07:00
2018-10-19 17:01:43 -07:00
2018-06-28 10:40:47 -07:00
2018-10-23 10:57:06 -07:00
2018-07-24 14:10:42 -07:00
2018-11-12 10:41:29 +01:00
2018-11-01 19:58:52 -07:00
2018-10-19 13:49:34 -07:00
2018-10-22 19:37:36 -07:00
2018-11-17 21:38:44 -08:00
2018-10-23 10:57:06 -07:00
2018-11-09 17:19:34 +01:00
2018-11-19 17:59:47 +01:00
2018-11-29 11:06:08 -08:00
2018-07-27 13:17:50 -07:00
2018-10-23 10:57:06 -07:00
2018-09-21 19:48:36 -07:00
2018-10-04 09:40:52 -07:00
2018-10-22 19:49:04 -07:00
2018-06-26 11:33:04 +09:00
2018-09-21 19:45:52 -07:00
2018-11-28 11:02:45 -08:00
2018-11-28 11:02:45 -08:00
2018-10-23 10:57:06 -07:00
2018-09-17 18:43:42 -07:00
2018-07-27 09:33:37 -07:00
2018-11-14 22:49:31 -08:00
2018-10-22 19:59:20 -07:00
2018-10-12 13:05:40 +02:00
2018-09-28 12:46:07 +08:00
2018-10-16 00:14:07 -07:00
2018-10-17 22:14:54 -07:00
2018-11-28 10:56:40 +01:00
2018-09-21 18:58:34 -07:00
2018-10-16 00:13:12 -07:00
2018-06-28 10:40:47 -07:00
2018-10-24 14:43:41 +01:00
2018-07-12 16:55:29 -07:00
2018-11-30 13:18:09 -08:00
2018-11-23 11:08:03 -08:00
2018-06-28 10:40:47 -07:00
2018-07-05 20:20:03 +09:00
2018-10-12 21:38:46 -07:00
2018-09-04 21:33:03 -07:00
2018-06-28 10:40:47 -07:00
2018-11-15 11:35:40 -08:00
2018-11-30 17:14:06 -08:00
2018-11-30 13:12:43 -08:00
2018-11-21 16:14:56 -08:00
2018-10-15 12:23:19 -07:00
2018-11-15 10:59:37 -06:00
2018-11-27 16:30:39 -08:00
2018-11-01 19:58:52 -07:00
2018-10-23 10:57:06 -07:00
2018-08-07 12:39:13 -07:00
2018-07-24 14:10:42 -07:00
2018-10-12 12:56:34 +02:00
2018-11-29 14:25:36 -08:00
2018-10-19 11:03:06 -07:00
2018-11-03 18:25:17 -07:00
2018-08-29 15:42:24 +02:00
2018-10-15 12:23:19 -07:00
2018-06-28 13:36:39 +09:00
2018-11-17 21:34:11 -08:00