linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: wenhuizhang <wenhui@gwmail.gwu.edu>
To: wenhui@gwmail.gwu.edu
Cc: James Morris <jmorris@namei.org>,
	Kees Cook <keescook@chromium.org>,
	Matthew Garrett <matthewgarrett@google.com>,
	David Howells <dhowells@redhat.com>,
	Casey Schaufler <casey@schaufler-ca.com>,
	"Joel Fernandes (Google)" <joel@joelfernandes.org>,
	Micah Morton <mortonm@chromium.org>,
	Janne Karhunen <janne.karhunen@gmail.com>,
	Richard Guy Briggs <rgb@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
Date: Thu, 26 Dec 2019 23:12:12 -0500	[thread overview]
Message-ID: <20191227041214.24064-1-wenhui@gwmail.gwu.edu> (raw)

selinux/lsm-common: reorder and format security hooks
  	Changes to be committed:
		modified:   include/linux/security.h
	Details:
		- add default hook for security_cred_getsecid
		- group hooks with functionalities and get coherent for orders
---
 include/linux/security.h | 46 +++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/include/linux/security.h b/include/linux/security.h
index 3e8d4bacd59d..14f580e37b24 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -462,10 +462,6 @@ static inline  int unregister_blocking_lsm_notifier(struct notifier_block *nb)
 	return 0;
 }
 
-static inline void security_free_mnt_opts(void **mnt_opts)
-{
-}
-
 /*
  * This is the default capabilities functionality.  Most of these functions
  * are just stubbed out, but a few must call the proper capable code.
@@ -605,6 +601,9 @@ static inline int security_sb_alloc(struct super_block *sb)
 static inline void security_sb_free(struct super_block *sb)
 { }
 
+static inline void security_free_mnt_opts(void **mnt_opts)
+{ }
+
 static inline int security_sb_eat_lsm_opts(char *options,
 					   void **mnt_opts)
 {
@@ -679,20 +678,6 @@ static inline int security_move_mount(const struct path *from_path,
 	return 0;
 }
 
-static inline int security_path_notify(const struct path *path, u64 mask,
-				unsigned int obj_type)
-{
-	return 0;
-}
-
-static inline int security_inode_alloc(struct inode *inode)
-{
-	return 0;
-}
-
-static inline void security_inode_free(struct inode *inode)
-{ }
-
 static inline int security_dentry_init_security(struct dentry *dentry,
 						 int mode,
 						 const struct qstr *name,
@@ -710,6 +695,19 @@ static inline int security_dentry_create_files_as(struct dentry *dentry,
 	return 0;
 }
 
+static inline int security_path_notify(const struct path *path, u64 mask,
+				unsigned int obj_type)
+{
+	return 0;
+}
+
+static inline int security_inode_alloc(struct inode *inode)
+{
+	return 0;
+}
+
+static inline void security_inode_free(struct inode *inode)
+{ }
 
 static inline int security_inode_init_security(struct inode *inode,
 						struct inode *dir,
@@ -982,8 +980,10 @@ static inline int security_prepare_creds(struct cred *new,
 
 static inline void security_transfer_creds(struct cred *new,
 					   const struct cred *old)
-{
-}
+{ }
+
+static inline void security_cred_getsecid(const struct cred *c, u32 *secid)
+{ }
 
 static inline int security_kernel_act_as(struct cred *cred, u32 secid)
 {
@@ -1249,12 +1249,10 @@ static inline int security_secctx_to_secid(const char *secdata,
 }
 
 static inline void security_release_secctx(char *secdata, u32 seclen)
-{
-}
+{ }
 
 static inline void security_inode_invalidate_secctx(struct inode *inode)
-{
-}
+{ }
 
 static inline int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
 {
-- 
2.17.1


             reply	other threads:[~2019-12-27  4:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27  4:12 wenhuizhang [this message]
2019-12-27 15:59 ` [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> Casey Schaufler
2021-05-09 23:33 wenhuizhang
2021-05-11 16:32 ` Aurélien Aptel
     [not found]   ` <CAOSEQ1p80+JemJkj975ZTt5xw4XCPtOf2uBEvQs9RfW4UkDWXg@mail.gmail.com>
2021-05-11 18:06     ` Aurélien Aptel

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=20191227041214.24064-1-wenhui@gwmail.gwu.edu \
    --to=wenhui@gwmail.gwu.edu \
    --cc=casey@schaufler-ca.com \
    --cc=dhowells@redhat.com \
    --cc=janne.karhunen@gmail.com \
    --cc=jmorris@namei.org \
    --cc=joel@joelfernandes.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthewgarrett@google.com \
    --cc=mortonm@chromium.org \
    --cc=rgb@redhat.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).