]> git.baikalelectronics.ru Git - kernel.git/commit
ppp: ensure file->private_data can't be overridden
authorGuillaume Nault <g.nault@alphalink.fr>
Mon, 14 Mar 2016 20:17:16 +0000 (21:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Mar 2016 23:35:06 +0000 (19:35 -0400)
commitc1c274f937c2127cd018ec1e76d6fdae6639394a
tree06154afcd07d48f65e66a388f0f8634efdd6cfbf
parent34fdaea1c90228ed28676facc8f31a81bb3cc559
ppp: ensure file->private_data can't be overridden

Locking ppp_mutex must be done before dereferencing file->private_data,
otherwise it could be modified before ppp_unattached_ioctl() takes the
lock. This could lead ppp_unattached_ioctl() to override ->private_data,
thus leaking reference to the ppp_file previously pointed to.

v2: lock all ppp_ioctl() instead of just checking private_data in
    ppp_unattached_ioctl(), to avoid ambiguous behaviour.

Fixes: 16d8ab64f066 ("ppp: push BKL down into the driver")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp/ppp_generic.c