linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] x86: oops on uaccess faults outside of user addresses
@ 2013-05-22 21:07 Andy Lutomirski
  2013-05-22 21:07 ` [PATCH 1/5] x86: Split "utter crap" pnpbios fixup out of fixup_exception Andy Lutomirski
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Andy Lutomirski @ 2013-05-22 21:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, trinity, Andy Lutomirski

Currently, __get_user can't trigger an OOPS -- any exception will be
caught and return -EFAULT.  This means that, if an access_ok check is
missing somewhere, then an attacker can freely use it to probe for valid
kernel mappings.

This series annotates all of the exception fixups as "catch anything" or
"catch valid uaccess faults", and skips the fixup (and hence oopses) if
an instruction of the latter type faults for any reason other than a
page fault to a user address.

I know of only one bug of this type; it's fixed in patch 5.

Perhaps surprisingly, this seems to survive Trinity fairly well.

Andy Lutomirski (5):
  x86: Split "utter crap" pnpbios fixup out of fixup_exception
  x86: Clean up extable entry format (and free up a bit)
  x86: Annotate _ASM_EXTABLE users to distinguish uaccess from
    everything else
  x86: Don't fixup uaccess faults to kernel or non-canonical addresses
  net: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg

 arch/x86/ia32/ia32entry.S             |   4 +-
 arch/x86/include/asm/asm.h            |  75 ++++++++----
 arch/x86/include/asm/fpu-internal.h   |   6 +-
 arch/x86/include/asm/futex.h          |   8 +-
 arch/x86/include/asm/kvm_host.h       |   2 +-
 arch/x86/include/asm/msr.h            |   4 +-
 arch/x86/include/asm/segment.h        |   2 +-
 arch/x86/include/asm/special_insns.h  |   2 +-
 arch/x86/include/asm/traps.h          |   6 +
 arch/x86/include/asm/uaccess.h        |  10 +-
 arch/x86/include/asm/word-at-a-time.h |   2 +-
 arch/x86/include/asm/xsave.h          |   6 +-
 arch/x86/kernel/entry_32.S            |  26 ++---
 arch/x86/kernel/entry_64.S            |   6 +-
 arch/x86/kernel/ftrace.c              |   4 +-
 arch/x86/kernel/kprobes/core.c        |   4 +-
 arch/x86/kernel/test_nx.c             |   2 +-
 arch/x86/kernel/test_rodata.c         |   2 +-
 arch/x86/kernel/traps.c               |  12 +-
 arch/x86/kvm/emulate.c                |   4 +-
 arch/x86/lib/checksum_32.S            |   4 +-
 arch/x86/lib/copy_user_64.S           |  50 ++++----
 arch/x86/lib/copy_user_nocache_64.S   |  44 +++----
 arch/x86/lib/csum-copy_64.S           |   6 +-
 arch/x86/lib/getuser.S                |  12 +-
 arch/x86/lib/mmx_32.c                 |  12 +-
 arch/x86/lib/msr-reg.S                |   4 +-
 arch/x86/lib/putuser.S                |  10 +-
 arch/x86/lib/usercopy_32.c            | 212 +++++++++++++++++-----------------
 arch/x86/lib/usercopy_64.c            |   4 +-
 arch/x86/mm/extable.c                 |  41 +++----
 arch/x86/mm/fault.c                   |  36 ++++--
 arch/x86/mm/init_32.c                 |   2 +-
 arch/x86/um/checksum_32.S             |   4 +-
 arch/x86/xen/xen-asm_32.S             |   2 +-
 net/socket.c                          |  33 +++++-
 36 files changed, 375 insertions(+), 288 deletions(-)

-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-06-13 22:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 21:07 [PATCH 0/5] x86: oops on uaccess faults outside of user addresses Andy Lutomirski
2013-05-22 21:07 ` [PATCH 1/5] x86: Split "utter crap" pnpbios fixup out of fixup_exception Andy Lutomirski
2013-05-22 21:07 ` [PATCH 2/5] x86: Clean up extable entry format (and free up a bit) Andy Lutomirski
2013-05-22 21:07 ` [PATCH 3/5] x86: Annotate _ASM_EXTABLE users to distinguish uaccess from everything else Andy Lutomirski
2013-05-22 21:07 ` [PATCH 4/5] x86: Don't fixup uaccess faults to kernel or non-canonical addresses Andy Lutomirski
2013-05-22 21:07 ` [PATCH 5/5] net: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg Andy Lutomirski
2013-05-28  8:56   ` [PATCH/FIX] " Ingo Molnar
2013-05-29  6:56     ` David Miller
2013-05-29  8:11       ` Ingo Molnar
2013-06-06  2:56   ` [PATCH 5/5] " Michael Neuling
2013-06-06  3:01     ` Anton Blanchard
2013-06-06  3:29       ` Stephen Rothwell
2013-06-06  5:38         ` [PATCH] net: Unbreak compat_sys_{send,recv}msg Andy Lutomirski
2013-06-06  5:48           ` Michael Neuling
2013-06-06  7:26           ` David Miller
2013-06-06 13:45             ` Eric Dumazet
2013-06-06 18:53               ` David Miller
2013-06-06  4:35     ` [PATCH 5/5] net: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg Eric Dumazet
2013-06-06  5:00       ` David Miller
2013-05-22 21:28 ` [PATCH 0/5] x86: oops on uaccess faults outside of user addresses David Miller
2013-05-28  8:25   ` Ingo Molnar
2013-05-28  8:51     ` David Miller
2013-05-28  8:54       ` Ingo Molnar
2013-06-13 22:00 ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).