Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp919182pxb; Wed, 29 Sep 2021 12:30:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU3ACi8Zgvorts++8wl+dVh3WOf64uVq7UTrFJGI/9dP5WorSFtnvDuT0jJXGsTQntJw5t X-Received: by 2002:a17:906:608e:: with SMTP id t14mr1780086ejj.441.1632943831909; Wed, 29 Sep 2021 12:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632943831; cv=none; d=google.com; s=arc-20160816; b=p/cdw1T+NsAlQEZqiJs/Zjn/flC8yxvYRQIv+4vIEjIXUE8jxAtgLd88q7w8EX5Tvo 2ctlx775r8KIIXj1v9PJwEibJWFo4mObTD1FB+dV3MH+2wopXMxBOqQ6CBthiPzpzUG/ KPqdYk1eYr4ggrtt7FXx6+0GfKCvYRnn1xpdpL3dZ8Onr3wsL7lkvb116ZsMePPsNQhN 2DPa2kc6beoVbzA6kGRRX9IusvCLoZzUyIB7gOm3c+JKPQQRpRDvqOC0H0OHeUouGa6Y /mRK7ikVtgNNhq1A2vOR29G2loUK2GxIBLHd6EbJME/YxPyFF4EtzCmzulMl5uO7w04d uNjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DTcwGKpAYZD9n6u6W5b6wUXS7p32bxhdEAo1HOAR6E0=; b=l9Rtupzt9lijdrc3erWuXankGsY/Cv5ot14aps2zV7xgRVXBTjD0svOF8v2sijT3LQ QT+3WSW+ScLthqYKQM1xbPvDYQens3p3G2krDL3Px2yeihbzDEjilnpu2mT5FNcthlVC TNM5b9aj+g3nPLeLrZ+xWf6vDvKwnakLp7ZnpiPwSiWz+4/SY0dM/VVUXcmmQ+j0o78g gEMtifO3QLxcd8FUrrRh4ZEhyV+47v386ppliym510s2WV3RpW2vvoE4g9ZKsq8GuwB9 1nhxo2R1JjIaz3pVv1UW4OMwiKibFzkNhsZnpccr7UelNFRys+kb5+8mhdO63/R9TR5U 0SCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="raZU/HDY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hz24si1005088ejc.119.2021.09.29.12.30.08; Wed, 29 Sep 2021 12:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="raZU/HDY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344408AbhI2Rh5 (ORCPT + 99 others); Wed, 29 Sep 2021 13:37:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244721AbhI2Rh4 (ORCPT ); Wed, 29 Sep 2021 13:37:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3BE7C61425; Wed, 29 Sep 2021 17:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632936975; bh=j1CsznRTMXpjsShtriwNxPC6pmRqXDzujQrZsSfAeM8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=raZU/HDY5k5IUjQfPl0oibiW+mRVehapURJDZjKDx73YawoM+fgRBSrK1uAYWxJ0i IAHX2BVJNrOeGd/X91LQcf/E0c2CrL5URKptUUZivm/TLAA4xCR7lTCVSsPUfzL57D RsVF89GQfHzg5rB7/XQPF7jrxKIs690Jj5mMhERivRxVhYuLEl3qQhqelHLtZAYkdW Rtuecv3oR1Y53pRMEmTpf+8XvQxVgbngc23NtWv06Fw/B7XppGiyo7reG4wE75BC46 siMxvMJFdUl9fefBXwEK9THRNemZiGHGMEyrv6EuJ0a1xRH9z/YBVR5Si4wC0IHvDe oyRbpTmbIMc1A== Date: Wed, 29 Sep 2021 19:36:11 +0200 From: Alexey Gladkov To: Jordan Glover Cc: ebiederm@xmission.com, LKML , "linux-mm\\@kvack.org" , "containers\\@lists.linux-foundation.org" , Yu Zhao Subject: Re: linux 5.14.3: free_user_ns causes NULL pointer dereference Message-ID: <20210929173611.fo5traia77o63gpw@example.org> References: <1M9_d6wrcu6rdPe1ON0_k0lOxJMyyot3KAb1gdyuwzDPC777XVUWPHoTCEVmcK3fYfgu7sIo3PSaLe9KulUdm4TWVuqlbKyYGxRAjsf_Cpk=@protonmail.ch> <87ee9pa6xw.fsf@disp2133> <878rzw77i3.fsf@disp2133> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 01:40:48PM +0000, Jordan Glover wrote: > On Thursday, September 16th, 2021 at 5:30 PM, wrote: > > > Jordan Glover Golden_Miller83@protonmail.ch writes: > > > > > On Wednesday, September 15th, 2021 at 10:42 PM, Jordan Glover Golden_Miller83@protonmail.ch wrote: > > > > > > > I had about 2 containerized (flatpak/bubblewrap) apps (browser + music player) running . I quickly closed them with intent to shutdown the system but instead get the freeze and had to use magic sysrq to reboot. System logs end with what I posted and before there is nothing suspicious. > > > > > > > > Maybe it's some random fluke. I'll reply if I hit it again. > > > > > > Heh, it jut happened again. This time closing firefox alone had such > > > effect: > > > > Ok. It looks like he have a couple of folks seeing issues here. > > I thought we had all of the issues sorted out for the release of v5.14, > > but it looks like there is still some little bug left. > > > > If Alex doesn't beat me to it I will see if I can come up with a > > debugging patch to make it easy to help track down where the reference > > count is going wrong. It will be a little bit as my brain is mush at > > the moment. > > > > Eric > > As the issue persist in 5.14.7 I would be very interested in such patch. > > For now the thing is mostly reproducible when I close several tabs in ff then > close the browser in short period of time. When I close tabs then wait out > a bit then close the browser it doesn't happen so I guess some interrupted > cleanup triggers it. I'm still investigating, but I would like to rule out one option. Could you check out the patch? diff --git a/kernel/ucount.c b/kernel/ucount.c index bb51849e6375..f23f906f4f62 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -201,11 +201,14 @@ void put_ucounts(struct ucounts *ucounts) { unsigned long flags; - if (atomic_dec_and_lock_irqsave(&ucounts->count, &ucounts_lock, flags)) { + spin_lock_irqsave(&ucounts_lock, flags); + if (atomic_dec_and_test(&ucounts->count)) { hlist_del_init(&ucounts->node); spin_unlock_irqrestore(&ucounts_lock, flags); kfree(ucounts); + return; } + spin_unlock_irqrestore(&ucounts_lock, flags); } static inline bool atomic_long_inc_below(atomic_long_t *v, int u) -- Rgrds, legion