Taehee Yoo
fdf4e678ea
netfilter: xt_IDLETIMER: add sysfs filename checking routine
...
[ Upstream commit 54451f60c8fa061af9051a53be9786393947367c ]
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: 0902b469bd25 ("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-10-03 17:00:47 -07:00
2018-11-21 09:24:04 +01:00
2017-11-02 11:10:55 +01:00
2018-07-22 14:28:44 +02:00
2017-11-02 11:10:55 +01:00
2018-07-22 14:28:43 +02:00
2017-11-02 11:10:55 +01:00
2018-10-20 09:48:49 +02:00
2018-11-04 14:52:39 +01:00
2018-11-04 14:52:48 +01:00
2018-09-05 09:26:27 +02:00
2018-01-23 19:58:17 +01:00
2018-05-30 07:52:04 +02:00
2018-11-23 08:19:25 +01:00
2018-09-19 22:43:43 +02:00
2018-10-18 09:16:21 +02:00
2018-02-25 11:07:52 +01:00
2018-07-22 14:28:49 +02:00
2018-08-06 16:20:48 +02:00
2017-06-16 11:48:40 -04:00
2017-08-22 13:40:23 -07:00
2018-09-19 22:43:47 +02:00
2018-04-29 11:33:13 +02:00
2018-11-23 08:19:27 +01:00
2018-11-23 08:19:25 +01:00
2017-11-02 11:10:55 +01:00
2018-03-31 18:10:41 +02:00
2018-06-11 22:49:19 +02:00
2018-06-16 09:45:14 +02:00
2018-11-04 14:52:43 +01:00
2017-07-04 22:35:16 +01:00
2018-11-04 14:52:48 +01:00
2018-11-04 14:52:37 +01:00
2018-09-09 19:55:52 +02:00
2018-02-22 15:42:28 +01:00
2017-10-21 01:56:38 +01:00
2018-11-27 16:10:48 +01:00
2018-10-18 09:16:18 +02:00
2018-08-09 12:16:38 +02:00
2017-07-04 22:35:17 +01:00
2018-09-29 03:06:01 -07:00
2018-07-22 14:28:49 +02:00
2018-11-04 14:52:50 +01:00
2018-10-18 09:16:19 +02:00
2017-11-02 11:10:55 +01:00
2017-11-01 12:19:03 +09:00
2018-08-24 13:09:13 +02:00
2018-10-13 09:27:29 +02:00
2018-05-16 10:10:26 +02:00
2018-11-04 14:52:46 +01:00
2018-11-13 11:15:18 -08:00
2018-11-23 08:19:26 +01:00
2018-08-24 13:09:22 +02:00
2018-07-22 14:28:47 +02:00
2018-11-21 09:24:14 +01:00
2017-08-07 14:48:48 -07:00
2018-10-18 09:16:19 +02:00
2018-10-03 17:00:58 -07:00
2017-11-02 10:04:46 -07:00
2018-08-22 07:46:08 +02:00
2017-11-02 11:10:55 +01:00
2018-11-04 14:52:40 +01:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:14:50 -08:00
2018-05-19 10:20:24 +02:00
2017-09-04 13:25:20 +02:00
2017-11-02 11:10:55 +01:00
2018-11-04 14:52:49 +01:00