All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huaisheng HS1 Ye <yehs1@lenovo.com>
To: Paul Moore <paul@paul-moore.com>, Stephen Smalley <sds@tycho.nsa.gov>
Cc: Huaisheng Ye <yehs2007@zoho.com>,
	Eric Paris <eparis@parisplace.org>,
	James Morris <jmorris@namei.org>, Serge Hallyn <serge@hallyn.com>,
	"Tzu ting Yu1" <tyu1@lenovo.com>,
	"linux-security-module@vger.kernel.org" 
	<linux-security-module@vger.kernel.org>,
	"selinux@vger.kernel.org" <selinux@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [External]  Re: [PATCH] selinux: remove redundant msg_msg_alloc_security
Date: Sun, 12 Jan 2020 15:45:37 +0000	[thread overview]
Message-ID: <HK2PR03MB4418F8333938ECB1920F813D923A0@HK2PR03MB4418.apcprd03.prod.outlook.com> (raw)
In-Reply-To: <CAHC9VhT-8R4iT-V-A+6NvZgG=bh4Knieif2fuKwybnDuXvC6ug@mail.gmail.com>


> -----Original Message-----
> From: Paul Moore <paul@paul-moore.com>
> Sent: Saturday, January 11, 2020 12:50 AM
> On Fri, Jan 10, 2020 at 10:13 AM Stephen Smalley <sds@tycho.nsa.gov> wrote:
> > On 1/10/20 4:58 AM, Huaisheng Ye wrote:
> > > From: Huaisheng Ye <yehs1@lenovo.com>
> > >
> > > selinux_msg_msg_alloc_security only calls msg_msg_alloc_security but
> > > do nothing else. And also msg_msg_alloc_security is just used by the
> > > former.
> > >
> > > Remove the redundant function to simplify the code.
> >
> > This seems to also be true of other _alloc_security functions,
> > probably due to historical reasons.  Further, at least some of these
> > functions no longer perform any allocation; they are just
> > initialization functions now that allocation has been taken to the LSM
> > framework, so possibly could be renamed and made to return void at some point.
> 
> I've noticed the same thing on a few occasions, I've just never bothered to put
> the fixes into a patch.  We might as well do that now, at least for the redundant
> code bits; I'll leave the return code issue for another time as that would cross
> LSM boundaries and that really isn't appropriate in the -rc5 timeframe IMHO.
> 
> I'll put something together once I finish up the patch/review backlog from the
> past few days.  Looking quickly with a regex, it would appear that
> inode_alloc_security(), file_alloc_security(), and
> superblock_alloc_security() are all candidates.  While not an allocator, we can
> probably get rid of inode_doinit() as well.

Besides, it looks like selinux_nlmsg_perm is candidate too.
Just send a patch for this function.

Cheers,
Huaisheng Ye

  reply	other threads:[~2020-01-12 15:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  9:58 [PATCH] selinux: remove redundant msg_msg_alloc_security Huaisheng Ye
2020-01-10 15:13 ` Stephen Smalley
2020-01-10 16:44   ` Casey Schaufler
2020-01-10 16:50   ` Paul Moore
2020-01-12 15:45     ` Huaisheng HS1 Ye [this message]
2020-01-10 16:43 ` 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=HK2PR03MB4418F8333938ECB1920F813D923A0@HK2PR03MB4418.apcprd03.prod.outlook.com \
    --to=yehs1@lenovo.com \
    --cc=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@vger.kernel.org \
    --cc=serge@hallyn.com \
    --cc=tyu1@lenovo.com \
    --cc=yehs2007@zoho.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.