From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB620AD5C for ; Wed, 13 Sep 2023 22:07:27 +0000 (UTC) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BDEC1998 for ; Wed, 13 Sep 2023 15:07:27 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1c3887039d4so2329175ad.1 for ; Wed, 13 Sep 2023 15:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694642847; x=1695247647; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fxDfuaaCOGIkY/J7UCucAcZfBxGD0O7N2E+zpPv/A2A=; b=jOHPy3ruaBE5qFzc9ldCHn0VON770hgjGuV8uGeSixVmPSAAx6XwxyvPZ6c8qvm/li bsB48BIioFGP5F4W67eldUtaIPc/fYEZADn/8YFBtFgXdVm9AD1W0A7JzBf+choJwFzj w9/fi9bS8xWE9HoMFdwluFoKdGgTUC5vDOT8A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694642847; x=1695247647; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fxDfuaaCOGIkY/J7UCucAcZfBxGD0O7N2E+zpPv/A2A=; b=W3E/xUeLqJiBwqSv7maOKsMb+ktYkFtfD3KcKLvkSKS4REKLPVjwvC3ngJTbZeDfSs w2msFBiY7P+GSY7dSUwjpqYHOKZdvA3LoY7yLwn/EVd9aRQRnP9L77eLm/vPbJvRAA0K X3VDhCtz4/5f0kKD/prVdnxn8fHieYTVFHfYxBg01WZ1FvIdzAY3ieRQadqHs2FpysuS D4LcxRh3cw+JxUstfp8/2IyAwNkXd0GCSDgh5kyiVRLsdnj7UBGaLMGq3wvEOFTpsKSc SSycBmPCF5zn/zqcb3gw/M4GSD4J0GzU6HqPapettWsQuvWjunEYuuNZvawdTO5lXQjP HX9A== X-Gm-Message-State: AOJu0Yy+Ej9xTC0s6AoxigLvZpaCSHAXqIhTRWht9paQN0RGbU8uI1Vj lspEfMYjlWOjtF4OLcf31wMK4Q== X-Google-Smtp-Source: AGHT+IHxaT5/+ccui2vnFiQVAeKtjd2URt+LuOsqD0F5iWtHIS5/zUtL5g0V6xehNx6RA+H3QM0vDQ== X-Received: by 2002:a17:902:ecca:b0:1c4:62a:e4a with SMTP id a10-20020a170902ecca00b001c4062a0e4amr576300plh.64.1694642846953; Wed, 13 Sep 2023 15:07:26 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id a9-20020a170902ee8900b001bf095dfb76sm97776pld.237.2023.09.13.15.07.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 15:07:26 -0700 (PDT) Date: Wed, 13 Sep 2023 15:07:25 -0700 From: Kees Cook To: Christoph Hellwig Cc: Christian Brauner , Al Viro , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Fenghua Yu , Reinette Chatre , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dennis Dalessandro , Tejun Heo , Trond Myklebust , Anna Schumaker , Damien Le Moal , Naohiro Aota , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org, linux-hardening@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH 08/19] pstore: shrink the pstore_sb_lock critical section in pstore_kill_sb Message-ID: <202309131507.E20F3AA130@keescook> References: <20230913111013.77623-1-hch@lst.de> <20230913111013.77623-9-hch@lst.de> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230913111013.77623-9-hch@lst.de> On Wed, Sep 13, 2023 at 08:10:02AM -0300, Christoph Hellwig wrote: > ->kill_sb can't race with creating ->fill_super because pstore is a > _single file system that only ever has a single sb instance, and we wait > for the previous one to go away before creating a new one. Reduce > the critical section so that is is not held over generic_shutdown_super. > > Signed-off-by: Christoph Hellwig Thanks for the refactoring! Reviewed-by: Kees Cook -- Kees Cook