Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5249961yba; Wed, 10 Apr 2019 15:02:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZTys7kH5DhsG60GR3aMSbM0GowXhbZ1scZI4n+ZCO9NAamWC4TZJMNHVei9f6vIpIweWR X-Received: by 2002:a63:3287:: with SMTP id y129mr43351280pgy.9.1554933729338; Wed, 10 Apr 2019 15:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554933729; cv=none; d=google.com; s=arc-20160816; b=AfIpDmVTKmsgV0BVxxtF2IMfmyqwv9qIxP/Z9T9Q+QD7sd64um62Zi1FJwdR+jSbvx tSceTaAjmBwqr/eF6Ub32q3Rn3zJJDzcSuO3/FHDKWM3S91tdoTSHRey57MLiY4O9pVs SDYnI7k1fBtYPIRExwHwb1G61PulucEny4qp4FG94NSCyIguImGFM/wG7tg997/lZZ0B rSqv4r/EsR6lHs3/YcpSuSEQZL7tOv0rB0Im15htMKx0KgfjdeuP2J6fvXlDU6yhlYeu kVjeVgjLtSZtvuW9gNn13bDdKdIGaUdgwGFSejUHrpHnuQdjN5ZtDf0UceW5heB1p4u9 /Inw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=rU9gC+apthd6j8NRjnGbDiY5SCSFqwHOe05/q3UOxMA=; b=SGhCx2SIOxLJPHShfQ/OQbCtCunFyBv0hF3FsaXTrWDK1FHcjZuh3NvYaKP2GQZvxO RxT1eVcE5aEAzZq2Bguxgqwri8n7wdyV6scwulMfl3S97Fm/dF2YyUZOeXxvqXycZyTr qpSbjo3jG4wev5Jy12emzLLhSp2WDR8P4ZS8dtDGvv92HjeehPytLxpYyLwXZFb8QZuC 4zUlYGFzBrkMWf4QNKm8q9C9eBW/aJPV1fzNr3MV5uAYBLgrfb/pZe5oNNn1WWoMTtzI sTg851GkybWvG9+3fLqJ2+a2JrbSsONauK8miCo+3+bwpjoUB+BeCi88C1tsvd0Q587d kUEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si32982768pll.170.2019.04.10.15.01.53; Wed, 10 Apr 2019 15:02:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbfDJWAy (ORCPT + 99 others); Wed, 10 Apr 2019 18:00:54 -0400 Received: from namei.org ([65.99.196.166]:33568 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbfDJWAy (ORCPT ); Wed, 10 Apr 2019 18:00:54 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x3AM0hDW005829; Wed, 10 Apr 2019 22:00:43 GMT Date: Thu, 11 Apr 2019 08:00:43 +1000 (AEST) From: James Morris To: Al Viro cc: Kangjie Lu , pakki001@umn.edu, "Serge E. Hallyn" , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] security: inode: fix a missing check for securityfs_create_file In-Reply-To: <20190410180156.GZ2217@ZenIV.linux.org.uk> Message-ID: References: <20190315210025.17832-1-kjlu@umn.edu> <20190410180156.GZ2217@ZenIV.linux.org.uk> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Apr 2019, Al Viro wrote: > Rather bad way to do it - generally, register_filesystem() should be > the last thing done by initialization. Any modular code that > does unregister_filesystem() on failure exit is flat-out broken; > here it's not instantly FUBAR, but it's a bloody bad example. > > What's more, why not let simple_fill_super() do it? Just > static int fill_super(struct super_block *sb, void *data, int silent) > { > static const struct tree_descr files[] = { > #ifdef CONFIG_SECURITY > {"lsm", &lsm_ops, 0444}, > #endif > {""} > }; > > and to hell with that call of securityfs_create_file() and all its > failure handling... Thanks for the review. Reverted. -- James Morris