Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5134069yba; Wed, 10 Apr 2019 12:06:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCg9yYah+0FrDQRXpV1Or6sBmRFEp5floUX4D42zIlZcjFvkVHcXaymnX6NNqcQ5ac0g1n X-Received: by 2002:a62:ed10:: with SMTP id u16mr45756079pfh.187.1554923203027; Wed, 10 Apr 2019 12:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554923203; cv=none; d=google.com; s=arc-20160816; b=0qA0m4uNRy/AT6XknuQwAbhc+Mzvl+JRNFsNOzKKf05yd9iGfIMjabs3F9zSWj0K9p U0+APmx1/Jqf3fBy1Z7HuyiotSck5fokC9mvTLI+cHR90WYVbcfPGV5OppSmcze29+qs MYCe/EILY0i8y0OC4Vu0wWUoeiU/CLSU/NmCV9p3wEzee3eTPD7NwT1Q34i8KQ5y5lh9 RFguXSCL3AFOzoc661pTJJF31NWpKMkScpz7vEOC7hfzcvCndLR+58j5hfu3p24GIV/b rQwBPDNvnpXFLnrUY5rgcOYsaevBcUJaBebKtwuXYtdlSm3pabSX3LDy9/MbRe5/fucJ k3WA== 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=divofS0BwCf9+jtvuN/uDR2V8ELcKRNnKb9yAjoU+6E=; b=fB5/7iH7oiND3Jcw4e07GArMIRQLQpucCtSp9GqwMnuEKnUgeH0/rxakzh30E6wdHq VLBljmjZc+lGSsyi3veMWF4cklYkRTWlyFEkrOnR+gI9iqqFH7GFPzQR0JOHo1xz5NWg gyhK7xchbFR6ggbvoWwwWenCvks+xpJrerEJb6RN9ad6iUAPVYrFa23joGvyho+C3Syo C2lBJAz5mN3CLIkkdk1Js7kiaG0c+7BvDoqGJUbImwJ1XC9zWGoDcpl8KecKtfeAtiNq 03WXkXqFlIO+2vPOuGxiIYASx5iZlDLFzICpI/TRujo7KVS/UmufjVmDtwUhgW0mh4xA gC5Q== 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 i9si14395172pfr.111.2019.04.10.12.06.26; Wed, 10 Apr 2019 12:06:43 -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 S1729066AbfDJRes (ORCPT + 99 others); Wed, 10 Apr 2019 13:34:48 -0400 Received: from namei.org ([65.99.196.166]:33488 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727226AbfDJRes (ORCPT ); Wed, 10 Apr 2019 13:34:48 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x3AHYh3C026648; Wed, 10 Apr 2019 17:34:43 GMT Date: Thu, 11 Apr 2019 03:34:43 +1000 (AEST) From: James Morris To: Kangjie Lu cc: 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: <20190315210025.17832-1-kjlu@umn.edu> Message-ID: References: <20190315210025.17832-1-kjlu@umn.edu> 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 Fri, 15 Mar 2019, Kangjie Lu wrote: > securityfs_create_file may fail. The fix checks its status and > returns the error code upstream if it fails. > > Signed-off-by: Kangjie Lu > Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general > --- > Return the exact error code upstream. > --- > security/inode.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/security/inode.c b/security/inode.c > index b7772a9b315e..667f8b15027d 100644 > --- a/security/inode.c > +++ b/security/inode.c > @@ -339,6 +339,11 @@ static int __init securityfs_init(void) > #ifdef CONFIG_SECURITY > lsm_dentry = securityfs_create_file("lsm", 0444, NULL, NULL, > &lsm_ops); > + if (IS_ERR(lsm_dentry)) { > + unregister_filesystem(&fs_type); > + sysfs_remove_mount_point(kernel_kobj, "security"); > + return PTR_ERR(lsm_dentry); > + } > #endif > return 0; > } > -- James Morris