[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160311.144216.676727973447663610.davem@davemloft.net>
Date: Fri, 11 Mar 2016 14:42:16 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: g.nault@...halink.fr
Cc: netdev@...r.kernel.org, paulus@...ba.org, alan@...ux.intel.com,
arnd@...db.de
Subject: Re: [PATCH net] ppp: ensure file->private_data can't be overridden
From: Guillaume Nault <g.nault@...halink.fr>
Date: Tue, 8 Mar 2016 20:14:30 +0100
> Lock ppp_mutex and check that file->private_data is NULL before
> executing any action in ppp_unattached_ioctl().
> The test done by ppp_ioctl() can't be relied upon, because
> file->private_data may have been updated meanwhile. In which case
> ppp_unattached_ioctl() will override file->private_data and mess up
> reference counters or loose pointer to previously allocated PPP unit.
>
> In case the test fails, -ENOTTY is returned, just like if ppp_ioctl()
> had rejected the ioctl in the first place.
>
> Signed-off-by: Guillaume Nault <g.nault@...halink.fr>
If this thing can disappear on us, then we need to make the entirety
of ppp_ioctl() run with the mutex held to fix this properly.
Otherwise ->private_data could go NULL on us meanwhile as well.
We should hold the mutex, to stabilize the value of ->private_data.
Powered by blists - more mailing lists