All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Johansen <john.johansen@canonical.com>
To: "Serge E. Hallyn" <serge@hallyn.com>, Paul Moore <paul@paul-moore.com>
Cc: selinux@vger.kernel.org, linux-security-module@vger.kernel.org
Subject: Re: [PATCH] lsm: security_task_getsecid_subj() -> security_current_getsecid_subj()
Date: Fri, 19 Nov 2021 15:59:34 -0800	[thread overview]
Message-ID: <aeb3a040-b1b2-f6dc-6744-4e9d1979e351@canonical.com> (raw)
In-Reply-To: <20211119232305.GA32613@mail.hallyn.com>

On 11/19/21 3:23 PM, Serge E. Hallyn wrote:
> On Fri, Nov 19, 2021 at 05:52:33PM -0500, Paul Moore wrote:
>> On Wed, Sep 29, 2021 at 3:17 PM Paul Moore <paul@paul-moore.com> wrote:
>>>
>>> The security_task_getsecid_subj() LSM hook invites misuse by allowing
>>> callers to specify a task even though the hook is only safe when the
>>> current task is referenced.  Fix this by removing the task_struct
>>> argument to the hook, requiring LSM implementations to use the
>>> current task.  While we are changing the hook declaration we also
>>> rename the function to security_current_getsecid_subj() in an effort
>>> to reinforce that the hook captures the subjective credentials of the
>>> current task and not an arbitrary task on the system.
>>>
>>> Signed-off-by: Paul Moore <paul@paul-moore.com>
> 
> Makes perfect sense given the motivation of 4ebd7651b  :)
> 
> Reviewed-by: Serge Hallyn <serge@hallyn.com>
> 
> Oh, actually, one question below (cc:ing John explicitly)
> 

<< snip >>

>>> -static void apparmor_task_getsecid(struct task_struct *p, u32 *secid)
>>> +static void apparmor_current_getsecid_subj(u32 *secid)
>>> +{
>>> +       struct aa_label *label = aa_get_task_label(current);
> 
> Should you use aa_get_current_label() here instead?
> 

yes, that would be better



  reply	other threads:[~2021-11-19 23:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 19:17 [PATCH] lsm: security_task_getsecid_subj() -> security_current_getsecid_subj() Paul Moore
2021-09-29 19:19 ` Paul Moore
2021-11-19 22:52 ` Paul Moore
2021-11-19 23:23   ` Serge E. Hallyn
2021-11-19 23:59     ` John Johansen [this message]
2021-11-20 15:04       ` Paul Moore
2021-11-20  0:42   ` Casey Schaufler
2021-11-20 15:06     ` Paul Moore
2021-11-20 17:54       ` Casey Schaufler
2021-11-22 23:12   ` Paul Moore
2021-11-22 23:25     ` Serge E. Hallyn
2021-11-23  0:40     ` Casey Schaufler
2021-11-23  3:14       ` Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aeb3a040-b1b2-f6dc-6744-4e9d1979e351@canonical.com \
    --to=john.johansen@canonical.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.