aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/um/kernel/physmem.c
diff options
context:
space:
mode:
authorAnton Ivanov <antivano@cisco.com>2014-03-07 18:37:47 +0000
committerRichard Weinberger <richard@nod.at>2014-04-20 23:57:21 +0200
commit0565103d1adbd765ca45248d04c327c076dd1571 (patch)
treebc72dc69499b068766284276bee91884afb1218b /arch/um/kernel/physmem.c
parentum: Missing pipe handling (diff)
downloadwireguard-linux-0565103d1adbd765ca45248d04c327c076dd1571.tar.xz
wireguard-linux-0565103d1adbd765ca45248d04c327c076dd1571.zip
um: Memory corruption on startup
The reverse case of this race (you must msync before read) is well known. This is the not so common one. It can be triggered only on systems which do a lot of task switching and only at UML startup. If you are starting 200+ UMLs ~ 0.5% will always die without this fix. Signed-off-by: Anton Ivanov <antivano@cisco.com> [rw: minor whitespace fixes] Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/kernel/physmem.c')
-rw-r--r--arch/um/kernel/physmem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index f116db15d402..30fdd5d0067b 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -103,6 +103,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
*/
os_seek_file(physmem_fd, __pa(&__syscall_stub_start));
os_write_file(physmem_fd, &__syscall_stub_start, PAGE_SIZE);
+ os_fsync_file(physmem_fd);
bootmap_size = init_bootmem(pfn, pfn + delta);
free_bootmem(__pa(reserve_end) + bootmap_size,