linux/kernel
Serge E. Hallyn 02fdb36ae7 ipc: sysvsem: refuse clone(CLONE_SYSVSEM|CLONE_NEWIPC)
CLONE_NEWIPC|CLONE_SYSVSEM interaction isn't handled properly.  This can cause
a kernel memory corruption.  CLONE_NEWIPC must detach from the existing undo
lists.

Fix, part 3: refuse clone(CLONE_SYSVSEM|CLONE_NEWIPC).

With unshare, specifying CLONE_SYSVSEM means unshare the sysvsem.  So it seems
reasonable that CLONE_NEWIPC without CLONE_SYSVSEM would just imply
CLONE_SYSVSEM.

However with clone, specifying CLONE_SYSVSEM means *share* the sysvsem.  So
calling clone(CLONE_SYSVSEM|CLONE_NEWIPC) is explicitly asking for something
we can't allow.  So return -EINVAL in that case.

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Cc: Pierre Peiffer <peifferp@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:14 -07:00
..
irq kernel: explicitly include required header files under kernel/ 2008-04-29 08:06:04 -07:00
power PM/gxfb: add hook to PM console layer that allows disabling of suspend VT switch 2008-04-28 08:58:36 -07:00
time softlockup: fix NOHZ wakeup 2008-04-25 00:25:08 +02:00
.gitignore
acct.c
audit_tree.c
audit.c Audit: internally use the new LSM audit hooks 2008-04-19 09:52:37 +10:00
audit.h SELinux: use new audit hooks, remove redundant exports 2008-04-19 09:53:46 +10:00
auditfilter.c Audit: Final renamings and cleanup 2008-04-19 09:59:43 +10:00
auditsc.c Audit: Final renamings and cleanup 2008-04-19 09:59:43 +10:00
backtracetest.c
bounds.c mm: Get rid of __ZONE_COUNT 2008-04-28 08:58:22 -07:00
capability.c
cgroup_debug.c CGroup API files: move "releasable" to cgroup_debug subsystem 2008-04-29 08:06:09 -07:00
cgroup.c cgroups: add an owner to the mm_struct 2008-04-29 08:06:10 -07:00
compat.c generic: reduce stack pressure in sched_affinity 2008-04-19 19:44:59 +02:00
configs.c
cpu.c simplify cpu_hotplug_begin()/put_online_cpus() 2008-04-29 08:06:11 -07:00
cpuset.c Cpuset hardwall flag: add a mem_hardwall flag to cpusets 2008-04-29 08:06:11 -07:00
delayacct.c
dma.c
exec_domain.c
exit.c cgroups: add an owner to the mm_struct 2008-04-29 08:06:10 -07:00
extable.c
fork.c ipc: sysvsem: force unshare(CLONE_SYSVSEM) when CLONE_NEWIPC 2008-04-29 08:06:14 -07:00
futex_compat.c
futex.c
hrtimer.c hrtimer: raise softirq unlocked to avoid circular lock dependency 2008-04-28 22:22:21 +02:00
itimer.c
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c vmcoreinfo: add page flags values 2008-04-28 08:58:23 -07:00
kfifo.c
kgdb.c kgdb: always use icache flush for sw breakpoints 2008-04-17 20:05:43 +02:00
kmod.c generic: use new set_cpus_allowed_ptr function 2008-04-19 19:44:58 +02:00
kprobes.c kprobes: add (un)register_jprobes for batch registration 2008-04-28 08:58:32 -07:00
ksysfs.c
kthread.c kthread: call wake_up_process() without the lock being held 2008-04-29 08:06:04 -07:00
latencytop.c latencytop: optimize LT_BACKTRACEDEPTH loops a bit 2008-04-19 19:44:57 +02:00
lockdep_internals.h
lockdep_proc.c
lockdep.c
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb 2008-04-18 08:37:01 -07:00
marker.c kernel: explicitly include required header files under kernel/ 2008-04-29 08:06:04 -07:00
module.c kernel: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:17:04 -04:00
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
notifier.c ipc: re-enable msgmni automatic recomputing msgmni if set to negative 2008-04-29 08:06:13 -07:00
ns_cgroup.c cgroups: kernel/ns_cgroup.c should #include <linux/nsproxy.h> 2008-04-29 08:06:07 -07:00
nsproxy.c ipc: sysvsem: refuse clone(CLONE_SYSVSEM|CLONE_NEWIPC) 2008-04-29 08:06:14 -07:00
panic.c Taint kernel after WARN_ON(condition) 2008-04-29 08:05:59 -07:00
params.c
pid_namespace.c kernel: fix integer as NULL pointer warnings 2008-04-28 17:29:18 -07:00
pid.c
pm_qos_params.c
posix-cpu-timers.c posix-timers: fix shadowed variables 2008-04-17 12:22:30 +02:00
posix-timers.c kernel: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:17:04 -04:00
printk.c isolate ratelimit from printk.c for other use 2008-04-29 08:06:06 -07:00
profile.c kernel: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:17:04 -04:00
ptrace.c ptrace: conditionalize compat_ptrace_request 2008-04-28 14:14:36 -07:00
rcuclassic.c
rcupdate.c
rcupreempt_trace.c
rcupreempt.c generic: reduce stack pressure in sched_affinity 2008-04-19 19:44:59 +02:00
rcutorture.c kernel: explicitly include required header files under kernel/ 2008-04-29 08:06:04 -07:00
relay.c
res_counter.c memcgroup: add the max_usage member on the res_counter 2008-04-29 08:06:10 -07:00
resource.c PCI: clean up resource alignment management 2008-04-20 21:47:08 -07:00
rtmutex_common.h
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
rtmutex.h
rwsem.c
sched_debug.c sched: build fix 2008-04-19 19:45:01 +02:00
sched_fair.c sched: debug: show a weight tree 2008-04-19 19:45:00 +02:00
sched_features.h sched: /debug/sched_features 2008-04-19 19:45:00 +02:00
sched_idletask.c
sched_rt.c sched: rt-group: optimize dequeue_rt_stack 2008-04-19 19:45:00 +02:00
sched_stats.h cpumask: use new cpus_scnprintf function 2008-04-19 19:44:59 +02:00
sched.c CGroups _s64 files: use read_s64/write_s64 in CFS cgroup for rt_runtime file 2008-04-29 08:06:09 -07:00
seccomp.c
semaphore.c Improve semaphore documentation 2008-04-17 10:43:01 -04:00
signal.c trivial: small cleanups 2008-04-21 22:15:06 +00:00
softirq.c tasklets: execute tasklets in the same order they were queued 2008-04-19 19:44:58 +02:00
softlockup.c
spinlock.c
srcu.c
stacktrace.c
stop_machine.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial 2008-04-21 16:36:46 -07:00
sys_ni.c
sys.c add RUSAGE_THREAD 2008-04-29 08:05:59 -07:00
sysctl_check.c
sysctl.c sched: rt-group: synchonised bandwidth period 2008-04-19 19:44:57 +02:00
taskstats.c
test_kprobes.c
time.c kernel: explicitly include required header files under kernel/ 2008-04-29 08:06:04 -07:00
timeconst.pl
timer.c timers: simplify lockdep handling 2008-04-17 12:22:31 +02:00
tsacct.c
uid16.c asmlinkage_protect replaces prevent_tail_call 2008-04-10 17:28:26 -07:00
user_namespace.c eCryptfs: make key module subsystem respect namespaces 2008-04-29 08:06:07 -07:00
user.c sched: fix the task_group hierarchy for UID grouping 2008-04-19 19:45:00 +02:00
utsname_sysctl.c
utsname.c kernel: explicitly include required header files under kernel/ 2008-04-29 08:06:04 -07:00
wait.c
workqueue.c cleanup_workqueue_thread: remove the unneeded "cpu" parameter 2008-04-29 08:06:11 -07:00