提交 1ebcb25a 编写于 作者: K Kuniyuki Iwashima 提交者: David S. Miller

icmp: Fix a data-race around sysctl_icmp_ratemask.

While reading sysctl_icmp_ratemask, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its reader.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: NKuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2a4eb714
...@@ -282,7 +282,7 @@ static bool icmpv4_mask_allow(struct net *net, int type, int code) ...@@ -282,7 +282,7 @@ static bool icmpv4_mask_allow(struct net *net, int type, int code)
return true; return true;
/* Limit if icmp type is enabled in ratemask. */ /* Limit if icmp type is enabled in ratemask. */
if (!((1 << type) & net->ipv4.sysctl_icmp_ratemask)) if (!((1 << type) & READ_ONCE(net->ipv4.sysctl_icmp_ratemask)))
return true; return true;
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册