[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180913121353.GR19965@ZenIV.linux.org.uk>
Date: Thu, 13 Sep 2018 13:13:53 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Johannes Berg <johannes@...solutions.net>
Cc: netdev@...r.kernel.org, Robert O'Callahan <robert@...llahan.org>,
Johannes Berg <johannes.berg@...el.com>
Subject: Re: [PATCH] socket: fix struct ifreq size in compat ioctl
On Thu, Sep 13, 2018 at 01:49:09PM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@...el.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 whether or not we're doing a compat call and
> copying the appropriate size in/out, as we did before. 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.
Might be better to pass explicit size instead of this bool compat...
Powered by blists - more mailing lists