[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200420170131.GD1080594@mit.edu>
Date: Mon, 20 Apr 2020 13:01:31 -0400
From: "Theodore Y. Ts'o" <tytso@....edu>
To: Peter Maydell <peter.maydell@...aro.org>
Cc: Eric Blake <eblake@...hat.com>,
Linus Walleij <linus.walleij@...aro.org>,
Linux API <linux-api@...r.kernel.org>,
QEMU Developers <qemu-devel@...gnu.org>,
Florian Weimer <fw@...eb.enyo.de>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Andy Lutomirski <luto@...nel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] fcntl: Add 32bit filesystem mode
On Mon, Apr 20, 2020 at 04:29:32PM +0100, Peter Maydell wrote:
> On Mon, 20 Apr 2020 at 16:24, Eric Blake <eblake@...hat.com> wrote:
> > It will be interesting to find how much code (wrongly) assumes it can
> > use a blind assignment of fcntl(fd, F_SETFD, 1) and thereby accidentally
> > wipes out other existing flags, when it should have instead been doing a
> > read-modify-write to protect flags other than FD_CLOEXEC.
>
> For instance, a quick grep shows 4 instances of this in QEMU :-)
Fortunately, most applications aren't going to be interested in
forcing 32-bit mode for 64-bit applications, QEMU being the notable
exception. We do need to make sure that for 32-bit applications, we
either make FD_32BIT_MODE a no-op (don't set the bit, and ignore the
bit). We could allow the bit to be visible for 32-bit applications,
but we would want to disallow clearing the the bit for 32-bit
applications if it was visible.
If we did that, then blind assignments of fcntl(fd, F_SETFD, 1) should
be mostly harmless with respect to the FD_32BIT_MODE bit.
- Ted
Powered by blists - more mailing lists