login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
30
Re: [PATCH RFC] pid: make setpgid() system call use RCU read-side critical section
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Paul E. McKenney
Subject:
Re: [PATCH RFC] pid: make setpgid() system call use RCU read-side critical section
Date: Monday, August 30, 2010 - 1:32 pm
On Mon, Aug 30, 2010 at 09:51:07PM +0200, Jiri Slaby wrote:
quoted text
> Ccing Oleg. > > On 08/30/2010 07:26 PM, Paul E. McKenney wrote: > > [ 23.584720] =================================================== > > [ 23.585059] [ INFO: suspicious rcu_dereference_check() usage. ] > > [ 23.585176] --------------------------------------------------- > > [ 23.585176] kernel/pid.c:419 invoked rcu_dereference_check() without protection! > > [ 23.585176] > > [ 23.585176] other info that might help us debug this: > > [ 23.585176] > > [ 23.585176] > > [ 23.585176] rcu_scheduler_active = 1, debug_locks = 1 > > [ 23.585176] 1 lock held by rc.sysinit/728: > > [ 23.585176] #0: (tasklist_lock){.+.+..}, at: [<ffffffff8104771f>] sys_setpgid+0x5f/0x193 > > [ 23.585176] > > [ 23.585176] stack backtrace: > > [ 23.585176] Pid: 728, comm: rc.sysinit Not tainted 2.6.36-rc2 #2 > > [ 23.585176] Call Trace: > > [ 23.585176] [<ffffffff8105b436>] lockdep_rcu_dereference+0x99/0xa2 > > [ 23.585176] [<ffffffff8104c324>] find_task_by_pid_ns+0x50/0x6a > > [ 23.585176] [<ffffffff8104c35b>] find_task_by_vpid+0x1d/0x1f > > [ 23.585176] [<ffffffff81047727>] sys_setpgid+0x67/0x193 > > [ 23.585176] [<ffffffff810029eb>] system_call_fastpath+0x16/0x1b > > [ 24.959669] type=1400 audit(1282938522.956:4): avc: denied { module_request } for pid=766 comm="hwclock" kmod="char-major-10-135" scontext=system_u:system_r:hwclock_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclas > > > > It turns out that the setpgid() system call fails to enter an RCU > > read-side critical section before doing a PID-to-task_struct translation. > > This commit therefore does rcu_read_lock() before the translation, and > > also does rcu_read_unlock() after the last use of the returned pointer. > > > > Located-by: Andrew Morton <akpm@linux-foundation.org> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > > --- > > > > sys.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/kernel/sys.c b/kernel/sys.c > > index e9ad444..05a4b0c 100644 > > --- a/kernel/sys.c > > +++ b/kernel/sys.c > > @@ -938,6 +938,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) > > write_lock_irq(&tasklist_lock); > > > > err = -ESRCH; > > + rcu_read_lock(); > > p = find_task_by_vpid(pid); > > AFAICT the missing lock doesn't harm due to the write_lock of tasklist > above. But is probably a good thing to do anyway.
Or we can add the tasklist lock to the rcu_dereference_check() condition. Thanx, Paul
quoted text
> regards, > -- > js > suse labs > -- > 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/
--
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:
[PATCH RFC] pid: make setpgid() system call use RCU read-s ...
, Paul E. McKenney
, (Mon Aug 30, 10:26 am)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, Jiri Slaby
, (Mon Aug 30, 12:51 pm)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, Paul E. McKenney
, (Mon Aug 30, 1:32 pm)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, David Howells
, (Tue Aug 31, 6:02 am)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, Paul E. McKenney
, (Tue Aug 31, 8:12 am)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, David Howells
, (Tue Aug 31, 8:31 am)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, Oleg Nesterov
, (Thu Sep 9, 3:15 pm)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, Jiri Slaby
, (Thu Sep 16, 2:18 am)
Re: [PATCH RFC] pid: make setpgid() system call use RCU re ...
, Oleg Nesterov
, (Thu Sep 16, 9:39 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Mr. James W. Laferriere
Re: Linux 2.6.25-rc1 , syntax error near unexpected token `;'
Robin Lee Powell
NFS hang + umount -f: better behaviour requested.
Linus Torvalds
Linux 2.6.34-rc4
Colin Cross
[PATCH 12/21] ARM: tegra: Add suspend and hotplug support
git
:
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
Wink Saville
How-to combine several separate git repos?
Emily Ren
How to pull remote branch with specified commit id?
Denis Bueno
Git clone error
pradeep singh
git-update-server-info may be required,cannot clone and pull from a remote reposit...
openbsd-misc
:
Sevan / Venture37
Re: This is what Linus Torvalds calls openBSD crowd
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Siju George
This is what Linus Torvalds calls openBSD crowd
Darrin Chandler
Re: OT: Python (was Re: vi in /bin)
frantisek holop
Re: splassert: vwakeup: and friends
linux-netdev
:
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
Timo Teräs
ip xfrm policy semantics
Ron Mercer
[net-next PATCH 2/2] qlge: Version change to v1.00.00.27
Maciej W. Rozycki
Re: [PATCH] flush_work_sync vs. flush_scheduled_work Re: [PATCH] PHYLIB: IRQ event...
Jarek Poplawski
Re: socket api problem: can't bind an ipv6 socket to ::ffff:0.0.0.0
git-commits-head
:
Linux Kernel Mailing List
powerpc/fsl_msi: enable msi allocation in all banks
Linux Kernel Mailing List
ASoC: fix registration of the SoC card in the Freescale MPC8610 drivers
Linux Kernel Mailing List
drivers/acpi: use kasprintf
Linux Kernel Mailing List
bnx2x: Moving includes
Linux Kernel Mailing List
[ARM] mmp: add dma support to mmp2
Colocation donated by:
Syndicate