aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-10-08 23:44:00 -0400
committerBen Hutchings <ben@decadent.org.uk>2014-12-14 16:23:47 +0000
commita59a6d8aad7120f8cf6b2393d2a1463de0c1ba6c (patch)
tree96c49ab02a3a10113c8854b0fa6afb0b952b3e6c /block
parent4a49ed835aad6e51d4ab3f3b42a819040768484b (diff)
downloadkernel_samsung_smdk4412-a59a6d8aad7120f8cf6b2393d2a1463de0c1ba6c.zip
kernel_samsung_smdk4412-a59a6d8aad7120f8cf6b2393d2a1463de0c1ba6c.tar.gz
kernel_samsung_smdk4412-a59a6d8aad7120f8cf6b2393d2a1463de0c1ba6c.tar.bz2
fix misuses of f_count() in ppp and netlink
commit 24dff96a37a2ca319e75a74d3929b2de22447ca6 upstream. we used to check for "nobody else could start doing anything with that opened file" by checking that refcount was 2 or less - one for descriptor table and one we'd acquired in fget() on the way to wherever we are. That was race-prone (somebody else might have had a reference to descriptor table and do fget() just as we'd been checking) and it had become flat-out incorrect back when we switched to fget_light() on those codepaths - unlike fget(), it doesn't grab an extra reference unless the descriptor table is shared. The same change allowed a race-free check, though - we are safe exactly when refcount is less than 2. It was a long time ago; pre-2.6.12 for ioctl() (the codepath leading to ppp one) and 2.6.17 for sendmsg() (netlink one). OTOH, netlink hadn't grown that check until 3.9 and ppp used to live in drivers/net, not drivers/net/ppp until 3.1. The bug existed well before that, though, and the same fix used to apply in old location of file. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> [bwh: Backported to 3.2: drop changes to netlink_mmap_sendmsg()] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions