]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Mar 2017 04:55:57 +0000 (20:55 -0800)
commitde5ea470dca9a541ee570859287dfdd8c9a6f87a
treeebcc0624dcccf6c25949f3e52c26a75f542bb7b8
parent1dc08a78cec7365eb4eb1874908298e8694a9908
net: net_enable_timestamp() can be called from irq contexts

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 12f0db019b18 ("net: use
a work queue to defer net_disable_timestamp() work")

Fixes: ed790c32e842 ("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>
net/core/dev.c