From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Kees Cook <keescook@chromium.org>,
Emese Revfy <re.emese@gmail.com>, PaX Team <pageexec@freemail.hu>,
Al Viro <viro@zeniv.linux.org.uk>,
Oleg Nesterov <oleg@redhat.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Serge Hallyn <serge.hallyn@canonical.com>,
Julien Tinnes <jln@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: [ 17/75] signal: always clear sa_restorer on execve
Date: Mon, 18 Mar 2013 14:06:40 -0700 [thread overview]
Message-ID: <20130318210511.487435257@linuxfoundation.org> (raw)
In-Reply-To: <20130318210510.203500214@linuxfoundation.org>
3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <keescook@chromium.org>
commit 2ca39528c01a933f6689cd6505ce65bd6d68a530 upstream.
When the new signal handlers are set up, the location of sa_restorer is
not cleared, leaking a parent process's address space location to
children. This allows for a potential bypass of the parent's ASLR by
examining the sa_restorer value returned when calling sigaction().
Based on what should be considered "secret" about addresses, it only
matters across the exec not the fork (since the VMAs haven't changed
until the exec). But since exec sets SIG_DFL and keeps sa_restorer,
this is where it should be fixed.
Given the few uses of sa_restorer, a "set" function was not written
since this would be the only use. Instead, we use
__ARCH_HAS_SA_RESTORER, as already done in other places.
Example of the leak before applying this patch:
$ cat /proc/$$/maps
...
7fb9f3083000-7fb9f3238000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
...
$ ./leak
...
7f278bc74000-7f278be29000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
...
1 0 (nil) 0x7fb9f30b94a0
2 4000000 (nil) 0x7f278bcaa4a0
3 4000000 (nil) 0x7f278bcaa4a0
4 0 (nil) 0x7fb9f30b94a0
...
[akpm@linux-foundation.org: use SA_RESTORER for backportability]
Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Emese Revfy <re.emese@gmail.com>
Cc: Emese Revfy <re.emese@gmail.com>
Cc: PaX Team <pageexec@freemail.hu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Julien Tinnes <jln@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/signal.c | 3 +++
1 file changed, 3 insertions(+)
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -485,6 +485,9 @@ flush_signal_handlers(struct task_struct
if (force_default || ka->sa.sa_handler != SIG_IGN)
ka->sa.sa_handler = SIG_DFL;
ka->sa.sa_flags = 0;
+#ifdef SA_RESTORER
+ ka->sa.sa_restorer = NULL;
+#endif
sigemptyset(&ka->sa.sa_mask);
ka++;
}
next prev parent reply other threads:[~2013-03-18 21:06 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 21:06 [ 00/75] 3.8.4-stable review Greg Kroah-Hartman
2013-03-18 21:06 ` [ 01/75] qcaux: add Franklin U600 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 02/75] xen/pciback: Dont disable a PCI device that is already disabled Greg Kroah-Hartman
2013-03-18 21:06 ` [ 03/75] virtio: rng: disallow multiple device registrations, fixes crashes Greg Kroah-Hartman
2013-03-18 21:06 ` [ 04/75] USB: option: add Huawei E5331 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 05/75] USB: cdc-wdm: fix buffer overflow Greg Kroah-Hartman
2013-03-18 21:06 ` [ 06/75] tools: usb: ffs-test: Fix build failure Greg Kroah-Hartman
2013-03-18 21:06 ` [ 07/75] usb: dwc3: core: dont forget to free coherent memory Greg Kroah-Hartman
2013-03-18 21:06 ` [ 08/75] usb: cp210x new Vendor/Device IDs Greg Kroah-Hartman
2013-03-18 21:06 ` [ 09/75] USB: added support for Cinterions products AH6 and PLS8 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 10/75] usb: serial: Add Rigblaster Advantage to device table Greg Kroah-Hartman
2013-03-18 21:06 ` [ 11/75] USB: storage: fix Huawei mode switching regression Greg Kroah-Hartman
2013-03-18 21:06 ` [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers Greg Kroah-Hartman
2013-03-19 16:34 ` Sven Joachim
2013-03-19 18:17 ` Alan Stern
2013-03-19 18:43 ` Sven Joachim
2013-03-19 20:10 ` Alan Stern
2013-03-19 20:28 ` Sven Joachim
2013-03-19 21:00 ` Alan Stern
2013-03-19 21:44 ` Sven Joachim
2013-03-20 20:08 ` Greg Kroah-Hartman
2013-03-20 20:14 ` Sven Joachim
2013-03-20 20:28 ` Greg Kroah-Hartman
2013-03-20 20:41 ` Alan Stern
2013-03-20 22:28 ` Greg Kroah-Hartman
2013-03-21 14:35 ` Alan Stern
2013-03-19 18:03 ` Stephen Warren
2013-03-18 21:06 ` [ 13/75] USB: EHCI: dont check DMA values in QH overlays Greg Kroah-Hartman
2013-03-18 21:06 ` [ 14/75] staging: vt6656: Fix oops on resume from suspend Greg Kroah-Hartman
2013-03-18 21:06 ` [ 15/75] staging: comedi: dt9812: use CR_CHAN() for channel number Greg Kroah-Hartman
2013-03-18 21:06 ` [ 16/75] qcserial: bind to DM/DIAG port on Gobi 1K devices Greg Kroah-Hartman
2013-03-18 21:06 ` Greg Kroah-Hartman [this message]
2013-03-18 21:06 ` [ 18/75] ext3: Fix format string issues Greg Kroah-Hartman
2013-03-18 21:06 ` [ 19/75] tty/8250_pnp: serial port detection regression since v3.7 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 20/75] serial: 8250: Keep 8250.<xxxx> module options functional after driver rename Greg Kroah-Hartman
2013-03-18 21:06 ` [ 21/75] serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller Greg Kroah-Hartman
2013-03-18 21:06 ` [ 22/75] tty: serial: fix typo "ARCH_S5P6450" Greg Kroah-Hartman
2013-03-18 21:06 ` [ 23/75] tty: serial: fix typo "SERIAL_S3C2412" Greg Kroah-Hartman
2013-03-18 21:06 ` [ 24/75] tty/serial: Add support for Altera serial port Greg Kroah-Hartman
2013-03-18 21:06 ` [ 25/75] TTY: disable debugging warning Greg Kroah-Hartman
2013-03-18 21:06 ` [ 26/75] TTY: do not reset masters packet mode Greg Kroah-Hartman
2013-03-18 21:06 ` [ 27/75] Fix 4 port and add support for 8 port Unknown PCI serial port cards Greg Kroah-Hartman
2013-03-18 21:06 ` [ 28/75] ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels Greg Kroah-Hartman
2013-03-18 21:06 ` [ 29/75] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume Greg Kroah-Hartman
2013-03-18 21:11 ` Stephane Eranian
2013-03-18 21:20 ` Greg Kroah-Hartman
2013-03-18 21:35 ` Stephane Eranian
2013-03-18 23:00 ` Greg Kroah-Hartman
2013-03-18 21:06 ` [ 30/75] ALSA: seq: Fix missing error handling in snd_seq_timer_open() Greg Kroah-Hartman
2013-03-18 21:06 ` [ 31/75] ARM: w1-gpio: fix erroneous gpio requests Greg Kroah-Hartman
2013-03-18 21:06 ` [ 32/75] hwmon: (pmbus/ltc2978) Fix temperature reporting Greg Kroah-Hartman
2013-03-18 21:06 ` [ 33/75] hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes Greg Kroah-Hartman
2013-03-18 21:06 ` [ 34/75] w1-gpio: remove erroneous __exit and __exit_p() Greg Kroah-Hartman
2013-03-18 21:06 ` [ 35/75] w1: fix oops when w1_search is called from netlink connector Greg Kroah-Hartman
2013-03-18 21:06 ` [ 36/75] powerpc: Fix STAB initialization Greg Kroah-Hartman
2013-03-18 21:07 ` [ 37/75] powerpc: Fix cputable entry for 970MP rev 1.0 Greg Kroah-Hartman
2013-03-18 21:07 ` [ 38/75] powerpc: Make VSID_BITS* dependency explicit Greg Kroah-Hartman
2013-03-18 21:07 ` [ 39/75] powerpc: Update kernel VSID range Greg Kroah-Hartman
2013-03-18 21:07 ` [ 40/75] powerpc: Rename USER_ESID_BITS* to ESID_BITS* Greg Kroah-Hartman
2013-03-18 21:07 ` [ 41/75] ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830 Greg Kroah-Hartman
2013-03-19 16:25 ` Luis Henriques
[not found] ` <f20a6d0dd7604c0fa6ed95604a8dfb35@DLEE70.ent.ti.com>
2013-03-19 17:27 ` Matt Porter
2013-03-19 18:25 ` Luis Henriques
2013-03-18 21:07 ` [ 42/75] selinux: use GFP_ATOMIC under spin_lock Greg Kroah-Hartman
2013-03-18 21:07 ` [ 43/75] perf,x86: fix wrmsr_on_cpu() warning on suspend/resume Greg Kroah-Hartman
2013-03-18 21:07 ` [ 44/75] perf,x86: fix link failure for non-Intel configs Greg Kroah-Hartman
2013-03-18 21:07 ` [ 45/75] s390: critical section cleanup vs. machine checks Greg Kroah-Hartman
2013-03-18 21:07 ` [ 46/75] s390/mm: fix flush_tlb_kernel_range() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 47/75] btrfs: use rcu_barrier() to wait for bdev puts at unmount Greg Kroah-Hartman
2013-03-18 21:07 ` [ 48/75] mtd: nand: reintroduce NAND_NO_READRDY as NAND_NEED_READRDY Greg Kroah-Hartman
2013-03-18 21:07 ` [ 49/75] kbuild: fix make headers_check with make 3.80 Greg Kroah-Hartman
2013-03-18 21:07 ` [ 50/75] atmel_lcdfb: fix 16-bpp modes on older SOCs Greg Kroah-Hartman
2013-03-18 21:07 ` [ 51/75] net/mlx4_en: Initialize RFS filters lock and list in init_netdev Greg Kroah-Hartman
2013-03-18 21:07 ` [ 52/75] net/mlx4_en: Disable RFS when running in SRIOV mode Greg Kroah-Hartman
2013-03-18 21:07 ` [ 53/75] block: use i_size_write() in bd_set_size() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 54/75] loopdev: fix a deadlock Greg Kroah-Hartman
2013-03-18 21:07 ` [ 55/75] loopdev: remove an user triggerable oops Greg Kroah-Hartman
2013-03-18 21:07 ` [ 56/75] net/sctp: Validate parameter size for SCTP_GET_ASSOC_STATS Greg Kroah-Hartman
2013-03-18 21:07 ` [ 57/75] l2tp: Restore socket refcount when sendmsg succeeds Greg Kroah-Hartman
2013-03-18 21:07 ` [ 58/75] atl1c: restore buffer state Greg Kroah-Hartman
2013-03-18 21:07 ` [ 59/75] rds: limit the size allocated by rds_message_alloc() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 60/75] net: ipv6: Dont purge default router if accept_ra=2 Greg Kroah-Hartman
2013-03-18 21:07 ` [ 61/75] tcp: fix double-counted receiver RTT when leaving receiver fast path Greg Kroah-Hartman
2013-03-18 21:07 ` [ 62/75] tun: add a missing nf_reset() in tun_net_xmit() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 63/75] vxlan: fix oops when delete netns containing vxlan Greg Kroah-Hartman
2013-03-18 21:07 ` [ 64/75] bonding: fire NETDEV_RELEASE event only on 0 slaves Greg Kroah-Hartman
2013-03-18 21:07 ` [ 65/75] team: unsyc the devices addresses when port is removed Greg Kroah-Hartman
2013-03-18 21:07 ` [ 66/75] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode Greg Kroah-Hartman
2013-03-18 21:07 ` [ 67/75] netlabel: correctly list all the static label mappings Greg Kroah-Hartman
2013-03-18 21:07 ` [ 68/75] bridging: fix rx_handlers return code Greg Kroah-Hartman
2013-03-18 21:07 ` [ 69/75] ipv6: stop multicast forwarding to process interface scoped addresses Greg Kroah-Hartman
2013-03-18 21:07 ` [ 70/75] bridge: fix mdb info leaks Greg Kroah-Hartman
2013-03-18 21:07 ` [ 71/75] rtnl: fix info leak on RTM_GETLINK request for VF devices Greg Kroah-Hartman
2013-03-18 21:07 ` [ 72/75] dcbnl: fix various netlink info leaks Greg Kroah-Hartman
2013-03-18 21:07 ` [ 73/75] 6lowpan: Fix endianness issue in is_addr_link_local() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 74/75] Revert "drm/i915: enable irqs earlier when resuming" Greg Kroah-Hartman
2013-03-27 15:45 ` Ilya Tumaykin
2013-03-27 16:52 ` Daniel Vetter
2013-03-18 21:07 ` [ 75/75] Revert "drm/i915: reorder setup sequence to have irqs for output setup" Greg Kroah-Hartman
2013-03-19 0:51 ` [ 00/75] 3.8.4-stable review Shuah Khan
2013-03-19 0:57 ` Greg Kroah-Hartman
2013-03-19 1:09 ` Shuah Khan
2013-03-19 2:00 ` Greg Kroah-Hartman
2013-03-19 4:00 ` Shuah Khan
2013-03-19 4:07 ` Greg Kroah-Hartman
2013-03-19 15:51 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130318210511.487435257@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=jln@google.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=pageexec@freemail.hu \
--cc=re.emese@gmail.com \
--cc=serge.hallyn@canonical.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).