]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:42:04 +0000 (15:42 +0900)
commit029464a380858e54ab750a5a536a0bdcd7180b1f
treeb4bc74827cc28f7d7d069f167ab7bf9fbb58470f
parenta317579bb62ec6c1cb6bd7e5d0d8a25a746832f2
ppp: ensure file->private_data can't be overridden

[ Upstream commit e8e56ffd9d2973398b60ece1f1bebb8d67b4d032 ]

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: f3ff8a4d80e8 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ppp/ppp_generic.c