From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, robert@ocallahan.org,
viro@zeniv.linux.org.uk, johannes.berg@intel.com
Subject: Re: [PATCH v2] socket: fix struct ifreq size in compat ioctl
Date: Thu, 13 Sep 2018 16:01:55 -0700 (PDT) [thread overview]
Message-ID: <20180913.160155.409568197887579582.davem@davemloft.net> (raw)
In-Reply-To: <20180913124055.14082-1-johannes@sipsolutions.net>
From: Johannes Berg <johannes@sipsolutions.net>
Date: Thu, 13 Sep 2018 14:40:55 +0200
> From: Johannes Berg <johannes.berg@intel.com>
>
> As reported by Reobert O'Callahan, since Viro's commit to kill
> dev_ifsioc() we attempt to copy too much data in compat mode,
> which may lead to EFAULT when the 32-bit version of struct ifreq
> sits at/near the end of a page boundary, and the next page isn't
> mapped.
>
> Fix this by passing the approprate compat/non-compat size to copy
> and using that, as before the dev_ifsioc() removal. This works
> because only the embedded "struct ifmap" has different size, and
> this is only used in SIOCGIFMAP/SIOCSIFMAP which has a different
> handler. All other parts of the union are naturally compatible.
>
> This fixes https://bugzilla.kernel.org/show_bug.cgi?id=199469.
>
> Fixes: bf4405737f9f ("kill dev_ifsioc()")
> Reported-by: Robert O'Callahan <robert@ocallahan.org>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Applied and queued up for -stable, thanks Johannes.
prev parent reply other threads:[~2018-09-14 4:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 12:40 [PATCH v2] socket: fix struct ifreq size in compat ioctl Johannes Berg
2018-09-13 23:01 ` David Miller [this message]
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=20180913.160155.409568197887579582.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
--cc=robert@ocallahan.org \
--cc=viro@zeniv.linux.org.uk \
/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).