aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sysctl_net_core.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2015-01-30 13:29:32 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-02 18:46:51 -0800
commitb245be1f4db1a0394e4b6eb66059814b46670ac3 (patch)
treee9e4e746bcb24db72ae5a947c7001bab21211a8e /net/core/sysctl_net_core.c
parentnet-timestamp: no-payload option (diff)
downloadlinux-dev-b245be1f4db1a0394e4b6eb66059814b46670ac3.tar.xz
linux-dev-b245be1f4db1a0394e4b6eb66059814b46670ac3.zip
net-timestamp: no-payload only sysctl
Tx timestamps are looped onto the error queue on top of an skb. This mechanism leaks packet headers to processes unless the no-payload options SOF_TIMESTAMPING_OPT_TSONLY is set. Add a sysctl that optionally drops looped timestamp with data. This only affects processes without CAP_NET_RAW. The policy is checked when timestamps are generated in the stack. It is possible for timestamps with data to be reported after the sysctl is set, if these were queued internally earlier. No vulnerability is immediately known that exploits knowledge gleaned from packet headers, but it may still be preferable to allow administrators to lock down this path at the cost of possible breakage of legacy applications. Signed-off-by: Willem de Bruijn <willemb@google.com> ---- Changes (v1 -> v2) - test socket CAP_NET_RAW instead of capable(CAP_NET_RAW) (rfc -> v1) - document the sysctl in Documentation/sysctl/net.txt - fix access control race: read .._OPT_TSONLY only once, use same value for permission check and skb generation. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sysctl_net_core.c')
-rw-r--r--net/core/sysctl_net_core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 31baba2a71ce..fde21d19e61b 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -321,6 +321,15 @@ static struct ctl_table net_core_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
+ {
+ .procname = "tstamp_allow_data",
+ .data = &sysctl_tstamp_allow_data,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &zero,
+ .extra2 = &one
+ },
#ifdef CONFIG_RPS
{
.procname = "rps_sock_flow_entries",