]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: rx mmap: fix POLLIN condition
authorKen-ichirou MATSUZAWA <chamaken@gmail.com>
Sun, 30 Aug 2015 22:54:49 +0000 (07:54 +0900)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2015 04:55:51 +0000 (21:55 -0700)
commit05e6c3c49c43c4efbf0b8f377af5d6267df6e374
tree14962df2ccafdd0b86155d18b40cddd17d9e70a8
parente2210fc9cac3647e9688f0966c64550e23cd1579
netlink: rx mmap: fix POLLIN condition

Poll() returns immediately after setting the kernel current frame
(ring->head) to SKIP from user space even though there is no new
frame. And in a case of all frames is VALID, user space program
unintensionally sets (only) kernel current frame to UNUSED, then
calls poll(), it will not return immediately even though there are
VALID frames.

To avoid situations like above, I think we need to scan all frames
to find VALID frames at poll() like netlink_alloc_skb(),
netlink_forward_ring() finding an UNUSED frame at skb allocation.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c