]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netlink: Always copy on mmap TX.
authorDavid Miller <davem@davemloft.net>
Tue, 16 Dec 2014 22:58:17 +0000 (17:58 -0500)
committerJiri Slaby <jslaby@suse.cz>
Mon, 26 Jan 2015 13:39:13 +0000 (14:39 +0100)
commit837f719b175ab57b3cd39d3a36ce7d7d38687be0
tree1ac8510e8bf877974e701f945425a68b0544190c
parent3e89bd360a7c6be943ee771481edc6dfef22f68d
netlink: Always copy on mmap TX.

[ Upstream commit 4682a0358639b29cf69437ed909c6221f8c89847 ]

Checking the file f_count and the nlk->mapped count is not completely
sufficient to prevent the mmap'd area contents from changing from
under us during netlink mmap sendmsg() operations.

Be careful to sample the header's length field only once, because this
could change from under us as well.

Fixes: 5fd96123ee19 ("netlink: implement memory mapped sendmsg()")
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/netlink/af_netlink.c