mirror of
https://github.com/torvalds/linux.git
synced 2025-11-09 05:00:09 +02:00
Al Viro noticed that userspace accesses via get_user()/put_user() can be simplified a lot with regard to usage of the exception handling. This patch implements a fixup routine for get_user() and put_user() in such that the exception handler will automatically load -EFAULT into the register %r8 (the error value) in case on a fault on userspace. Additionally the fixup routine will zero the target register on fault in case of a get_user() call. The target register is extracted out of the faulting assembly instruction. This patch brings a few benefits over the old implementation: 1. Exception handling gets much cleaner, easier and smaller in size. 2. Helper functions like fixup_get_user_skip_1 (all of fixup.S) can be dropped. 3. No need to hardcode %r9 as target register for get_user() any longer. This helps the compiler register allocator and thus creates less assembler statements. 4. No dependency on the exception_data contents any longer. 5. Nested faults will be handled cleanly. Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Cc: <stable@vger.kernel.org> # v4.9+ Signed-off-by: Helge Deller <deller@gmx.de> |
||
|---|---|---|
| .. | ||
| agp.h | ||
| asm-offsets.h | ||
| asmregs.h | ||
| assembly.h | ||
| atomic.h | ||
| bitops.h | ||
| bug.h | ||
| bugs.h | ||
| cache.h | ||
| cacheflush.h | ||
| checksum.h | ||
| cmpxchg.h | ||
| compat.h | ||
| compat_ucontext.h | ||
| delay.h | ||
| dma-mapping.h | ||
| dma.h | ||
| dwarf.h | ||
| eisa_bus.h | ||
| eisa_eeprom.h | ||
| elf.h | ||
| fb.h | ||
| fixmap.h | ||
| floppy.h | ||
| ftrace.h | ||
| futex.h | ||
| grfioctl.h | ||
| hardirq.h | ||
| hardware.h | ||
| hash.h | ||
| hugetlb.h | ||
| ide.h | ||
| io.h | ||
| irq.h | ||
| irqflags.h | ||
| kbdleds.h | ||
| Kbuild | ||
| kmap_types.h | ||
| ldcw.h | ||
| led.h | ||
| linkage.h | ||
| machdep.h | ||
| mckinley.h | ||
| mmu.h | ||
| mmu_context.h | ||
| mmzone.h | ||
| module.h | ||
| page.h | ||
| parisc-device.h | ||
| parport.h | ||
| pci.h | ||
| pdc.h | ||
| pdc_chassis.h | ||
| pdcpat.h | ||
| perf.h | ||
| perf_event.h | ||
| pgalloc.h | ||
| pgtable.h | ||
| prefetch.h | ||
| processor.h | ||
| psw.h | ||
| ptrace.h | ||
| ropes.h | ||
| rt_sigframe.h | ||
| runway.h | ||
| sections.h | ||
| serial.h | ||
| shmparam.h | ||
| signal.h | ||
| smp.h | ||
| socket.h | ||
| special_insns.h | ||
| spinlock.h | ||
| spinlock_types.h | ||
| string.h | ||
| superio.h | ||
| switch_to.h | ||
| syscall.h | ||
| termios.h | ||
| thread_info.h | ||
| timex.h | ||
| tlb.h | ||
| tlbflush.h | ||
| traps.h | ||
| uaccess.h | ||
| ucontext.h | ||
| unaligned.h | ||
| unistd.h | ||
| unwind.h | ||