From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-f179.google.com ([209.85.167.179]:39057 "EHLO mail-oi1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbeI0Vy0 (ORCPT ); Thu, 27 Sep 2018 17:54:26 -0400 Received: by mail-oi1-f179.google.com with SMTP id y81-v6so2537235oia.6 for ; Thu, 27 Sep 2018 08:35:37 -0700 (PDT) MIME-Version: 1.0 References: <20180919070737.GB17524@uranus.lan> <20180919071056.GC17524@uranus.lan> <20180919161301.GF17524@uranus.lan> In-Reply-To: <20180919161301.GF17524@uranus.lan> From: Jann Horn Date: Thu, 27 Sep 2018 17:35:10 +0200 Message-ID: Subject: Re: [linux-next] BUG triggered in ptraceme To: Cyrill Gorcunov Cc: Al Viro , linux-fsdevel@vger.kernel.org, Michal Hocko , Oleg Nesterov , avagin@virtuozzo.com, kernel list Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Sep 19, 2018 at 6:13 PM Cyrill Gorcunov wrote: > > On Wed, Sep 19, 2018 at 04:16:50PM +0200, Jann Horn wrote: > ... > > > > > > Heh, actually not :) It is due to commit > > > > > > commit 1f8266ff58840d698a1e96d2274189de1bdf7969 > > > Author: Jann Horn > > > Date: Thu Sep 13 18:12:09 2018 +0200 > > > > > > which introduced might_sleep. Seems it is bad idea to send bug report > > > without having a cup of coffee at the morning :) > > > > Yeah, I fixed one sleep-in-atomic bug and figured I'd throw a > > might_sleep() in there for good measure... sigh. > > I guess now I have to go through all the callers of > > begin_current_label_crit_section() to see what else looks wrong... > > > > Yes, I fear so. Need to check every caller just to be sure. > > > apparmor_ptrace_traceme() is wrong, as reported... > > > > apparmor_path_link() looks icky, but I'm not sure - from what I can > > tell, it's called with an i_rwsem held for writing, and that probably > > makes calling back into filesystem context from there a bad idea? > > OTOH, it's just the i_rwsem of a newly-created path, so I don't know > > whether that's actually an issue... > > > > security_path_rename() is called with two i_rwsem's held, but again, > > I'm not sure whether that's a problem. > > Lets wait for fs people opinions. No reply yet - I guess I should just fix up the traceme case for now.