]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: Always copy on mmap TX.
authorDavid Miller <davem@davemloft.net>
Tue, 16 Dec 2014 22:58:17 +0000 (17:58 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Dec 2014 17:35:23 +0000 (12:35 -0500)
commite68ddac0e928ec188d8c4aa8b238188b6d290715
tree85469362ce075e5d59ebd3559f5e590749432e24
parent79f5e6e697deea1b9a7527c6f6303ce4a90bd2d5
netlink: Always copy on mmap TX.

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: 2aaaceca61a8 ("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>
net/netlink/af_netlink.c