From: David Miller <davem@davemloft.net>
To: g.nault@alphalink.fr
Cc: netdev@vger.kernel.org, paulus@samba.org, alan@linux.intel.com,
arnd@arndb.de
Subject: Re: [PATCH net] ppp: ensure file->private_data can't be overridden
Date: Fri, 11 Mar 2016 14:42:16 -0500 (EST) [thread overview]
Message-ID: <20160311.144216.676727973447663610.davem@davemloft.net> (raw)
In-Reply-To: <3f04de903b6be9e1c30427830c0a1568478e0c6c.1457462784.git.g.nault@alphalink.fr>
From: Guillaume Nault <g.nault@alphalink.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@alphalink.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.
next prev parent reply other threads:[~2016-03-11 19:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-08 19:14 [PATCH net] ppp: ensure file->private_data can't be overridden Guillaume Nault
2016-03-11 19:42 ` David Miller [this message]
2016-03-14 17:59 ` Guillaume Nault
2016-03-14 18:57 ` David Miller
2016-03-14 19:09 ` Guillaume Nault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160311.144216.676727973447663610.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alan@linux.intel.com \
--cc=arnd@arndb.de \
--cc=g.nault@alphalink.fr \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).