login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
March
»
19
Re: [PATCH] signals: check_kill_permission: check session under tasklist_lock
view
thread
Score:
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Atsushi Tsuji <a-tsuji@...>
To: Oleg Nesterov <oleg@...>
Cc: Andrew Morton <akpm@...>, Roland McGrath <roland@...>, Eric W. Biederman <ebiederm@...>, Davide Libenzi <davidel@...>, Ingo Molnar <mingo@...>, Jiri Kosina <jkosina@...>, Linus Torvalds <torvalds@...>, Pavel Emelyanov <xemul@...>, <linux-kernel@...>, Serge Hallyn <serge@...>
Subject:
Re: [PATCH] signals: check_kill_permission: check session under tasklist_lock
Date: Tuesday, March 18, 2008 - 10:19 pm
Oleg Nesterov wrote:
quoted text
> (on top of signals-cleanup-security_task_kill-usage-implementation.patch) > > This wasn't documented, but as Atsushi Tsuji <a-tsuji@bk.jp.nec.com> pointed > out check_kill_permission() needs tasklist_lock for task_session_nr(). > I missed this fact when removed tasklist from the callers. > > Change check_kill_permission() to take tasklist_lock for the SIGCONT case. > Re-order security checks so that we take tasklist_lock only if/when it is > actually needed. This is a minimal fix for now, tasklist will be removed > later.
Thanks, I confirmed the problem is fixed by this patch.
quoted text
> > Also change the code to use task_session() instead of task_session_nr(). > > Also, remove the SIGCONT check from cap_task_kill(), it is bogus (and the > whole function is bogus. Serge, Eric, why it is still alive?). > > Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Atsushi Tsuji <a-tsuji@bk.jp.nec.com>
quoted text
> > --- 25/kernel/signal.c~CKP_TAKE_TASKLIST 2008-03-18 14:47:00.000000000 +0300 > +++ 25/kernel/signal.c 2008-03-18 17:25:19.000000000 +0300 > @@ -533,6 +533,7 @@ static int rm_from_queue(unsigned long m > static int check_kill_permission(int sig, struct siginfo *info, > struct task_struct *t) > { > + struct pid *sid; > int error; > > if (!valid_signal(sig)) > @@ -545,11 +546,24 @@ static int check_kill_permission(int sig > if (error) > return error; > > - if (((sig != SIGCONT) || (task_session_nr(current) != task_session_nr(t))) > - && (current->euid ^ t->suid) && (current->euid ^ t->uid) > - && (current->uid ^ t->suid) && (current->uid ^ t->uid) > - && !capable(CAP_KILL)) > - return -EPERM; > + if ((current->euid ^ t->suid) && (current->euid ^ t->uid) && > + (current->uid ^ t->suid) && (current->uid ^ t->uid) && > + !capable(CAP_KILL)) { > + switch (sig) { > + case SIGCONT: > + read_lock(&tasklist_lock); > + sid = task_session(t); > + read_unlock(&tasklist_lock); > + /* > + * We don't return the error if sid == NULL. The > + * task was unhashed, the caller must notice this. > + */ > + if (!sid || sid == task_session(current)) > + break; > + default: > + return -EPERM; > + } > + } > > return security_task_kill(t, info, sig, 0); > } > --- 25/security/commoncap.c~CKP_TAKE_TASKLIST 2008-03-18 17:07:02.000000000 +0300 > +++ 25/security/commoncap.c 2008-03-18 17:21:10.000000000 +0300 > @@ -552,10 +552,6 @@ int cap_task_kill(struct task_struct *p, > if (p->uid == current->uid) > return 0; > > - /* sigcont is permitted within same session */ > - if (sig == SIGCONT && (task_session_nr(current) == task_session_nr(p))) > - return 0; > - > if (secid) > /* > * Signal sent as a particular user.
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[RFC,PATCH 2/2] kill_pid_info: don't take now unneeded taskl...
, Oleg Nesterov
, (Tue Mar 4, 2:57 pm)
Re: [RFC,PATCH 2/2] kill_pid_info: don't take now unneeded t...
, Atsushi Tsuji
, (Mon Mar 17, 7:30 am)
Re: [RFC,PATCH 2/2] kill_pid_info: don't take now unneeded t...
, Oleg Nesterov
, (Mon Mar 17, 1:01 pm)
[PATCH] signals: check_kill_permission: check session under ...
, Oleg Nesterov
, (Tue Mar 18, 10:44 am)
Re: [PATCH] signals: check_kill_permission: check session un...
, Atsushi Tsuji
, (Tue Mar 18, 10:19 pm)
Re: [PATCH] signals: check_kill_permission: check session un...
,
, (Tue Mar 18, 4:03 pm)
Re: [PATCH] signals: check_kill_permission: check session un...
, Oleg Nesterov
, (Tue Mar 18, 4:17 pm)
Re: [PATCH] signals: check_kill_permission: check session un...
,
, (Tue Mar 18, 7:14 pm)
Re: [RFC,PATCH 2/2] kill_pid_info: don't take now unneeded t...
, Roland McGrath
, (Thu Mar 6, 6:56 am)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-btrfs
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-ia64
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-kvm
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
reiserfs-devel
tux3
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Lee Revell
Re: [RFC][PATCH] cpuidle: avoid singing capacitors
Ingo Molnar
[bug] latest -git boot hang
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Christoph Hellwig
Re: 2.6.24-rc6-mm1
git
:
Imran M Yousuf
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Dan Zwell
[PATCH] Color support added to git-add--interactive.
Kyle Moffett
Using GIT to store /etc (Or: How to make GIT store all file permission bits)
Petr Vandrovec
Re: Fwd: [OT] Re: Git via a proxy server?
openbsd-misc
:
Lars Hansson
Re: Code signing in OpenBSD
Richard Stallman
Real men don't attack straw men
Pau
acer aspire one dmesg?
Henning Brauer
Re: About Xen: maybe a reiterative question but ..
linux-netdev
:
Jarek Poplawski
Re: loaded router, excessive getnstimeofday in oprofile
Julius Volz
[PATCH RFC 20/24] IPVS: Add validity checks when adding/editing v6 services
Bruno
[PATCH 1/2] r8169: WoL fixes
Corey Hickey
[PATCH 01/10] Preparatory refactoring part 1.
Latest forum posts
high memory
1 day ago
Linux kernel
semaphore access speed
1 day ago
Applications and Utilities
the kernel how to power off the machine
1 day ago
Linux kernel
Easter Eggs in windows XP
1 day ago
Windows
Shared swap partition
1 day ago
Linux general
Root password
1 day ago
Linux general
Where/when DNOTIFY is used?
1 day ago
Linux kernel
How to convert Linux Kernel built-in module into a loadable module
1 day ago
Linux kernel
Linux 2.6.24 and I/O schedulers
1 day ago
Linux kernel
USB Driver -- Interrupt Polling -- A Little Help Please
1 day ago
Linux general
Show all forums...
Recent Tags
Linus Torvalds
-rc8
Linux
quote
Intel
2.6.27-rc8
2.6.27
bugs
-rc
more tags
Colocation donated by:
Who's online
There are currently
2 users
and
1131 guests
online.
Online users
Mr_Z
strcmp
Syndicate
speck-geostationary