android_kernel_samsung_msm8976/net/netfilter
Taehee Yoo c7f8cde37a netfilter: xt_IDLETIMER: add sysfs filename checking routine
commit 54451f60c8fa061af9051a53be9786393947367c upstream.

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")
Change-Id: I0340b4b7e9929409b819a733899b51d61d4bbe5c
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 22:08:35 +02:00
..
ipset netfilter: ipset: small potential read beyond the end of buffer 2015-01-27 07:52:33 -08:00
ipvs ipvs: fix buffer overflow with sync daemon and service 2019-07-27 22:08:33 +02:00
Kconfig BACKPORT: netfilter: Kconfig: get rid of parens around depends on 2019-07-27 21:51:02 +02:00
Makefile netfilter: xtables: hardidletimer target implementation 2014-07-11 17:08:02 -07:00
core.c
nf_conntrack_acct.c
nf_conntrack_amanda.c netfilter: Fix is to allow successful restore 2014-07-22 16:29:37 +05:30
nf_conntrack_broadcast.c
nf_conntrack_core.c This is the 3.10.99 stable release 2017-04-18 17:17:46 +02:00
nf_conntrack_ecache.c netfilter: invoke synchronize_rcu after set the _hook_ to NULL 2019-07-27 21:44:22 +02:00
nf_conntrack_expect.c netfilter: nf_conntrack: Support expectations in different zones 2015-10-22 14:37:50 -07:00
nf_conntrack_extend.c netfilter: nf_ct_ext: fix possible panic after nf_ct_extend_unregister 2019-07-27 21:44:26 +02:00
nf_conntrack_ftp.c
nf_conntrack_h323_asn1.c
nf_conntrack_h323_main.c
nf_conntrack_h323_types.c
nf_conntrack_helper.c
nf_conntrack_irc.c Netfilter: IRC DCC fixes 2015-06-19 14:38:50 +05:30
nf_conntrack_l3proto_generic.c
nf_conntrack_labels.c
nf_conntrack_netbios_ns.c
nf_conntrack_netlink.c netfilter: ctnetlink: fix incorrect nf_ct_put during hash resize 2019-07-27 21:44:51 +02:00
nf_conntrack_pptp.c
nf_conntrack_proto.c
nf_conntrack_proto_dccp.c
nf_conntrack_proto_generic.c netfilter: conntrack: disable generic tracking for known protocols 2015-04-29 10:33:59 +02:00
nf_conntrack_proto_gre.c
nf_conntrack_proto_sctp.c
nf_conntrack_proto_tcp.c netfilter: nf_conntrack: avoid large timeout for mid-stream pickup 2014-10-05 14:54:15 -07:00
nf_conntrack_proto_udp.c
nf_conntrack_proto_udplite.c
nf_conntrack_sane.c
nf_conntrack_sip.c netfilter: Fix to MO call issue 2015-03-24 11:53:07 +05:30
nf_conntrack_snmp.c
nf_conntrack_standalone.c
nf_conntrack_tftp.c
nf_conntrack_timeout.c
nf_conntrack_timestamp.c
nf_internals.h
nf_log.c netfilter: nf_log: don't hold nf_log_mutex during user access 2019-07-27 21:50:15 +02:00
nf_nat_amanda.c
nf_nat_core.c netfilter: nf_nat: add full port randomization support 2019-07-27 22:08:25 +02:00
nf_nat_ftp.c
nf_nat_helper.c
nf_nat_irc.c netfilter:Changes to Allow IRC DCC 2014-11-17 09:24:00 +05:30
nf_nat_proto_common.c netfilter: nf_nat: add full port randomization support 2019-07-27 22:08:25 +02:00
nf_nat_proto_dccp.c
nf_nat_proto_sctp.c
nf_nat_proto_tcp.c
nf_nat_proto_udp.c
nf_nat_proto_udplite.c
nf_nat_proto_unknown.c
nf_nat_sip.c msm: netfilter: changes to handle contact address modification in SIP ALG 2015-01-28 01:54:53 -08:00
nf_nat_tftp.c
nf_queue.c
nf_sockopt.c
nf_tproxy_core.c
nfnetlink.c net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-06-26 15:12:37 -04:00
nfnetlink_acct.c
nfnetlink_cthelper.c netfilter: nfnetlink_cthelper: Add missing permission checks 2019-07-27 21:45:53 +02:00
nfnetlink_cttimeout.c netfilter: invoke synchronize_rcu after set the _hook_ to NULL 2019-07-27 21:44:22 +02:00
nfnetlink_log.c netfilter: nf_log: release skbuff on nlmsg put failure 2014-11-21 09:22:54 -08:00
nfnetlink_queue_core.c netfilter: nf_queue: augment nfqa_cfg_policy 2019-07-27 21:52:53 +02:00
nfnetlink_queue_ct.c
x_tables.c netfilter: x_tables: add and use xt_check_proc_name 2019-07-27 22:08:34 +02:00
xt_AUDIT.c
xt_CHECKSUM.c
xt_CLASSIFY.c
xt_CONNSECMARK.c
xt_CT.c
xt_DSCP.c
xt_HARDIDLETIMER.c netfilter:Notify user space on creating sysfs file 2019-07-27 21:51:05 +02:00
xt_HL.c
xt_HMARK.c
xt_IDLETIMER.c netfilter: xt_IDLETIMER: add sysfs filename checking routine 2019-07-27 22:08:35 +02:00
xt_LED.c netfilter: x_tables: fix missing timer initialization in xt_LED 2019-07-27 21:49:20 +02:00
xt_LOG.c
xt_NETMAP.c
xt_NFLOG.c
xt_NFQUEUE.c
xt_RATEEST.c netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert 2019-07-27 21:49:19 +02:00
xt_REDIRECT.c
xt_SECMARK.c
xt_TCPMSS.c netfilter: xt_TCPMSS: correct return value in tcpmss_mangle_packet 2019-07-27 21:46:06 +02:00
xt_TCPOPTSTRIP.c
xt_TEE.c
xt_TPROXY.c
xt_TRACE.c
xt_addrtype.c
xt_bpf.c
xt_cluster.c
xt_comment.c
xt_connbytes.c
xt_connlabel.c
xt_connlimit.c
xt_connmark.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
xt_conntrack.c
xt_cpu.c
xt_dccp.c
xt_devgroup.c
xt_dscp.c
xt_ecn.c
xt_esp.c
xt_hashlimit.c netfilter: x_tables: add and use xt_check_proc_name 2019-07-27 22:08:34 +02:00
xt_helper.c
xt_hl.c
xt_iprange.c
xt_ipvs.c
xt_length.c
xt_limit.c
xt_mac.c
xt_mark.c
xt_multiport.c
xt_nat.c
xt_nfacct.c
xt_osf.c netfilter: xt_osf: Add missing permission checks 2019-07-27 21:45:53 +02:00
xt_owner.c
xt_physdev.c
xt_pkttype.c
xt_policy.c
xt_qtaguid.c BACKPORT: ANDROID: Use sk_uid to replace uid get from socket file 2019-07-27 21:51:34 +02:00
xt_qtaguid_internal.h BACKPORT: ANDROID: Use sk_uid to replace uid get from socket file 2019-07-27 21:51:34 +02:00
xt_qtaguid_print.c ANDROID: Add untag hacks to inet_release function 2019-07-27 21:50:41 +02:00
xt_qtaguid_print.h
xt_quota.c
xt_quota2.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
xt_rateest.c
xt_realm.c
xt_recent.c netfilter: x_tables: add and use xt_check_proc_name 2019-07-27 22:08:34 +02:00
xt_repldata.h
xt_sctp.c
xt_set.c
xt_socket.c netfilter: xt_socket: add XT_SOCKET_RESTORESKMARK flag 2015-12-14 09:53:08 -07:00
xt_state.c
xt_statistic.c
xt_string.c
xt_tcpmss.c
xt_tcpudp.c
xt_time.c
xt_u32.c