Taehee Yoo
fdf4e678ea
netfilter: xt_IDLETIMER: add sysfs filename checking routine
[ Upstream commit 54451f60c8 ]
When IDLETIMER rule is added, sysfs file is created under
/sys/class/xt_idletimer/timers/
But some label name shouldn't be used.
".", "..", "power", "uevent", "subsystem", etc...
So that sysfs filename checking routine is needed.
test commands:
%iptables -I INPUT -j IDLETIMER --timeout 1 --label "power"
splat looks like:
[95765.423132] sysfs: cannot create duplicate filename '/devices/virtual/xt_idletimer/timers/power'
[95765.433418] CPU: 0 PID: 8446 Comm: iptables Not tainted 4.19.0-rc6+ #20
[95765.449755] Call Trace:
[95765.449755] dump_stack+0xc9/0x16b
[95765.449755] ? show_regs_print_info+0x5/0x5
[95765.449755] sysfs_warn_dup+0x74/0x90
[95765.449755] sysfs_add_file_mode_ns+0x352/0x500
[95765.449755] sysfs_create_file_ns+0x179/0x270
[95765.449755] ? sysfs_add_file_mode_ns+0x500/0x500
[95765.449755] ? idletimer_tg_checkentry+0x3e5/0xb1b [xt_IDLETIMER]
[95765.449755] ? rcu_read_lock_sched_held+0x114/0x130
[95765.449755] ? __kmalloc_track_caller+0x211/0x2b0
[95765.449755] ? memcpy+0x34/0x50
[95765.449755] idletimer_tg_checkentry+0x4e2/0xb1b [xt_IDLETIMER]
[ ... ]
Fixes: 0902b469bd ("netfilter: xtables: idletimer target implementation")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-27 16:10:48 +01:00
..
2018-11-27 16:10:48 +01:00
2018-09-15 09:45:28 +02:00
2017-09-08 18:55:52 +02:00
2017-07-31 19:01:40 +02:00
2017-11-02 11:10:55 +01:00
2017-07-24 13:24:46 +02:00
2018-11-21 09:24:09 +01:00
2017-09-04 13:25:19 +02:00
2017-09-04 13:25:19 +02:00
2018-08-24 13:08:57 +02:00
2017-08-24 18:52:32 +02:00
2018-09-15 09:45:28 +02:00
2017-07-24 13:24:46 +02:00
2018-08-24 13:09:22 +02:00
2017-09-04 13:25:18 +02:00
2017-09-04 13:25:18 +02:00
2017-09-04 13:25:18 +02:00
2017-09-04 13:25:18 +02:00
2017-09-04 13:25:18 +02:00
2017-08-24 18:52:33 +02:00
2017-07-24 13:24:46 +02:00
2017-09-04 13:25:19 +02:00
2017-11-02 11:10:55 +01:00
2018-08-24 13:09:07 +02:00
2017-09-18 17:33:23 +02:00
2018-03-15 10:54:23 +01:00
2017-09-04 13:25:19 +02:00
2017-08-28 17:44:00 +02:00
2017-11-02 11:10:55 +01:00
2018-10-10 08:54:23 +02:00
2018-07-08 15:30:50 +02:00
2017-07-31 20:41:57 +02:00
2018-09-15 09:45:28 +02:00
2018-01-31 14:03:41 +01:00
2017-08-24 18:52:33 +02:00
2017-08-02 14:25:59 +02:00
2018-07-17 11:39:32 +02:00
2018-08-24 13:09:15 +02:00
2017-09-04 13:25:09 +02:00
2018-06-16 09:45:14 +02:00
2017-08-28 17:42:56 +02:00
2017-07-31 19:01:40 +02:00
2018-07-08 15:30:49 +02:00
2018-07-08 15:30:51 +02:00
2018-07-08 15:30:49 +02:00
2017-09-04 13:25:09 +02:00
2017-08-28 17:42:56 +02:00
2017-09-04 13:25:09 +02:00
2017-08-28 18:14:30 +02:00
2018-09-05 09:26:27 +02:00
2017-07-31 20:41:59 +02:00
2018-04-26 11:02:21 +02:00
2017-07-24 13:24:46 +02:00
2018-02-25 11:08:01 +01:00
2018-02-25 11:07:50 +01:00
2018-10-10 08:54:23 +02:00
2017-08-19 13:07:53 +02:00
2017-08-24 18:52:33 +02:00
2018-04-08 14:26:29 +02:00
2018-11-27 16:10:48 +01:00
2018-04-26 11:02:13 +02:00
2018-04-26 11:02:13 +02:00
2017-09-04 13:25:19 +02:00
2017-09-04 13:25:19 +02:00
2018-04-26 11:02:13 +02:00
2018-01-31 14:03:41 +01:00
2018-02-25 11:07:50 +01:00
2018-04-08 14:26:29 +02:00
2017-11-02 11:10:55 +01:00
2017-09-26 20:04:34 +02:00
2018-04-26 11:02:13 +02:00
2017-07-24 13:24:46 +02:00
2017-09-03 17:08:42 -07:00