From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477AbbCKSrs (ORCPT ); Wed, 11 Mar 2015 14:47:48 -0400 Received: from smtp102.biz.mail.bf1.yahoo.com ([98.139.221.61]:29565 "EHLO smtp102.biz.mail.bf1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbbCKSrr (ORCPT ); Wed, 11 Mar 2015 14:47:47 -0400 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 2_Fv.AAVM1kfen4dpzrsN9JWkBdCwnRIe9_xkT65KcqN9K. w7wdds9a4kW_Blqkt349_VZtaeiVSSvlrmYfKm09K94LtiHFKjgJvnE23HWV RzGL8YyPGS1z4uA34Rx6ILAQfwD2UDBx02I6btVgIDa83VuIhzOyqMdkyf8l BnkHLXUHwmTbGI8o3qkZPNxVjlmSqHYrhaOvXCreUo_N.I1FWLWKwDbBh0Dx 5wgs154lillSEgnorprcvvoiOzyEPbwhGHh87_nrRxussa7NQaprBcDTo7oL ASeek8PYZCP7IYhmrUihbwMyqcR.kvnx3jPgCRt7K2J1pxeQwU.TuV8F_iZv XeryupaBZd6C5CvEUNCwn6ga6fUS302pj4ongdjzH5Y7WX4ZaFeas7gOWgIR MIlANjY2KpE5P0noO_C8x4DAEQJt6jSbYLAf_GsWj65iwpqkJTey3jxvEM1H Cs6gtHW.fJKo6bV.QNqsu3nLzIkk3Zn3FgkWgOebqJGi38PSsJ5pgW0z2jqP OHDn1sxIf9IoEx.RlNeLY5Jz8HGam4qxvSoFI3m1iKQJoIzkYz9UjNJ4Dz1M K1FXzQ_kCKg6VwrtdBkW6O2EWNHozNJo- X-Yahoo-SMTP: OIJXglSswBDfgLtXluJ6wiAYv6_cnw-- Message-ID: <55008DD0.3030402@schaufler-ca.com> Date: Wed, 11 Mar 2015 11:47:44 -0700 From: Casey Schaufler User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Stephen Smalley , James Morris , James Morris , LSM , LKLM CC: Paul Moore , John Johansen , Tetsuo Handa , Eric Paris , Kees Cook , Casey Schaufler Subject: Re: [PATCH 6/7 v21] LSM: Switch to lists of hooks References: <54FE4553.3000209@schaufler-ca.com> <54FE46EF.4000708@schaufler-ca.com> <5500708B.3050101@tycho.nsa.gov> In-Reply-To: <5500708B.3050101@tycho.nsa.gov> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/11/2015 9:42 AM, Stephen Smalley wrote: > On 03/09/2015 09:20 PM, Casey Schaufler wrote: >> Subject: [PATCH 6/7 v21] LSM: Switch to lists of hooks >> >> Instead of using a vector of security operations >> with explicit, special case stacking of the capability >> and yama hooks use lists of hooks with capability and >> yama hooks included as appropriate. >> >> The security_operations structure is no longer required. >> Instead, there is a union of the function pointers that >> allows all the hooks lists to use a common mechanism for >> list management while retaining typing. Each module >> supplies an array describing the hooks it provides instead >> of a sparsely populated security_operations structure. >> The description includes the element that gets put on >> the hook list, avoiding the issues surrounding individual >> element allocation. >> >> The method for registering security modules is changed to >> reflect the information available. The method for removing >> a module, currently only used by SELinux, has also changed. >> It should be generic now, however if there are potential >> race conditions based on ordering of hook removal that needs >> to be addressed by the calling module. >> >> The security hooks are called from the lists and the first >> failure is returned. >> >> Signed-off-by: Casey Schaufler >> >> --- >> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c >> index 0c45f08..3fd8610 100644 >> --- a/security/selinux/hooks.c >> +++ b/security/selinux/hooks.c >> @@ -2008,24 +2002,12 @@ static int selinux_ptrace_access_check(struct task_struct *child, >> >> static int selinux_ptrace_traceme(struct task_struct *parent) >> { >> - int rc; >> - >> - rc = cap_ptrace_traceme(parent); >> - if (rc) >> - return rc; >> - >> return task_has_perm(parent, current, PROCESS__PTRACE); >> } >> >> static int selinux_capget(struct task_struct *target, kernel_cap_t *effective, >> kernel_cap_t *inheritable, kernel_cap_t *permitted) >> { >> - int error; >> - >> - error = current_has_perm(target, PROCESS__GETCAP); >> - if (error) >> - return error; >> - >> return cap_capget(target, effective, inheritable, permitted); > Deleted the wrong code here. > >> } > And failed to delete the cap_capset() call from selinux_capset(), and > the cap_capable() call from selinux_capable(), so we're calling that > code twice after the patch. So I see. It was right in v19, but wrong in v20. I'll have an update quickly. > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >