linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: Leo Yan <leo.yan@linaro.org>,
	codalist@telemann.coda.cs.cmu.edu,
	Jan Harkes <jaharkes@cs.cmu.edu>,
	Leon Romanovsky <leon@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	netdev@vger.kernel.org, Balbir Singh <bsingharora@gmail.com>,
	linux-kernel@vger.kernel.org, Eric Paris <eparis@redhat.com>,
	coda@cs.cmu.edu, linux-audit@redhat.com,
	coresight@lists.linaro.org, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org,
	Mike Leach <mike.leach@linaro.org>
Subject: Re: [PATCH v2 6/7] audit: Use task_is_in_init_pid_ns()
Date: Wed, 15 Dec 2021 14:09:12 -0500	[thread overview]
Message-ID: <20211215190912.GU1550715@madcap2.tricolour.ca> (raw)
In-Reply-To: <CAHC9VhThB=kDsXr8Uc_65+gePucSstAbrab2TpLxcBSd0k39pQ@mail.gmail.com>

On 2021-12-14 17:35, Paul Moore wrote:
> On Wed, Dec 8, 2021 at 3:33 AM Leo Yan <leo.yan@linaro.org> wrote:
> >
> > Replace open code with task_is_in_init_pid_ns() for checking root PID
> > namespace.
> >
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> >  kernel/audit.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I'm not sure how necessary this is, but it looks correct to me.

I had the same thought.  I looks correct to me.  I could see the value
if it permitted init_pid_ns to not be global.

> Acked-by: Paul Moore <paul@paul-moore.com>

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>

> > diff --git a/kernel/audit.c b/kernel/audit.c
> > index 121d37e700a6..56ea91014180 100644
> > --- a/kernel/audit.c
> > +++ b/kernel/audit.c
> > @@ -1034,7 +1034,7 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type)
> >         case AUDIT_MAKE_EQUIV:
> >                 /* Only support auditd and auditctl in initial pid namespace
> >                  * for now. */
> > -               if (task_active_pid_ns(current) != &init_pid_ns)
> > +               if (!task_is_in_init_pid_ns(current))
> >                         return -EPERM;
> >
> >                 if (!netlink_capable(skb, CAP_AUDIT_CONTROL))
> > --
> > 2.25.1
> 
> paul moore

- RGB

--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635


  reply	other threads:[~2021-12-15 19:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08  8:33 [PATCH v2 0/7] pid: Introduce helper task_is_in_root_ns() Leo Yan
2021-12-08  8:33 ` [PATCH v2 1/7] pid: Introduce helper task_is_in_init_pid_ns() Leo Yan
2021-12-08  9:28   ` Leon Romanovsky
2021-12-08 10:25   ` Suzuki K Poulose
2021-12-14  5:55   ` Balbir Singh
2021-12-08  8:33 ` [PATCH v2 2/7] coresight: etm3x: Use task_is_in_init_pid_ns() Leo Yan
2021-12-08 10:26   ` Suzuki K Poulose
2021-12-14  5:55   ` Balbir Singh
2021-12-08  8:33 ` [PATCH v2 3/7] coresight: etm4x: " Leo Yan
2021-12-08 10:26   ` Suzuki K Poulose
2021-12-14  5:54   ` Balbir Singh
2021-12-08  8:33 ` [PATCH v2 4/7] connector/cn_proc: " Leo Yan
2021-12-14  5:58   ` Balbir Singh
2021-12-14  7:05     ` Leo Yan
2021-12-08  8:33 ` [PATCH v2 5/7] coda: " Leo Yan
2021-12-08  8:33 ` [PATCH v2 6/7] audit: " Leo Yan
2021-12-14  5:56   ` Balbir Singh
2021-12-14 22:35   ` Paul Moore
2021-12-15 19:09     ` Richard Guy Briggs [this message]
2021-12-16  1:09       ` Leo Yan
2021-12-08  8:33 ` [PATCH v2 7/7] taskstats: " Leo Yan
2021-12-14  5:56   ` Balbir Singh
2022-01-12  6:40 ` [PATCH v2 0/7] pid: Introduce helper task_is_in_root_ns() Leo Yan
2022-01-24  9:29   ` Leo Yan

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=20211215190912.GU1550715@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bsingharora@gmail.com \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@telemann.coda.cs.cmu.edu \
    --cc=coresight@lists.linaro.org \
    --cc=davem@davemloft.net \
    --cc=eparis@redhat.com \
    --cc=jaharkes@cs.cmu.edu \
    --cc=kuba@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=leon@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=suzuki.poulose@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).