[PATCH 3/9] LSM: Permit commit_creds() to take a const pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Eric Paris <eparis@xxxxxxxxxx>

Permit commit_creds() to take a pointer to an already published set of
credentials (which will have a const pointer).  commit_creds() doesn't actually
modify the credentials it is given (barring the usage count), so this shouldn't
be a problem.

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
Cc: Eric Paris <eparis@xxxxxxxxxx>
---

 include/linux/cred.h |    2 +-
 kernel/cred.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/cred.h b/include/linux/cred.h
index 9aeeb0b..6a9cec4 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -157,7 +157,7 @@ extern const struct cred *get_task_cred(struct task_struct *);
 extern struct cred *cred_alloc_blank(void);
 extern struct cred *prepare_creds(void);
 extern struct cred *prepare_exec_creds(void);
-extern int commit_creds(struct cred *);
+extern int commit_creds(const struct cred *);
 extern void abort_creds(struct cred *);
 extern const struct cred *override_creds(const struct cred *);
 extern void revert_creds(const struct cred *);
diff --git a/kernel/cred.c b/kernel/cred.c
index 5557b55..1873e87 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -464,7 +464,7 @@ error_put:
  * Always returns 0 thus allowing this function to be tail-called at the end
  * of, say, sys_setgid().
  */
-int commit_creds(struct cred *new)
+int commit_creds(const struct cred *new)
 {
 	struct task_struct *task = current;
 	const struct cred *old = task->real_cred;


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux