]> git.ipfire.org Git - people/arne_f/kernel.git/commit
sctp: update the netstamp_needed counter when copying sockets
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Fri, 4 Dec 2015 17:14:04 +0000 (15:14 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jan 2016 04:34:53 +0000 (20:34 -0800)
commit548041a38c62684077b4dc85adec814faac193e7
tree5ce80624e0061c95b1a49ec05cb7d3235d63ae99
parentf580d5c5de89593d6d3785340979df61c972769d
sctp: update the netstamp_needed counter when copying sockets

[ Upstream commit 01ce63c90170283a9855d1db4fe81934dddce648 ]

Dmitry Vyukov reported that SCTP was triggering a WARN on socket destroy
related to disabling sock timestamp.

When SCTP accepts an association or peel one off, it copies sock flags
but forgot to call net_enable_timestamp() if a packet timestamping flag
was copied, leading to extra calls to net_disable_timestamp() whenever
such clones were closed.

The fix is to call net_enable_timestamp() whenever we copy a sock with
that flag on, like tcp does.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/sock.h
net/core/sock.c
net/sctp/socket.c