Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3584384pxu; Tue, 15 Dec 2020 10:16:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJysLLc8ME464BiMtyzgCn2uJDSJWucua9KwsEeXBJh4PhxVdvgRmH2KIZPgegEfaZIerPMv X-Received: by 2002:a05:6402:1748:: with SMTP id v8mr31376450edx.136.1608056218219; Tue, 15 Dec 2020 10:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608056218; cv=none; d=google.com; s=arc-20160816; b=H+RR4QQYvnd+MnwP6hNpDnWjMnOmw/bkfyg30VdUfrGWnFxZ65ZeJmc/BNhJ9C0I1a lOx8rgd8c8aagLzrraPyr3woNVaY0yEob0dBS4u/oiPdTKPxikwHeHYbl3Pfrxp8XsJ2 U11k/63UTpesy7I3/fJqeQwPDKFCFXUJA/ulVeR8EVZbPuDw9ckaz0tiunWXAJHd3+3d C4Z34b7K4shyhGytmvl31631gTctd+P64eSgSYctCa0xn/HhNJsoAY9/sTwv49z+IRUp 101i1KCk0w+XPGGKt2T/IW7n2NydkfKHB8Er2EHh1cyaHwof5/iPwyXoipeLqPVJ3FCf hx7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=aogMOmk4bsmznjsALWaTSguRC9pC6jg4i6uPza5PDJk=; b=y7QiXhJKpG5JbGOUpLcmpZp+u2v0NPNcf/GKDE2eox11+dVgVbxm3/0mYWQs6cPwGP l3GW/goDBa2MduBiA1F3uTtWWwGi2OJotSSO8m4ttzK6DNPJOdM7Z5tomkJpTGi9lo8O ql4ji8Wed1QAh09XTbhRk6+Zu6r5HaoesmvJVky0w35ufYRUy9wm9wMAF9gom8X+fXfd DjVaT/KIzjcfILSb/6TZot0/iM+ITeNq+VLNmY181Ol2WjVP0V7gXQkwRBpbZPyn1LMP a/SHEjdXL1/Bc+0WprviG9CX7VOv+eiM5BY61tckbhsrxhDe1jhdXkt56GrSpXkplL7w qytg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b="Fl/N1A1a"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si1305527edj.120.2020.12.15.10.16.34; Tue, 15 Dec 2020 10:16:58 -0800 (PST) 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=@yahoo.com header.s=s2048 header.b="Fl/N1A1a"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730667AbgLOSKf (ORCPT + 99 others); Tue, 15 Dec 2020 13:10:35 -0500 Received: from sonic301-38.consmr.mail.ne1.yahoo.com ([66.163.184.207]:40779 "EHLO sonic301-38.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730563AbgLOSKI (ORCPT ); Tue, 15 Dec 2020 13:10:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1608055762; bh=aogMOmk4bsmznjsALWaTSguRC9pC6jg4i6uPza5PDJk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=Fl/N1A1acpCXp3hv5b9TkN/mGdoop1UOi5hFVVpdYdahCPjXq/SqhPzduUF1c9ikQER2l02p0DjEjYa3F1IwTou6dEy9fUi0UQR5ho9PuhaBwNb0vRNYSE1qY/VIJZmqA0OYm/J0+bS9XKLoxOouCyAsjxTZ4KEOH6mdSP0OSYoxinepJY1HppRmX1BVbQyBusP14VTk8o0aKXObir7Ypsdbn3AH3G751AwsZi+L4hAtRCYW+Nljq0DHYMu3H2LOo6IQVm7iI6VID25pDCHjCQErZSWGQyQGn+0Ktot3UmJo5EgUDsrefOkmYXIlFe9UM5T0uYcOAJKYFMV9W2QFhw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1608055762; bh=khpEFUhYniJCGq9vvq6RUHv+txXviNHPRcq8peiHIha=; h=Subject:To:From:Date:From:Subject; b=AX7XaqCrvWhajtghC7LS8zHCefG6weH+xXIlPyCWk5zZpx7SGx5uaP81nYVbJ+nAHFcuNTCWPK8EJavOK5PL2BF34ShiuoFAgxar+ksPT1b5FiTg3Vq0kvDUzyXUowO/+cikLYXGGJDbz4nA75qhFw0SBbkO6JPKyY3IdAGAeJB14DL7c4gukDhIXguVGH4bOCoPhxZYN48QrSXwYFbUo7iKfzpgosFCUcZyQNGDZj68h8IdA1UddEwYwHxb1PJbcY0w75Do76ntxeHAC3LfEMKUlvgFRZgN+nzz6oGzXOralvHnIcM8SFifTlklMOcb+xydsekkuf35GfLEwQhB7w== X-YMail-OSG: NRRNDrYVM1mUn_vYqQNv4JZOQ8Z.xnNcaRyIP09zH4UlPr81IeKtU_WotjsYCix WSzFIyJj8GEzDV6xod1SI59kDov4Ip3DnXe9s6ZHoyk0Jfg6m._ba3Ny6ahN0Dy6tDpu5XykNfn. ugkDB8WsDr.SgN00l8BCDl7Z7kEUgbPWSCTnP.EeIbKyrgW.4y_tplBj2eEZaGijl1_C91EYFdLo GunkoQQLYUnIQzHrSdsnpoAhrF5WwY1s733vXTnLQj5Q9CtR1fQ_0PP0YBC25tiVqMTxL7h4x.nn .kJ8j1ujwGdmrZ9_pW8kRNyRtjw8QcAgP7JvWKYh0QUHMRgXtzXpikP1YhS2MmluAIFecP3_7Caw 0_UgocZs8VIRSsF58aq4eFn5cGpzDhq58qJ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consmr.mail.ne1.yahoo.com with HTTP; Tue, 15 Dec 2020 18:09:22 +0000 Received: by smtp422.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID d3456e8f81da9775419af5a53f939e16; Tue, 15 Dec 2020 18:09:16 +0000 (UTC) Subject: Re: [PATCH v2] proc: Allow pid_revalidate() during LOOKUP_RCU To: Paul Moore , Matthew Wilcox Cc: "Eric W. Biederman" , Stephen Smalley , Stephen Brennan , Alexey Dobriyan , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org, Eric Paris , selinux@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Casey Schaufler References: <20201204000212.773032-1-stephen.s.brennan@oracle.com> <20201212205522.GF2443@casper.infradead.org> <877dpln5uf.fsf@x220.int.ebiederm.org> <20201213162941.GG2443@casper.infradead.org> From: Casey Schaufler Message-ID: <3504e55a-e429-8f51-1b23-b346434086d8@schaufler-ca.com> Date: Tue, 15 Dec 2020 10:09:15 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Mailer: WebService/1.1.17278 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Content-Length: 2502 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/13/2020 3:00 PM, Paul Moore wrote: > On Sun, Dec 13, 2020 at 11:30 AM Matthew Wilcox w= rote: >> On Sun, Dec 13, 2020 at 08:22:32AM -0600, Eric W. Biederman wrote: >>> Matthew Wilcox writes: >>> >>>> On Thu, Dec 03, 2020 at 04:02:12PM -0800, Stephen Brennan wrote: >>>>> -void pid_update_inode(struct task_struct *task, struct inode *inod= e) >>>>> +static int do_pid_update_inode(struct task_struct *task, struct in= ode *inode, >>>>> + unsigned int flags) >>>> I'm really nitpicking here, but this function only _updates_ the ino= de >>>> if flags says it should. So I was thinking something like this >>>> (compile tested only). >>>> >>>> I'd really appreocate feedback from someone like Casey or Stephen on= >>>> what they need for their security modules. >>> Just so we don't have security module questions confusing things >>> can we please make this a 2 patch series? With the first >>> patch removing security_task_to_inode? >>> >>> The justification for the removal is that all security_task_to_inode >>> appears to care about is the file type bits in inode->i_mode. Someth= ing >>> that never changes. Having this in a separate patch would make that >>> logical change easier to verify. >> I don't think that's right, which is why I keep asking Stephen & Casey= >> for their thoughts. > The SELinux security_task_to_inode() implementation only cares about > inode->i_mode S_IFMT bits from the inode so that we can set the object > class correctly. The inode's SELinux label is taken from the > associated task. > > Casey would need to comment on Smack's needs. SELinux uses different "class"es on subjects and objects. Smack does not differentiate, so knows the label it wants the inode to have when smack_task_to_inode() is called, and sets it accordingly. Nothing is allocated in the process, and the new value is coming from the Smack master label list. It isn't going to go away. It appears that this is the point of the hook. Am I missing something? > >> For example, >> >> * Sets the smack pointer in the inode security blob >> */ >> static void smack_task_to_inode(struct task_struct *p, struct inode *i= node) >> { >> struct inode_smack *isp =3D smack_inode(inode); >> struct smack_known *skp =3D smk_of_task_struct(p); >> >> isp->smk_inode =3D skp; >> isp->smk_flags |=3D SMK_INODE_INSTANT; >> } >> >> That seems to do rather more than checking the file type bits.