]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
net: net_enable_timestamp() can be called from irq contexts
authorEric Dumazet <edumazet@google.com>
Wed, 1 Mar 2017 22:28:39 +0000 (14:28 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 22 Mar 2017 14:02:34 +0000 (08:02 -0600)
commit7a2f791742d62c00836b65870cc325307360b4b0
treeb3c49d0a4b0fc321fcd67b10680414ff5674aa65
parentc87838f67be4d52d1962f1fc2ee225ac5c5e1faa
net: net_enable_timestamp() can be called from irq contexts

BugLink: http://bugs.launchpad.net/bugs/1675032
[ Upstream commit 13baa00ad01bb3a9f893e3a08cbc2d072fc0c15d ]

It is now very clear that silly TCP listeners might play with
enabling/disabling timestamping while new children are added
to their accept queue.

Meaning net_enable_timestamp() can be called from BH context
while current state of the static key is not enabled.

Lets play safe and allow all contexts.

The work queue is scheduled only under the problematic cases,
which are the static key enable/disable transition, to not slow down
critical paths.

This extends and improves what we did in commit 5fa8bbda38c6 ("net: use
a work queue to defer net_disable_timestamp() work")

Fixes: b90e5794c5bd ("net: dont call jump_label_dec from irq context")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/core/dev.c