xt_recent cleanups, xt_SYSRQ
Subsystems (3)
The following changes since commit 5c2a54214ae988708d84e3269dc99176b086ec1a:
netfilter: xt_recent: explain if module parameters are wrong (2012-07-10 22:50:59 +0200)
are available in the git repository at:
git://git.inai.de/linux master
Jan Engelhardt (4):
netfilter: xt_recent: remove ip_list_hash_size parameter
netfilter: cleanup use of the term "IPs"
netfilter: use permission mnemonics in module_param
netfilter: xtables: inclusion of xt_SYSRQ
net/ipv4/netfilter/ipt_ULOG.c | 6 +- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 2 +- net/ipv4/netfilter/nf_nat_snmp_basic.c | 2 +- net/netfilter/Kconfig | 12 + net/netfilter/Makefile | 1 + net/netfilter/ipset/ip_set_core.c | 2 +- net/netfilter/ipvs/Kconfig | 15 +- net/netfilter/ipvs/ip_vs_conn.c | 2 +- net/netfilter/ipvs/ip_vs_ftp.c | 2 +- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_amanda.c | 4 +- net/netfilter/nf_conntrack_core.c | 2 +- net/netfilter/nf_conntrack_expect.c | 2 +- net/netfilter/nf_conntrack_ftp.c | 4 +- net/netfilter/nf_conntrack_h323_main.c | 6 +- net/netfilter/nf_conntrack_helper.c | 3 +- net/netfilter/nf_conntrack_irc.c | 6 +- net/netfilter/nf_conntrack_sane.c | 2 +- net/netfilter/nf_conntrack_sip.c | 8 +- net/netfilter/nf_conntrack_tftp.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/xt_SYSRQ.c | 361 ++++++++++++++++++++++++ net/netfilter/xt_recent.c | 11 +- 23 files changed, 417 insertions(+), 42 deletions(-) create mode 100644 net/netfilter/xt_SYSRQ.c
PATCH 1/4 netfilter: xt_recent: remove ip_list_hash_size parameter
This module parameter has no effect, since the user-specified value is overriden by the init function anyway.
--- net/netfilter/xt_recent.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
net/netfilter/xt_recent.c +0 -1
@@ -50,7 +50,6 @@ static unsigned int ip_list_uid = 0;static unsigned int ip_list_gid =0 ;module_param (ip_list_tot, uint,0400 );module_param (ip_pkt_list_tot, uint,0400 ); -module_param (ip_list_hash_size, uint,0400 );module_param (ip_list_perms, uint,0400 );module_param (ip_list_uid, uint,S_IRUGO |S_IWUSR );module_param (ip_list_gid, uint,S_IRUGO |S_IWUSR );
Signature · 1 line
1.7.7
Pablo Neira Ayuso
maintainerRe: [PATCH 1/4] netfilter: xt_recent: remove ip_list_hash_size parameter
Quoted 2 lines · Jan Engelhardt
This module parameter has no effect, since the user-specified value is overriden by the init function anyway.
My only concern with this is to break existing configuration that sets that module parameter.
I wonder if it's useful to fix this module parameter to make it work instead.
Quoted 20 lines
Signed-off-by Jan Engelhardt <[email protected]>--- net/netfilter/xt_recent.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)net/netfilter/xt_recent.c +0
-1@@ -50,7 +50,6 @@ static unsigned int ip_list_uid = 0;static unsigned int ip_list_gid =0 ;module_param (ip_list_tot, uint,0400 );module_param (ip_pkt_list_tot, uint,0400 ); -module_param (ip_list_hash_size, uint,0400 );module_param (ip_list_perms, uint,0400 );module_param (ip_list_uid, uint,S_IRUGO |S_IWUSR );module_param (ip_list_gid, uint,S_IRUGO |S_IWUSR );Signature · 1 line
1.7.7
PATCH 2/4 netfilter: cleanup use of the term "IPs"
In reply to Jan EngelhardtSeen meticulously, we have two IPs these days (Internet Protocol 4, and 6). Clean up and explicitly use "IP addresses" to disambiguate.
--- net/netfilter/ipvs/Kconfig | 15 ++++++++------- net/netfilter/xt_recent.c | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-)
net/netfilter/ipvs/Kconfig +8 -7
@@ -238,13 +238,14 @@ config IP_VS_SH_TAB_BITS range 4 20 default 8 ---help--- - The source hashing scheduler maps source IPs to destinations - stored in a hash table. This table is tiled by each destination - until all slots in the table are filled. When using weights to - allow destinations to receive more connections, the table is - tiled an amount proportional to the weights specified. The table - needs to be large enough to effectively fit all the destinations - multiplied by their respective weights. + The source hashing scheduler maps source IP addresses to + destinations stored in a hash table. This table is tiled by + each destination until all slots in the table are filled. + When using weights to allow destinations to receive more + connections, the table is tiled an amount proportional to + the weights specified. The table needs to be large enough + to effectively fit all the destinations multiplied by their + respective weights. comment 'IPVS application helper'
net/netfilter/xt_recent.c +2 -2
@@ -53,9 +53,9 @@ module_param(ip_pkt_list_tot, uint, 0400);module_param (ip_list_perms, uint,0400 );module_param (ip_list_uid, uint,S_IRUGO |S_IWUSR );module_param (ip_list_gid, uint,S_IRUGO |S_IWUSR ); -MODULE_PARM_DESC (ip_list_tot,"number of IPs to remember per list (>0)" ); +MODULE_PARM_DESC (ip_list_tot,"number of IP addresses to remember per list (>0)" );MODULE_PARM_DESC (ip_pkt_list_tot,"number of packets per IP address to remember (1-255)" ); -MODULE_PARM_DESC (ip_list_hash_size,"size of hash table used to look up IPs" ); +MODULE_PARM_DESC (ip_list_hash_size,"size of hash table used to look up IP addresses" );MODULE_PARM_DESC (ip_list_perms,"permissions on /proc/net/xt_recent/* files" );MODULE_PARM_DESC (ip_list_uid,"default owner of /proc/net/xt_recent/* files" );MODULE_PARM_DESC (ip_list_gid,"default owning group of /proc/net/xt_recent/* files" );
Signature · 1 line
1.7.7
Pablo Neira Ayuso
maintainerRe: [PATCH 2/4] netfilter: cleanup use of the term "IPs"
Quoted 40 lines · Jan Engelhardt
Seen meticulously, we have two IPs these days (Internet Protocol 4, and 6). Clean up and explicitly use "IP addresses" to disambiguate.
Signed-off-by Jan Engelhardt <[email protected]>--- net/netfilter/ipvs/Kconfig | 15 ++++++++------- net/netfilter/xt_recent.c | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-)net/netfilter/ipvs/Kconfig +8
-7@@ -238,13 +238,14 @@ config IP_VS_SH_TAB_BITS range 4 20 default 8 ---help--- - The source hashing scheduler maps source IPs to destinations - stored in a hash table. This table is tiled by each destination - until all slots in the table are filled. When using weights to - allow destinations to receive more connections, the table is - tiled an amount proportional to the weights specified. The table - needs to be large enough to effectively fit all the destinations - multiplied by their respective weights. + The source hashing scheduler maps source IP addresses to + destinations stored in a hash table. This table is tiled by + each destination until all slots in the table are filled. + When using weights to allow destinations to receive more + connections, the table is tiled an amount proportional to + the weights specified. The table needs to be large enough + to effectively fit all the destinations multiplied by their + respective weights. comment 'IPVS application helper'net/netfilter/xt_recent.c +0
-0
net/netfilter/xt_recent.c module_param(ip_pkt_list_tot, uint, 0400); · line 58
Quoted 8 lines
net/netfilter/xt_recent.c +2
-2@@ -53,9 +53,9 @@ module_param(ip_pkt_list_tot, uint, 0400);module_param (ip_list_perms, uint,0400 );module_param (ip_list_uid, uint,S_IRUGO |S_IWUSR );module_param (ip_list_gid, uint,S_IRUGO |S_IWUSR ); -MODULE_PARM_DESC (ip_list_tot,"number of IPs to remember per list (>0)" ); +MODULE_PARM_DESC (ip_list_tot,"number of IP addresses to remember per list (>0)" );MODULE_PARM_DESC (ip_pkt_list_tot,"number of packets per IP address to remember (1-255)" ); -MODULE_PARM_DESC (ip_list_hash_size,"size of hash table used to look up IPs" ); +MODULE_PARM_DESC (ip_list_hash_size,"size of hash table used to look up IP addresses" );
Isn't it this the module parameter that you just delete it in the previous patch?
Quoted 6 lines
net/netfilter/xt_recent.c +0
-0MODULE_PARM_DESC (ip_list_perms,"permissions on /proc/net/xt_recent/* files" );MODULE_PARM_DESC (ip_list_uid,"default owner of /proc/net/xt_recent/* files" );MODULE_PARM_DESC (ip_list_gid,"default owning group of /proc/net/xt_recent/* files" );Signature · 1 line
1.7.7
PATCH 3/4 netfilter: use permission mnemonics in module_param
In reply to Jan EngelhardtNoticed the inconsistent use while going over xt_recent; cleanup the mode numbers, replacing them by the simpler mnemonics they go by.
--- net/ipv4/netfilter/ipt_ULOG.c | 6 +++--- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 2 +- net/ipv4/netfilter/nf_nat_snmp_basic.c | 2 +- net/netfilter/ipset/ip_set_core.c | 2 +- net/netfilter/ipvs/ip_vs_conn.c | 2 +- net/netfilter/ipvs/ip_vs_ftp.c | 2 +- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_amanda.c | 4 ++-- net/netfilter/nf_conntrack_core.c | 2 +- net/netfilter/nf_conntrack_expect.c | 2 +- net/netfilter/nf_conntrack_ftp.c | 4 ++-- net/netfilter/nf_conntrack_h323_main.c | 6 +++--- net/netfilter/nf_conntrack_helper.c | 3 ++- net/netfilter/nf_conntrack_irc.c | 6 +++--- net/netfilter/nf_conntrack_sane.c | 2 +- net/netfilter/nf_conntrack_sip.c | 8 ++++---- net/netfilter/nf_conntrack_tftp.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/xt_recent.c | 6 +++--- 19 files changed, 33 insertions(+), 32 deletions(-)
net/ipv4/netfilter/ipt_ULOG.c +3 -3
@@ -58,15 +58,15 @@ MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_NFLOG);#define ULOG_MAXNLGROUPS 32/* numer of nlgroups */ static unsigned int nlbufsiz =NLMSG_GOODSIZE ; -module_param (nlbufsiz, uint,0400 ); +module_param (nlbufsiz, uint,S_IRUSR );MODULE_PARM_DESC (nlbufsiz,"netlink buffer size" );static unsigned int flushtimeout =10 ; -module_param (flushtimeout, uint,0600 ); +module_param (flushtimeout, uint,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (flushtimeout,"buffer flush timeout (hundredths of a second)" );static bool nflog = true; -module_param (nflog, bool,0400 ); +module_param (nflog, bool,S_IRUSR );MODULE_PARM_DESC (nflog,"register as internal netfilter logging module" );/* global data structures */
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +1 -1
@@ -414,7 +414,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = { };module_param_call (hashsize, nf_conntrack_set_hashsize, param_get_uint, - &nf_conntrack_htable_size,0600 ); + &nf_conntrack_htable_size,S_IRUSR |S_IWUSR );MODULE_ALIAS ("nf_conntrack-" __stringify(AF_INET ));MODULE_ALIAS ("ip_conntrack" );
net/ipv4/netfilter/nf_nat_snmp_basic.c +1 -1
@@ -1309,4 +1309,4 @@ static void __exit nf_nat_snmp_basic_fini(void)module_init (nf_nat_snmp_basic_init);module_exit (nf_nat_snmp_basic_fini); -module_param (debug, int,0600 ); +module_param (debug, int,S_IRUSR |S_IWUSR );
net/netfilter/ipset/ip_set_core.c +1 -1
@@ -35,7 +35,7 @@ static ip_set_id_t ip_set_max = CONFIG_IP_SET_MAX; /* max number of sets */static unsigned int max_sets; -module_param (max_sets, int,0600 ); +module_param (max_sets, int,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (max_sets,"maximal number of sets" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>" );
net/netfilter/ipvs/ip_vs_conn.c +1 -1
@@ -49,7 +49,7 @@* Connection hash size. Default is what was selected at compile time. */ static int ip_vs_conn_tab_bits =CONFIG_IP_VS_TAB_BITS ; -module_param_named (conn_tab_bits, ip_vs_conn_tab_bits, int,0444 ); +module_param_named (conn_tab_bits, ip_vs_conn_tab_bits, int,S_IRUGO );MODULE_PARM_DESC (conn_tab_bits,"Set connections' hash size" );/* size and mask values */
net/netfilter/ipvs/ip_vs_ftp.c +1 -1
@@ -54,7 +54,7 @@*/ static unsigned int ports_count =1 ;static unsigned short ports[IP_VS_APP_MAX_PORTS ] = {21 ,0 }; -module_param_array (ports, ushort, &ports_count,0444 ); +module_param_array (ports, ushort, &ports_count,S_IRUGO );MODULE_PARM_DESC (ports,"Ports to monitor for FTP control commands" );
net/netfilter/nf_conntrack_acct.c +1 -1
@@ -20,7 +20,7 @@static bool nf_ct_acct__read_mostly ; -module_param_named (acct, nf_ct_acct, bool,0644 ); +module_param_named (acct, nf_ct_acct, bool,S_IRUGO |S_IWUSR );MODULE_PARM_DESC (acct,"Enable connection tracking flow accounting." );#ifdef CONFIG_SYSCTL
net/netfilter/nf_conntrack_amanda.c +2 -2
@@ -33,9 +33,9 @@ MODULE_LICENSE("GPL");MODULE_ALIAS ("ip_conntrack_amanda" );MODULE_ALIAS_NFCT_HELPER ("amanda" ); -module_param (master_timeout, uint,0600 ); +module_param (master_timeout, uint,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (master_timeout,"timeout for the master connection" ); -module_param (ts_algo, charp,0400 ); +module_param (ts_algo, charp,S_IRUSR );MODULE_PARM_DESC (ts_algo,"textsearch algorithm to use (default kmp)" ); unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,
net/netfilter/nf_conntrack_core.c +1 -1
@@ -1458,7 +1458,7 @@ int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)EXPORT_SYMBOL_GPL (nf_conntrack_set_hashsize);module_param_call (hashsize, nf_conntrack_set_hashsize, param_get_uint, - &nf_conntrack_htable_size,0600 ); + &nf_conntrack_htable_size,S_IRUSR |S_IWUSR );void nf_ct_untracked_status_or (unsigned long bits) {
net/netfilter/nf_conntrack_expect.c +1 -1
@@ -602,7 +602,7 @@ static void exp_proc_remove(struct net *net)#endif /* CONFIG_NF_CONNTRACK_PROCFS */ } -module_param_named (expect_hashsize, nf_ct_expect_hsize, uint,0400 ); +module_param_named (expect_hashsize, nf_ct_expect_hsize, uint,S_IRUSR );int nf_conntrack_expect_init (struct net *net) {
net/netfilter/nf_conntrack_ftp.c +2 -2
@@ -40,10 +40,10 @@ static DEFINE_SPINLOCK(nf_ftp_lock);#define MAX_PORTS 8static u_int16_t ports[MAX_PORTS ];static unsigned int ports_c; -module_param_array (ports, ushort, &ports_c,0400 ); +module_param_array (ports, ushort, &ports_c,S_IRUSR );static bool loose; -module_param (loose, bool,0600 ); +module_param (loose, bool,S_IRUSR |S_IWUSR ); unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb, enum ip_conntrack_info ctinfo,
net/netfilter/nf_conntrack_h323_main.c +3 -3
@@ -35,15 +35,15 @@/* Parameters */ static unsigned int default_rrq_ttl__read_mostly =300 ; -module_param (default_rrq_ttl, uint,0600 ); +module_param (default_rrq_ttl, uint,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (default_rrq_ttl,"use this TTL if it's missing in RRQ" );static int gkrouted_only__read_mostly =1 ; -module_param (gkrouted_only, int,0600 ); +module_param (gkrouted_only, int,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (gkrouted_only,"only accept calls from gatekeeper" );static bool callforward_filter__read_mostly = true; -module_param (callforward_filter, bool,0600 ); +module_param (callforward_filter, bool,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (callforward_filter,"only create call forwarding expectations " "if both endpoints are on different sides " "(determined by routing information)" );
net/netfilter/nf_conntrack_helper.c +2 -1
@@ -37,7 +37,8 @@ EXPORT_SYMBOL_GPL(nf_ct_helper_hsize);static unsigned int nf_ct_helper_count__read_mostly ;static bool nf_ct_auto_assign_helper__read_mostly = true; -module_param_named (nf_conntrack_helper, nf_ct_auto_assign_helper, bool,0644 ); +module_param_named (nf_conntrack_helper, nf_ct_auto_assign_helper, + bool,S_IRUGO |S_IWUSR );MODULE_PARM_DESC (nf_conntrack_helper,"Enable automatic conntrack helper assignment (default 1)" );
net/netfilter/nf_conntrack_irc.c +3 -3
@@ -44,12 +44,12 @@ MODULE_LICENSE("GPL");MODULE_ALIAS ("ip_conntrack_irc" );MODULE_ALIAS_NFCT_HELPER ("irc" ); -module_param_array (ports, ushort, &ports_c,0400 ); +module_param_array (ports, ushort, &ports_c,S_IRUSR );MODULE_PARM_DESC (ports,"port numbers of IRC servers" ); -module_param (max_dcc_channels, uint,0400 ); +module_param (max_dcc_channels, uint,S_IRUSR );MODULE_PARM_DESC (max_dcc_channels,"max number of expected DCC channels per " "IRC session" ); -module_param (dcc_timeout, uint,0400 ); +module_param (dcc_timeout, uint,S_IRUSR );MODULE_PARM_DESC (dcc_timeout,"timeout on for unestablished DCC channels" );static const char *const dccprotos[] = {
net/netfilter/nf_conntrack_sane.c +1 -1
@@ -40,7 +40,7 @@ static DEFINE_SPINLOCK(nf_sane_lock);#define MAX_PORTS 8static u_int16_t ports[MAX_PORTS ];static unsigned int ports_c; -module_param_array (ports, ushort, &ports_c,0400 ); +module_param_array (ports, ushort, &ports_c,S_IRUSR );struct sane_request {__be32 RPC_code;
net/netfilter/nf_conntrack_sip.c +4 -4
@@ -35,20 +35,20 @@ MODULE_ALIAS_NFCT_HELPER("sip");#define MAX_PORTS 8static unsigned short ports[MAX_PORTS ];static unsigned int ports_c; -module_param_array (ports, ushort, &ports_c,0400 ); +module_param_array (ports, ushort, &ports_c,S_IRUSR );MODULE_PARM_DESC (ports,"port numbers of SIP servers" );static unsigned int sip_timeout__read_mostly =SIP_TIMEOUT ; -module_param (sip_timeout, uint,0600 ); +module_param (sip_timeout, uint,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (sip_timeout,"timeout for the master SIP session" );static int sip_direct_signalling__read_mostly =1 ; -module_param (sip_direct_signalling, int,0600 ); +module_param (sip_direct_signalling, int,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (sip_direct_signalling,"expect incoming calls from registrar " "only (default 1)" );static int sip_direct_media__read_mostly =1 ; -module_param (sip_direct_media, int,0600 ); +module_param (sip_direct_media, int,S_IRUSR |S_IWUSR );MODULE_PARM_DESC (sip_direct_media,"Expect Media streams between signalling " "endpoints only (default 1)" );
net/netfilter/nf_conntrack_tftp.c +1 -1
@@ -27,7 +27,7 @@ MODULE_ALIAS_NFCT_HELPER("tftp");#define MAX_PORTS 8static unsigned short ports[MAX_PORTS ];static unsigned int ports_c; -module_param_array (ports, ushort, &ports_c,0400 ); +module_param_array (ports, ushort, &ports_c,S_IRUSR );MODULE_PARM_DESC (ports,"Port numbers of TFTP servers" ); unsigned int (*nf_nat_tftp_hook)(struct sk_buff *skb,
net/netfilter/nf_conntrack_timestamp.c +1 -1
@@ -17,7 +17,7 @@static bool nf_ct_tstamp__read_mostly ; -module_param_named (tstamp, nf_ct_tstamp, bool,0644 ); +module_param_named (tstamp, nf_ct_tstamp, bool,S_IRUGO |S_IWUSR );MODULE_PARM_DESC (tstamp,"Enable connection tracking flow timestamping." );#ifdef CONFIG_SYSCTL
net/netfilter/xt_recent.c +3 -3
@@ -48,9 +48,9 @@ static unsigned int ip_list_hash_size = 0;static unsigned int ip_list_perms =0644 ;static unsigned int ip_list_uid =0 ;static unsigned int ip_list_gid =0 ; -module_param (ip_list_tot, uint,0400 ); -module_param (ip_pkt_list_tot, uint,0400 ); -module_param (ip_list_perms, uint,0400 ); +module_param (ip_list_tot, uint,S_IRUSR ); +module_param (ip_pkt_list_tot, uint,S_IRUSR ); +module_param (ip_list_perms, uint,S_IRUSR );module_param (ip_list_uid, uint,S_IRUGO |S_IWUSR );module_param (ip_list_gid, uint,S_IRUGO |S_IWUSR );MODULE_PARM_DESC (ip_list_tot,"number of IP addresses to remember per list (>0)" );
Signature · 1 line
1.7.7
PATCH 4/4 netfilter: xtables: inclusion of xt_SYSRQ
In reply to Jan EngelhardtThe SYSRQ target will allow to remotely invoke sysrq on the local machine. Authentication is by means of a pre-shared key that can either be transmitted plaintext or digest-secured.
--- net/netfilter/Kconfig | 12 ++ net/netfilter/Makefile | 1 + net/netfilter/xt_SYSRQ.c | 361 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 374 insertions(+), 0 deletions(-) create mode 100644 net/netfilter/xt_SYSRQ.c
net/netfilter/Kconfig +12 -0
@@ -644,6 +644,18 @@ config NETFILTER_XT_TARGET_RATEEST To compile it as a module, choose M here. If unsure, say N. +config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation' + depends on NETFILTER_ADVANCED + ---help--- + This option enables the "SYSRQ" target which can be used to trigger + sysrq from a remote machine using a magic UDP packet with a pre-shared + password. This is useful when the receiving host has locked up in an + Oops yet still can process incoming packets. + + Besides plaintext packets, digest-secured SYSRQ requests will be + supported when CONFIG_CRYPTO is enabled. + config NETFILTER_XT_TARGET_TEE tristate '"TEE" - packet cloning to alternate destination' depends on NETFILTER_ADVANCED
net/netfilter/Makefile +1 -0
@@ -70,6 +70,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o obj-$(CONFIG_NETFILTER_XT_TARGET_RATEEST) += xt_RATEEST.o obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o +obj-$(CONFIG_NETFILTER_XT_TARGET_SYSRQ) += xt_SYSRQ.o obj-$(CONFIG_NETFILTER_XT_TARGET_TPROXY) += xt_TPROXY.o obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o obj-$(CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP) += xt_TCPOPTSTRIP.o
net/netfilter/xt_SYSRQ.c new file +361 -0
361 lines not on this page · raw message
Signature · 6 lines
1.7.7 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso
maintainerRe: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 21 lines · Jan Engelhardt
The SYSRQ target will allow to remotely invoke sysrq on the local machine. Authentication is by means of a pre-shared key that can either be transmitted plaintext or digest-secured.
Signed-off-by Jan Engelhardt <[email protected]>--- net/netfilter/Kconfig | 12 ++ net/netfilter/Makefile | 1 + net/netfilter/xt_SYSRQ.c | 361 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 374 insertions(+), 0 deletions(-) create mode 100644 net/netfilter/xt_SYSRQ.cnet/netfilter/Kconfig +1
-0@@ -644,6 +644,18 @@ config NETFILTER_XT_TARGET_RATEEST To compile it as a module, choose M here. If unsure, say N. +config NETFILTER_XT_TARGET_SYSRQ
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 657
Quoted 10 lines
net/netfilter/Kconfig +10
-0+ tristate '"SYSRQ" - remote sysrq invocation' + depends on NETFILTER_ADVANCED + ---help--- + This option enables the "SYSRQ" target which can be used to trigger + sysrq from a remote machine using a magic UDP packet with a pre-shared + password. This is useful when the receiving host has locked up in an + Oops yet still can process incoming packets. + + Besides plaintext packets, digest-secured SYSRQ requests will be + supported when CONFIG_CRYPTO is enabled.
I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
People willing to use this should be able to use without requiring Netfilter at all.
If you have interest in pushing this into mainline, I think this deserves to be generalized and included somewhere into the networking tree and provide some genetlink interface to configure it.
Re: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 9 lines · Pablo Neira Ayuso
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 648
Quoted 2 lines
net/netfilter/Kconfig +2
-0+config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation'I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6
Florian Westphal
maintainerRe: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 8 lines · Jan Engelhardt
Quoted 7 lines · Pablo Neira Ayuso
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 648
Quoted 2 lines
net/netfilter/Kconfig +2
-0+config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation'I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Quoted 6 lines
Quoted 2 lines
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6
We now have udp encap support also for ipv6, so this could now be solved outside of netfilter without impacting the ability to filter sysreq packets.
Re: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 12 lines · Florian Westphal
Quoted 11 lines · Jan Engelhardt
Quoted 9 lines · Pablo Neira Ayuso
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 648
Quoted 2 lines
net/netfilter/Kconfig +2
-0+config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation'I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
Quoted 7 lines
Quoted 3 lines
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6We now have udp encap support also for ipv6, so this could now be solved outside of netfilter without impacting the ability to filter sysreq packets.
How does xt_SYSRQ inhibit filtering sysrq packets?
Florian Westphal
maintainerRe: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 10 lines · Jan Engelhardt
Quoted 8 lines
Quoted 3 lines · Jan Engelhardt
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6We now have udp encap support also for ipv6, so this could now be solved outside of netfilter without impacting the ability to filter sysreq packets.
How does
xt_SYSRQinhibit filtering sysrq packets?
Not at all. But the last 'do it outside of netfilter' approaches suffered from that. With encap sockets this should no longer be a problem.
Re: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 10 lines · Florian Westphal
Quoted 9 lines · Jan Engelhardt
Quoted 8 lines
Quoted 3 lines · Jan Engelhardt
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6We now have udp encap support also for ipv6, so this could now be solved outside of netfilter without impacting the ability to filter sysreq packets.
Quoted 5 lines
Quoted 1 line
How does
xt_SYSRQinhibit filtering sysrq packets?Not at all. But the last 'do it outside of netfilter' approaches suffered from that. With encap sockets this should no longer be a problem.
People like using Xtables because it's simple and they know how to use it (or at least, the frontend). The biggest strength is that users can _combine it with existing extensions_. All that seems impossible with the sysrq-ping patch.
(You know how they hate it when they have to cross a "boundary" like iptables-nfmark-tc and iptables-nfmark-iproute).
Pablo Neira Ayuso
maintainerRe: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
In reply to Jan EngelhardtQuoted 9 lines · Jan Engelhardt
Quoted 7 lines · Pablo Neira Ayuso
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 648
Quoted 2 lines
net/netfilter/Kconfig +2
-0+config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation'I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Quoted 6 lines
Quoted 2 lines
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6
I think that affirmation is true in the context of:
[PATCH]: Add Network Sysrq Support
but not sure it's out of it.
He probably prefered the Netfilter option because, comparing it to the Netfilter approach, it looks nicer. Well, just look at all those sysfs and proc interfaces he was proposing for that approach (it seems quite ugly to me).
You can use the udp_encap hook (that Florian mentioned) plus some genetlink interface and little user-space tool to make it out of netfilter. Most of the xt_SYSRQ code can be reused and the genetlink interface plus one library can be added with little extra work.
@David: just to put you into context. Jan is proposing to merge xt_SYSRQ into mainstream, we are discussing if it would be better to make it out of it (so people do not depend on the firewalling utilities to get it working) based on a different proposal described above.
Re: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 33 lines · Pablo Neira Ayuso
Quoted 9 lines · Jan Engelhardt
Quoted 7 lines · Pablo Neira Ayuso
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 648
Quoted 2 lines
net/netfilter/Kconfig +2
-0+config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation'I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Quoted 6 lines
Quoted 2 lines
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6I think that affirmation is true in the context of:
[PATCH]: Add Network Sysrq Support
but not sure it's out of it.
He probably prefered the Netfilter option because, comparing it to the Netfilter approach, it looks nicer. Well, just look at all those sysfs and proc interfaces he was proposing for that approach (it seems quite ugly to me).
You can use the
udp_encaphook (that Florian mentioned) plus some genetlink interface and little user-space tool to make it out of netfilter. Most of thext_SYSRQcode can be reused and the genetlink interface plus one library can be added with little extra work.
Quoted 9 lines
@David: just to put you into context. Jan is proposing to merge
xt_SYSRQinto mainstream, we are discussing if it would be better to make it out of it (so people do not depend on the firewalling utilities to get it working) based on a different proposal described above.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
For this to be truly useful, it has to work when all of userspace is dead and unresponsive (oom hell, swap hell, hdd disconnected, etc), and as such from the moment the magic packet gets received, to the command (reboot/etc) being executed it has to be a fully kernel based solution - preferably within the network softirq.
Anything relying on userspace (outside of initial configuration) is not acceptable.
Pablo Neira Ayuso
maintainerRe: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 44 lines · Maciej Żenczykowski
Quoted 33 lines · Pablo Neira Ayuso
Quoted 9 lines · Jan Engelhardt
Quoted 7 lines · Pablo Neira Ayuso
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 648
Quoted 2 lines
net/netfilter/Kconfig +2
-0+config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation'I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Quoted 6 lines
Quoted 2 lines
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6I think that affirmation is true in the context of:
[PATCH]: Add Network Sysrq Support
but not sure it's out of it.
He probably prefered the Netfilter option because, comparing it to the Netfilter approach, it looks nicer. Well, just look at all those sysfs and proc interfaces he was proposing for that approach (it seems quite ugly to me).
You can use the
udp_encaphook (that Florian mentioned) plus some genetlink interface and little user-space tool to make it out of netfilter. Most of thext_SYSRQcode can be reused and the genetlink interface plus one library can be added with little extra work.Quoted 9 lines
@David: just to put you into context. Jan is proposing to merge
xt_SYSRQinto mainstream, we are discussing if it would be better to make it out of it (so people do not depend on the firewalling utilities to get it working) based on a different proposal described above.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines
For this to be truly useful, it has to work when all of userspace is dead and unresponsive (oom hell, swap hell, hdd disconnected, etc), and as such from the moment the magic packet gets received, to the command (reboot/etc) being executed it has to be a fully kernel based solution - preferably within the network softirq.
Anything relying on userspace (outside of initial configuration) is not acceptable.
So far, nobody mentioned the possibility any sort of user-space daemon ;-).
That user-space tool would be used to configure it through genetlink outside of netfilter. That's all.
And I think everybody here still think this is useful, what we're discussing is the nicer approach.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 60 lines · Pablo Neira Ayuso
Quoted 44 lines · Maciej Żenczykowski
Quoted 33 lines · Pablo Neira Ayuso
Quoted 9 lines · Jan Engelhardt
Quoted 7 lines · Pablo Neira Ayuso
net/netfilter/Kconfig config NETFILTER_XT_TARGET_RATEEST · line 648
Quoted 2 lines
net/netfilter/Kconfig +2
-0+config NETFILTER_XT_TARGET_SYSRQ + tristate '"SYSRQ" - remote sysrq invocation'I guess this is useful for user, eg. you can reboot your crashed system from your office in case that cheap comodity hardware without remote management tools (eg. HP's ILO or Dell's iDRAC).
Quoted 6 lines
Quoted 2 lines
Still, I think that including this in Netfilter is a bit of abuse since this is out of the scope of providing some firewalling feature.
David Miller has stated his opinion already last year, and he's for the Netfilter variant:
http://markmail.org/message/d7kpczdbtpcxwli6I think that affirmation is true in the context of:
[PATCH]: Add Network Sysrq Support
but not sure it's out of it.
He probably prefered the Netfilter option because, comparing it to the Netfilter approach, it looks nicer. Well, just look at all those sysfs and proc interfaces he was proposing for that approach (it seems quite ugly to me).
You can use the
udp_encaphook (that Florian mentioned) plus some genetlink interface and little user-space tool to make it out of netfilter. Most of thext_SYSRQcode can be reused and the genetlink interface plus one library can be added with little extra work.Quoted 9 lines
@David: just to put you into context. Jan is proposing to merge
xt_SYSRQinto mainstream, we are discussing if it would be better to make it out of it (so people do not depend on the firewalling utilities to get it working) based on a different proposal described above.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 8 lines
For this to be truly useful, it has to work when all of userspace is dead and unresponsive (oom hell, swap hell, hdd disconnected, etc), and as such from the moment the magic packet gets received, to the command (reboot/etc) being executed it has to be a fully kernel based solution - preferably within the network softirq.
Anything relying on userspace (outside of initial configuration) is not acceptable.
So far, nobody mentioned the possibility any sort of user-space daemon ;-).
That user-space tool would be used to configure it through genetlink outside of netfilter. That's all.
Quoted 6 lines
And I think everybody here still think this is useful, what we're discussing is the nicer approach.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Jan,
I don't know if it goes to main line kernel eventually, i want this feature right now. Right now i have to physically go the office rack to reboot in a case of kernel crash. Office IT people don't provide IPKVM stuffs in development servers, they only give it to "production" severs.
I really think its nice touch. Is it available in xtable-addons, or i just apply your patch directly?
Cheers.
Signature · 5 lines
-aft -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/4] netfilter: xtables: inclusion of xt_SYSRQ
Quoted 8 lines · Aft nix
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
@David: just to put you into context. Jan is proposing to merge
xt_SYSRQinto mainstream, we are discussing if it would be better to make it out of it (so people do not depend on the firewalling utilities to get it working) based on a different proposal described above.Hi Jan,
Quoted 7 lines
I don't know if it goes to main line kernel eventually, i want this feature right now. Right now i have to physically go the office rack to reboot in a case of kernel crash. Office IT people don't provide IPKVM stuffs in development servers, they only give it to "production" severs.
I really think its nice touch. Is it available in xtable-addons, or i just apply your patch directly?
It is in Xt-a, and I try to upstream it.
Again, I emphasize that xt_SYSRQ can be combined with other matches of Xtables, and that why it should be merged rather than a separate subsystem of some kind.