/* * Copyright 2008 Vitaly Mayatskikh * Copyright 2002 Andi Kleen, SuSE Labs. * Subject to the GNU Public License v2. * * Functions to copy from and to user space. */ #include #include #define FIX_ALIGNMENT 1 #include #include #include .macro ALIGN_DESTINATION #ifdef FIX_ALIGNMENT /* check for bad alignment of destination */ movl %edi,%ecx andl $7,%ecx jz 102f /* already aligned */ subl $8,%ecx negl %ecx subl %ecx,%edx 100: movb (%rsi),%al 101: movb %al,(%rdi) incq %rsi incq %rdi decl %ecx jnz 100b 102: .section .fixup,"ax" 103: addl %ecx,%edx /* ecx is zerorest also */ jmp copy_user_handle_tail .previous .section __ex_table,"a" .align 8 .quad 100b,103b .quad 101b,103b .previous #endif .endm /* * copy_user_nocache - Uncached memory copy with exception handling * This will force destination/source out of cache for more performance. */ ENTRY(__copy_user_nocache) CFI_STARTPROC cmpl $8,%edx jb 20f /* less then 8 bytes, go to byte copy loop */ ALIGN_DESTINATION movl %edx,%ecx andl $63,%edx shrl $6,%ecx jz 17f 1: movq (%rsi),%r8 2: movq 1*8(%rsi),%r9 3: movq 2*8(%rsi),%r10 4: movq 3*8(%rsi),%r11 5: movnti %r8,(%rdi) 6: movnti %r9,1*8(%rdi) 7: movnti %r10,2*8(%rdi) 8: movnti %r11,3*8(%rdi) 9: movq 4*8(%rsi),%r8 10: movq 5*8(%rsi),%r9 11: movq 6*8(%rsi),%r10 12: movq 7*8(%rsi),%r11 13: movnti %r8,4*8(%rdi) 14: movnti %r9,5*8(%rdi) 15: movnti %r10,6*8(%rdi) 16: movnti %r11,7*8(%rdi) leaq 64(%rsi),%rsi leaq 64(%rdi),%rdi decl %ecx jnz 1b 17: movl %edx,%ecx andl $7,%edx shrl $3,%ecx jz 20f 18: movq (%rsi),%r8 19: movnti %r8,(%rdi) leaq 8(%rsi),%rsi leaq 8(%rdi),%rdi decl %ecx jnz 18b 20: andl %edx,%edx jz 23f movl %edx,%ecx 21: movb (%rsi),%al 22: movb %al,(%rdi) incq %rsi incq %rdi decl %ecx jnz 21b 23: xorl %eax,%eax sfence ret .section .fixup,"ax" 30: shll $6,%ecx addl %ecx,%edx jmp 60f 40: lea (%rdx,%rcx,8),%rdx jmp 60f 50: movl %ecx,%edx 60: sfence jmp copy_user_handle_tail .previous .section __ex_table,"a" .quad 1b,30b .quad 2b,30b .quad 3b,30b .quad 4b,30b .quad 5b,30b .quad 6b,30b .quad 7b,30b .quad 8b,30b .quad 9b,30b .quad 10b,30b .quad 11b,30b .quad 12b,30b .quad 13b,30b .quad 14b,30b .quad 15b,30b .quad 16b,30b .quad 18b,40b .quad 19b,40b .quad 21b,50b .quad 22b,50b .previous CFI_ENDPROC ENDPROC(__copy_user_nocache) og/security?id=9deb343189b3cf45e84dd08480f330575ffe2004'>security/security.c
AgeCommit message (Expand)AuthorFilesLines
2010-03-01Merge branch 'next' into for-linusJames Morris1-21/+28
2010-02-24Security: add static to security_ops and default_security_ops variablewzt.wzt@gmail.com1-2/+9
2010-02-07Take ima_file_free() to proper place.Al Viro1-2/+0
2010-02-04syslog: distinguish between /proc/kmsg and syscallsKees Cook1-2/+2
2010-01-15security: correct error returns for get/set security with private inodesJames Morris1-2/+2
2009-12-08LSM: Rename security_path_ functions argument names.Tetsuo Handa1-15/+15
2009-11-10security: report the module name to security_module_requestEric Paris1-2/+2
2009-11-09Config option to set a default LSMJohn Johansen1-3/+6
2009-10-25LSM: imbed ima calls in the security hooksMimi Zohar1-3/+25
2009-10-12LSM: Add security_path_chroot().Tetsuo Handa1-0/+5
2009-10-12LSM: Add security_path_chmod() and security_path_chown().Tetsuo Handa1-0/+15
2009-09-10LSM/SELinux: inode_{get,set,notify}secctx hooks to access LSM security contex...David P. Quigley1-0/+18
2009-09-02KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]David Howells1-0/+17
2009-09-01lsm: Add hooks to the TUN driverPaul Moore1-0/+18
2009-08-14security: introducing security_request_moduleEric Paris1-0/+5
2009-06-25security: rename ptrace_may_access => ptrace_access_checkIngo Molnar1-2/+2
2009-06-04security: use mmap_min_addr indepedently of security modelsChristoph Lameter1-3/+0
2009-04-03CacheFiles: Export things for CacheFilesDavid Howells1-0/+2
2009-03-28lsm: Remove the socket_post_accept() hookPaul Moore1-5/+0
2009-01-07Merge branch 'next' into for-linusJames Morris1-4/+22
2009-01-07CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #3]David Howells1-4/+22
2009-01-07Revert "CRED: Fix regression in cap_capable() as shown up by sys_faccessat() ...James Morris1-21/+4
2009-01-05CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #2]David Howells1-4/+21
2008-12-31introduce new LSM hooks where vfsmount is available.Kentaro Takeda1-0/+66
2008-12-20security: pass mount flags to security_sb_kern_mount()James Morris1-2/+2
2008-11-25CRED: fix sparse warningsHannes Eder1-3/+3
2008-11-14CRED: Allow kernel services to override LSM settings for task actionsDavid Howells1-0/+10
2008-11-14CRED: Make execve() take advantage of copy-on-write credentialsDavid Howells1-18/+8
2008-11-14CRED: Inaugurate COW credentialsDavid Howells1-31/+27
2008-11-14CRED: Pass credentials through dentry_open()David Howells1-2/+2
2008-11-14CRED: Detach the credentials from task_structDavid Howells1-4/+4
2008-11-14CRED: Constify the kernel_cap_t arguments to the capset LSM hooksDavid Howells1-6/+6
2008-11-14CRED: Neuter sys_capset()David Howells1-10/+8
2008-11-11Add a new capable interface that will be used by systems that use audit toEric Paris1-1/+6
2008-10-30nfsd: fix vm overcommit crashAlan Cox1-0/+9
2008-08-28Merge branch 'master' into nextJames Morris1-3/+7
2008-08-20security: add/fix security kernel-docRandy Dunlap1-4/+4
2008-08-14security: Fix setting of PF_SUPERPRIV by __capable()David Howells1-3/+7
2008-07-26[patch 3/4] fat: dont call notify_changeMiklos Szeredi1-0/+1
2008-07-26[PATCH] pass MAY_OPEN to vfs_permission() explicitlyAl Viro1-2/+2