linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Wuerstlein <arw@arw.name>
To: linux-kernel@vger.kernel.org
Cc: Alexander Wuerstlein <arw@arw.name>,
	Johannes Schlumberger <spjsschl@stud.informatik.uni-erlangen.de>
Subject: [PATCH] sns: add syscall to check signed state of a process [4/4]
Date: Fri, 22 Jun 2007 20:25:29 +0200	[thread overview]
Message-ID: <11825367293600-git-send-email-arw@arw.name> (raw)
In-Reply-To: <20070621155516.GA6838@faui01.informatik.uni-erlangen.de>

Makes it possible for a userspace process to ask for the trustworthiness of
another process.

Signed-off-by: Johannes Schlumberger <spjsschl@cip.informatik.uni-erlangen.de>
---
 arch/i386/kernel/syscall_table.S |    1 +
 include/asm-i386/unistd.h        |    3 ++-
 security/sns.c                   |   15 +++++++++++++++
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index bf6adce..e8ba35a 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -323,3 +323,4 @@ ENTRY(sys_call_table)
 	.long sys_signalfd
 	.long sys_timerfd
 	.long sys_eventfd
+	.long sys_sns_is_trusted	/* 320 */
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index e84ace1..3f8df3e 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -329,10 +329,11 @@
 #define __NR_signalfd		321
 #define __NR_timerfd		322
 #define __NR_eventfd		323
+#define __NR_sns_is_trusted	324
 
 #ifdef __KERNEL__
 
-#define NR_syscalls 324
+#define NR_syscalls 325
 
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
diff --git a/security/sns.c b/security/sns.c
index 3192a90..1978f7c 100644
--- a/security/sns.c
+++ b/security/sns.c
@@ -112,3 +112,18 @@ int sns_signature_valid(struct file *file)
 	crypto_free_hash(tfm);
 	return ret;
 }
+
+asmlinkage int sys_sns_is_trusted(pid_t p)
+{
+	struct task_struct *t;
+	rcu_read_lock();
+	t = find_task_by_pid(p);
+	if (IS_ERR(t)) {
+		rcu_read_unlock();
+		return -EINVAL;
+	}
+	p = t->sns_valid_sig; /*locking needed*/
+	rcu_read_unlock();
+	return p;
+}
+EXPORT_SYMBOL_GPL(sys_sns_is_trusted);
-- 
1.5.2.1


  parent reply	other threads:[~2007-06-22 18:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-21 15:55 [PATCH] signed binaries support [0/4] Johannes Schlumberger
2007-06-21 16:17 ` Adrian Bunk
2007-06-21 16:29   ` Alexander Wuerstlein
2007-06-21 17:23     ` Adrian Bunk
2007-06-21 17:34       ` Alexander Wuerstlein
2007-06-21 18:05         ` Adrian Bunk
2007-06-21 18:21           ` Johannes Schlumberger
2007-06-22 18:25 ` [PATCH] export xattr_resolve_name_sns [1/4] Alexander Wuerstlein
2007-06-22 18:25 ` [PATCH] Check files' signatures before doing suid/sgid [2/4] Alexander Wuerstlein
2007-06-22 19:36   ` Satyam Sharma
2007-06-24 22:58     ` Alexander Wuerstlein
2007-06-25 23:53       ` Satyam Sharma
2007-06-26  0:27         ` Alexander Wuerstlein
2007-06-26  2:13           ` Satyam Sharma
2007-06-23 17:54   ` Jan Engelhardt
2007-06-22 18:25 ` [PATCH] sns: check related executable memory of binaries [3/4] Alexander Wuerstlein
2007-06-22 18:25 ` Alexander Wuerstlein [this message]
2007-06-21 16:02 [PATCH] sns: add syscall to check signed state of a process [4/4] Alexander Wuerstlein
2007-06-21 16:34 ` Akinobu Mita
2007-06-21 16:49   ` Alexander Wuerstlein
2007-06-23 18:03     ` Jan Engelhardt

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=11825367293600-git-send-email-arw@arw.name \
    --to=arw@arw.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spjsschl@stud.informatik.uni-erlangen.de \
    /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).