Thomas Gleixner
d0725992c8
futex: Fix the write access fault problem for real
...
commit 64d1304a64 (futex: setup writeable mapping for futex ops which
modify user space data) did address only half of the problem of write
access faults.
The patch was made on two wrong assumptions:
1) access_ok(VERIFY_WRITE,...) would actually check write access.
On x86 it does _NOT_. It's a pure address range check.
2) a RW mapped region can not go away under us.
That's wrong as well. Nobody can prevent another thread to call
mprotect(PROT_READ) on that region where the futex resides. If that
call hits between the get_user_pages_fast() verification and the
actual write access in the atomic region we are toast again.
The solution is to not rely on access_ok and get_user() for any write
access related fault on private and shared futexes. Instead we need to
fault it in with verification of write access.
There is no generic non destructive write mechanism which would fault
the user page in trough a #PF, but as we already know that we will
fault we can as well call get_user_pages() directly and avoid the #PF
overhead.
If get_user_pages() returns -EFAULT we know that we can not fix it
anymore and need to bail out to user space.
Remove a bunch of confusing comments on this issue as well.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org
2009-06-24 21:27:35 +02:00
..
gcov
gcov: enable GCOV_PROFILE_ALL for x86_64
2009-06-18 13:03:58 -07:00
irq
Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-06-20 11:30:01 -07:00
power
mm, PM/Freezer: Disable OOM killer when tasks are frozen
2009-06-16 19:47:40 -07:00
time
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-06-20 10:51:44 -07:00
trace
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-06-20 10:56:46 -07:00
.gitignore
acct.c
async.c
async: Fix lack of boot-time console due to insufficient synchronization
2009-06-08 12:31:53 -07:00
audit.c
Fix rule eviction order for AUDIT_DIR
2009-06-24 00:02:38 -04:00
audit.h
Fix rule eviction order for AUDIT_DIR
2009-06-24 00:02:38 -04:00
audit_tree.c
Fix rule eviction order for AUDIT_DIR
2009-06-24 00:02:38 -04:00
audit_watch.c
Audit: clean up all op= output to include string quoting
2009-06-24 00:00:52 -04:00
auditfilter.c
Audit: clean up all op= output to include string quoting
2009-06-24 00:00:52 -04:00
auditsc.c
Fix rule eviction order for AUDIT_DIR
2009-06-24 00:02:38 -04:00
backtracetest.c
bounds.c
capability.c
cgroup.c
cgroups: forbid noprefix if mounting more than just cpuset subsystem
2009-06-18 13:03:46 -07:00
cgroup_debug.c
debug cgroup: remove unneeded cgroup_lock
2009-04-02 19:04:54 -07:00
cgroup_freezer.c
compat.c
signals: implement sys_rt_tgsigqueueinfo
2009-04-30 19:24:24 +02:00
configs.c
cpu.c
mm/init: cpu_hotplug_init() must be initialized before SLAB
2009-06-22 21:18:12 -07:00
cpuset.c
cpuset,mm: update tasks' mems_allowed in time
2009-06-16 19:47:31 -07:00
cred-internals.h
cred.c
CRED: Rename cred_exec_mutex to reflect that it's a guard against ptrace
2009-05-11 08:15:36 +10:00
delayacct.c
dma-coherent.c
dma.c
exec_domain.c
Get rid of indirect include of fs_struct.h
2009-03-31 23:00:27 -04:00
exit.c
ptrace: wait_task_zombie: do not account traced sub-threads
2009-06-19 16:46:06 -07:00
extable.c
Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-04-05 11:04:19 -07:00
fork.c
copy_process(): remove the unneeded clear_tsk_thread_flag(TIF_SIGPENDING)
2009-06-18 13:03:52 -07:00
freezer.c
futex.c
futex: Fix the write access fault problem for real
2009-06-24 21:27:35 +02:00
futex_compat.c
groups.c
groups: move code to kernel/groups.c
2009-06-16 19:47:48 -07:00
hrtimer.c
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
2009-06-17 09:46:33 -07:00
hung_task.c
itimer.c
kallsyms.c
kernel/kallsyms.c: replace deprecated __initcall with device_initcall and fix whitespace
2009-06-09 22:37:52 +02:00
Kconfig.freezer
Kconfig.hz
Kconfig.preempt
kexec.c
PM core: rename suspend and resume functions
2009-06-12 21:32:31 +02:00
kfifo.c
kernel/kfifo.c: replace conditional test with is_power_of_2()
2009-06-16 19:47:47 -07:00
kgdb.c
sysrq, intel_fb: fix sysrq g collision
2009-05-15 07:56:24 -05:00
kmod.c
kmod: Release sub_info on cred allocation failure.
2009-05-26 12:11:19 -07:00
kprobes.c
kprobes: fix to use text_mutex around arm/disarm kprobe
2009-05-08 16:23:48 -07:00
ksysfs.c
kthread.c
kthreads: rework kthread_stop()
2009-06-18 13:03:54 -07:00
latencytop.c
lockdep.c
Merge branch 'linus' into tracing/core
2009-05-07 11:17:34 +02:00
lockdep_internals.h
lockdep: increase MAX_LOCKDEP_ENTRIES and MAX_LOCKDEP_CHAINS
2009-05-12 19:59:52 +02:00
lockdep_proc.c
lockdep_states.h
Makefile
audit: seperate audit inode watches into a subfile
2009-06-23 23:50:59 -04:00
marker.c
module.c
kernel: constructor support
2009-06-18 13:03:57 -07:00
mutex-debug.c
mutex-debug.h
mutex.c
Merge branch 'linus' into perfcounters/core
2009-06-11 17:55:42 +02:00
mutex.h
notifier.c
ns_cgroup.c
cgroups: relax ns_can_attach checks to allow attaching to grandchild cgroups
2009-04-02 19:04:53 -07:00
nsproxy.c
nsproxy: extract create_nsproxy()
2009-06-18 13:03:56 -07:00
panic.c
Fix caller information for warn_slowpath_null
2009-05-16 13:41:28 -07:00
params.c
module_param: allow 'bool' module_params to be bool, not just int.
2009-06-12 21:46:58 +09:30
perf_counter.c
perf_counter: Push perf_sample_data through the swcounter code
2009-06-20 12:30:30 +02:00
pid.c
pids: clean up find_task_by_pid variants
2009-06-18 13:03:55 -07:00
pid_namespace.c
pidns: rewrite copy_pid_ns()
2009-06-18 13:03:55 -07:00
pm_qos_params.c
posix-cpu-timers.c
kernel/posix-cpu-timers.c: fix sparse warning
2009-04-30 08:08:31 +02:00
posix-timers.c
printk.c
printk: Add KERN_DEFAULT printk log-level
2009-06-16 11:02:28 -07:00
profile.c
page allocator: do not check NUMA node ID when the caller knows the node is valid
2009-06-16 19:47:32 -07:00
ptrace.c
ptrace: don't take tasklist to get/set ->last_siginfo
2009-06-18 13:03:52 -07:00
rcuclassic.c
kmemtrace, rcu: fix linux/rcutree.h and linux/rcuclassic.h dependencies
2009-04-03 12:23:02 +02:00
rcupdate.c
RCU: Don't try and predeclare inline funcs as it upsets some versions of gcc
2009-04-15 13:55:14 -07:00
rcupreempt.c
rcu: rcu_sched_grace_period(): kill the bogus flush_signals()
2009-05-05 20:28:05 +02:00
rcupreempt_trace.c
rcutorture.c
cpumask: convert rcutorture.c
2009-03-30 22:05:16 +10:30
rcutree.c
rcu: Add __rcu_pending tracing to hierarchical RCU
2009-04-14 11:33:43 +02:00
rcutree.h
kmemtrace, rcu: fix rcu_tree_trace.c data structure dependencies
2009-04-03 12:23:03 +02:00
rcutree_trace.c
rcu: Add __rcu_pending tracing to hierarchical RCU
2009-04-14 11:33:43 +02:00
relay.c
Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-04-05 11:04:19 -07:00
res_counter.c
memcg: add interface to reset limits
2009-06-18 13:03:48 -07:00
resource.c
Remove 'recurse into child resources' logic from 'reserve_region_with_split()'
2009-04-18 21:44:24 -07:00
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
trivial: fix ETIMEOUT -> ETIMEDOUT typos
2009-06-12 18:01:50 +02:00
rtmutex.h
rtmutex_common.h
rt_mutex: add proxy lock routines
2009-04-06 11:14:02 +02:00
rwsem.c
sched.c
Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-06-20 11:29:32 -07:00
sched_clock.c
sched: Fix fallback sched_clock()'s offset when using jiffies
2009-05-09 10:08:19 +02:00
sched_cpupri.c
sched: Remove unneeded __ref tag
2009-06-17 16:08:04 +02:00
sched_cpupri.h
cpumask: remove cpumask_t from core
2009-03-30 22:05:17 +10:30
sched_debug.c
sched: Hide runqueues from direct refer at source code level
2009-06-17 18:29:42 +02:00
sched_fair.c
sched: Fix out of scope variable access in sched_slice()
2009-06-17 18:37:54 +02:00
sched_features.h
Merge branch 'locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-03-30 17:17:35 -07:00
sched_idletask.c
sched, timers: move calc_load() to scheduler
2009-05-15 15:32:45 +02:00
sched_rt.c
cpumask: alloc zeroed cpumask for static cpumask_var_ts
2009-06-09 22:30:27 +09:30
sched_stats.h
sched: remove unused fields from struct rq
2009-03-24 23:16:51 +01:00
seccomp.c
semaphore.c
signal.c
ptrace: do_notify_parent_cldstop: fix the wrong ->nsproxy usage
2009-06-18 13:03:52 -07:00
slow-work.c
slow-work: use round_jiffies() for thread pool's cull and OOM timers
2009-06-16 19:47:49 -07:00
smp.c
cpumask: alloc zeroed cpumask for static cpumask_var_ts
2009-06-09 22:30:27 +09:30
softirq.c
softirq: introduce statistics for softirq
2009-06-18 13:03:40 -07:00
softlockup.c
spinlock.c
Allow rwlocks to re-enable interrupts
2009-04-02 19:05:11 -07:00
srcu.c
stacktrace.c
stop_machine.c
cpumask: remove cpumask_t from core
2009-03-30 22:05:17 +10:30
sys.c
groups: move code to kernel/groups.c
2009-06-16 19:47:48 -07:00
sys_ni.c
sysctl.c
sysctl.c: remove unused variable
2009-06-18 13:03:54 -07:00
sysctl_check.c
taskstats.c
test_kprobes.c
time.c
timeconst.pl
timer.c
Merge branch 'timers-for-linus-migration' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2009-06-15 10:06:19 -07:00
tracepoint.c
tsacct.c
uid16.c
up.c
user.c
sched: delayed cleanup of user_struct
2009-06-15 21:30:23 -07:00
user_namespace.c
utsname.c
utsns: extract creeate_uts_ns()
2009-06-18 13:03:55 -07:00
utsname_sysctl.c
proc_sysctl: use CONFIG_PROC_SYSCTL around ipc and utsname proc_handlers
2009-04-02 19:05:01 -07:00
wait.c
wait: don't use __wake_up_common()
2009-04-14 17:17:16 +02:00
workqueue.c
ftrace, workqueuetrace: make workqueue tracepoints use TRACE_EVENT macro
2009-06-02 01:10:40 +02:00