[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jLAK8SYDcrCbJhb4jRtLVW9xjaNi-k68-QV-8_FqZrdqA@mail.gmail.com>
Date: Thu, 10 Dec 2015 13:45:09 -0800
From: Kees Cook <keescook@...omium.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Willy Tarreau <w@....eu>,
Andrew Morton <akpm@...ux-foundation.org>,
Jan Kara <jack@...e.cz>, yalin wang <yalin.wang2010@...il.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5] fs: clear file privilege bits when mmap writing
On Thu, Dec 10, 2015 at 12:27 PM, Al Viro <viro@...iv.linux.org.uk> wrote:
> On Thu, Dec 10, 2015 at 11:47:18AM -0800, Kees Cook wrote:
>
>> In open, sure, but what about under mm/memory.c where we're trying to
>> twiddle it from vma->file->f_flags as in my patch? That seemed like it
>> would want atomic safety.
>
> Sigh... Again, I'm not at all convinced that this is the right approach,
I'm open to any suggestions. Every path I've tried has been ultimately
blocked by mmap_sem. :(
> but generally you need ->f_lock. And in situations where the bit can
> go only off->on, check it lockless, skip the whole thing entirely if it's
> already set and grab the spinlock otherwise.
And I can take f_lock safely under mmap_sem?
-Kees
--
Kees Cook
Chrome OS & Brillo Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists