From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Mel Gorman <mel@csn.ul.ie>, Peter Zijlstra <peterz@infradead.org>,
Darren Hart <darren@dvhart.com>
Subject: [12/98] hugetlb: fix infinite loop in get_futex_key() when backed by huge pages
Date: Mon, 10 May 2010 15:34:24 -0700 [thread overview]
Message-ID: <20100510223535.528832417@kvm.kroah.org> (raw)
In-Reply-To: <20100510223714.GA18416@kroah.com>
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <mel@csn.ul.ie>
commit 23be7468e8802a2ac1de6ee3eecb3ec7f14dc703 upstream.
If a futex key happens to be located within a huge page mapped
MAP_PRIVATE, get_futex_key() can go into an infinite loop waiting for a
page->mapping that will never exist.
See https://bugzilla.redhat.com/show_bug.cgi?id=552257 for more details
about the problem.
This patch makes page->mapping a poisoned value that includes
PAGE_MAPPING_ANON mapped MAP_PRIVATE. This is enough for futex to
continue but because of PAGE_MAPPING_ANON, the poisoned value is not
dereferenced or used by futex. No other part of the VM should be
dereferencing the page->mapping of a hugetlbfs page as its page cache is
not on the LRU.
This patch fixes the problem with the test case described in the bugzilla.
[akpm@linux-foundation.org: mel cant spel]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Darren Hart <darren@dvhart.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@suse.de>
---
include/linux/poison.h | 9 +++++++++
mm/hugetlb.c | 5 ++++-
2 files changed, 13 insertions(+), 1 deletion(-)
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -48,6 +48,15 @@
#define POISON_FREE 0x6b /* for use-after-free poisoning */
#define POISON_END 0xa5 /* end-byte of poisoning */
+/********** mm/hugetlb.c **********/
+/*
+ * Private mappings of hugetlb pages use this poisoned value for
+ * page->mapping. The core VM should not be doing anything with this mapping
+ * but futex requires the existence of some page->mapping value even though it
+ * is unused if PAGE_MAPPING_ANON is set.
+ */
+#define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON))
+
/********** arch/$ARCH/mm/init.c **********/
#define POISON_FREE_INITMEM 0xcc
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -545,6 +545,7 @@ static void free_huge_page(struct page *
mapping = (struct address_space *) page_private(page);
set_page_private(page, 0);
+ page->mapping = NULL;
BUG_ON(page_count(page));
INIT_LIST_HEAD(&page->lru);
@@ -2095,8 +2096,10 @@ retry:
spin_lock(&inode->i_lock);
inode->i_blocks += blocks_per_huge_page(h);
spin_unlock(&inode->i_lock);
- } else
+ } else {
lock_page(page);
+ page->mapping = HUGETLB_POISON;
+ }
}
/*
next prev parent reply other threads:[~2010-05-10 23:20 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-10 22:37 [00/98] 2.6.32.13-stable review Greg KH
2010-05-10 22:34 ` [01/98] USB: EHCI: defer reclamation of siTDs Greg KH
2010-05-10 22:34 ` [02/98] p54usb: Add usbid for Corega CG-WLUSB2GT Greg KH
2010-05-10 22:34 ` [03/98] md/raid5: allow for more than 2^31 chunks Greg KH
2010-05-10 22:34 ` [04/98] md/raid5: fix previous patch Greg KH
2010-05-10 22:34 ` [05/98] libata: fix locking around blk_abort_request() Greg KH
2010-05-10 22:34 ` [06/98] libata: ensure NCQ error result taskfile is fully initialized Greg KH
2010-05-10 22:34 ` [07/98] w1: w1 temp: fix negative termperature calculation Greg KH
2010-05-10 22:34 ` [08/98] memcg: fix prepare migration Greg KH
2010-05-10 22:34 ` [09/98] mac80211: remove bogus TX agg state assignment Greg KH
2010-05-10 22:34 ` [10/98] flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO Greg KH
2010-05-10 22:34 ` [11/98] core, x86: make LIST_POISON less deadly Greg KH
2010-05-10 22:34 ` Greg KH [this message]
2010-05-10 22:34 ` [13/98] reiserfs: fix permissions on .reiserfs_priv Greg KH
2010-05-10 22:34 ` [14/98] reiserfs: fix corruption during shrinking of xattrs Greg KH
2010-05-10 22:34 ` [15/98] nfsd4: bug in read_buf Greg KH
2010-05-10 22:34 ` [16/98] keys: the request_key() syscall should link an existing key to the dest keyring Greg KH
2010-05-10 22:34 ` [17/98] staging: usbip: Fix deadlock Greg KH
2010-05-10 22:34 ` [18/98] USB: fix remote wakeup settings during system sleep Greg KH
2010-05-10 22:34 ` [19/98] USB: Add id for HP ev2210 a.k.a Sierra MC5725 miniPCI-e Cell Modem Greg KH
2010-05-10 22:34 ` [20/98] USB: fix testing the wrong variable in fs_create_by_name() Greg KH
2010-05-10 22:34 ` [21/98] USB: dont choose configs with no interfaces Greg KH
2010-05-10 22:34 ` [22/98] USB: OHCI: dont look at the root hub to get the number of ports Greg KH
2010-05-10 22:34 ` [23/98] USB: xhci: properly set the "Mult" field of the endpoint context Greg KH
2010-05-10 22:34 ` [24/98] USB: xhci: properly set endpoint context fields for periodic eps Greg KH
2010-05-10 22:34 ` [25/98] procfs: fix tid fdinfo Greg KH
2010-05-10 22:34 ` [26/98] ocfs2: Update VFS inodes id info after reflink Greg KH
2010-05-10 22:34 ` [27/98] ocfs2: potential ERR_PTR dereference on error paths Greg KH
2010-05-10 22:34 ` [28/98] ocfs2: Compute metaecc for superblocks during online resize Greg KH
2010-05-10 22:34 ` [29/98] ocfs2_dlmfs: Fix math error when reading LVB Greg KH
2010-05-10 22:34 ` [30/98] powernow-k8: Fix frequency reporting Greg KH
2010-05-10 22:34 ` [31/98] nfs d_revalidate() is too trigger-happy with d_drop() Greg KH
2010-05-10 22:34 ` [32/98] NFS: rsize and wsize settings ignored on v4 mounts Greg KH
2010-05-10 22:34 ` [33/98] Staging: hv: Fix a bug affecting IPv6 Greg KH
2010-05-10 22:34 ` [34/98] Staging: hv: Fix up memory leak on HvCleanup Greg KH
2010-05-10 22:34 ` [35/98] Staging: hv: name network device ethX rather than sethX Greg KH
2010-05-10 22:34 ` [36/98] i2c: Fix probing of FSC hardware monitoring chips Greg KH
2010-05-10 22:34 ` [37/98] perf: Fix resource leak in failure path of perf_event_open() Greg KH
2010-05-10 22:34 ` [38/98] raid6: fix recovery performance regression Greg KH
2010-05-10 22:34 ` [39/98] serial: 8250_pnp - add Fujitsu Wacom device Greg KH
2010-05-10 22:34 ` [40/98] block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer Greg KH
2010-05-10 22:34 ` [41/98] dm9601: fix phy/eeprom write routine Greg KH
2010-05-10 22:34 ` [42/98] p54pci: fix bugs in p54p_check_tx_ring Greg KH
2010-05-10 22:34 ` [43/98] edac, mce: Fix wrong mask and macro usage Greg KH
2010-05-10 22:34 ` [44/98] x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero Greg KH
2010-05-10 22:34 ` [45/98] x86: Disable large pages on CPUs with Atom erratum AAE44 Greg KH
2010-05-10 22:34 ` [46/98] x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems Greg KH
2010-05-10 22:34 ` [47/98] x86, AMD: Fix stale cpuid4_info shared_map data in shared_cpu_map cpumasks Greg KH
2010-05-10 22:35 ` [48/98] ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203 Greg KH
2010-05-10 22:35 ` [49/98] ALSA: hda - Add PCI quirk for HP dv6-1110ax Greg KH
2010-05-10 22:35 ` [50/98] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio XPS 1645 Greg KH
2010-05-10 22:35 ` [51/98] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558 Greg KH
2010-05-10 23:31 ` Nigel Cunningham
2010-05-10 22:35 ` [52/98] ALSA: hda: Use ALC880_F1734 quirk for Fujitsu Siemens AMILO Xi 1526 Greg KH
2010-05-10 22:35 ` [53/98] ALSA: snd-meastro3: Add amp_gpio quirk for Compaq EVO N600C Greg KH
2010-05-10 22:35 ` [54/98] ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume Greg KH
2010-05-10 22:35 ` [55/98] ALSA: hda: Fix max PCM level to 0 dB for Fujitsu-Siemens laptops using CX20549 (Venice) Greg KH
2010-05-10 22:35 ` [56/98] ALSA: hda: Fix 0 dB for Packard Bell models using Conexant " Greg KH
2010-05-10 22:35 ` [57/98] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite Pro T130-15F Greg KH
2010-05-10 22:35 ` [58/98] ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T Greg KH
2010-05-10 22:35 ` [59/98] libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2) Greg KH
2010-05-10 22:35 ` [60/98] ext4: correctly calculate number of blocks for fiemap Greg KH
2010-05-10 22:35 ` [61/98] initramfs: handle unrecognised decompressor when unpacking Greg KH
2010-05-10 22:35 ` [62/98] drm/i915: fix tiling limits for i915 class hw v2 Greg KH
2010-05-10 22:35 ` [63/98] CRED: Fix a race in creds_are_invalid() in credentials debugging Greg KH
2010-05-10 22:35 ` [64/98] jfs: fix diAllocExt error in resizing filesystem Greg KH
2010-05-10 22:35 ` [65/98] ACPI: introduce kernel parameter acpi_sleep=sci_force_enable Greg KH
2010-05-10 22:35 ` [66/98] p54pci: rx frame length check Greg KH
2010-05-10 22:35 ` [67/98] drivers/net/wireless/p54/txrx.c Fix off by one error Greg KH
2010-05-10 22:35 ` [68/98] dccp_probe: Fix module load dependencies between dccp and dccp_probe Greg KH
2010-05-10 22:35 ` [69/98] KVM: remove unused load_segment_descriptor_to_kvm_desct Greg KH
2010-05-10 22:35 ` [70/98] kgdb: dont needlessly skip PAGE_USER test for Fsl booke Greg KH
2010-05-10 22:35 ` [71/98] r8169: use correct barrier between cacheable and non-cacheable memory Greg KH
2010-05-10 22:35 ` [72/98] r8169: fix broken register writes Greg KH
2010-05-10 22:35 ` [73/98] r8169: more broken register writes workaround Greg KH
2010-05-10 22:35 ` [74/98] PCI: Ensure we re-enable devices on resume Greg KH
2010-05-10 22:35 ` [75/98] [SCSI] skip sense logging for some ATA PASS-THROUGH cdbs Greg KH
2010-05-10 22:35 ` [76/98] tg3: Fix INTx fallback when MSI fails Greg KH
2010-05-10 22:35 ` [77/98] xfs: add a shrinker to background inode reclaim Greg KH
2010-05-11 14:47 ` Alex Elder
2010-05-11 15:12 ` Greg KH
2010-05-10 22:35 ` [78/98] parisc: Set PCI CLS early in boot Greg KH
2010-05-10 22:35 ` [79/98] [SCSI] qla2xxx: Properly handle UNDERRUN completion statuses Greg KH
2010-05-10 22:35 ` [80/98] bnx2: Fix lost MSI-X problem on 5709 NICs Greg KH
2010-05-10 22:35 ` [81/98] tracing: Fix ftrace_event_call alignment for use with gcc 4.5 Greg KH
2010-05-10 22:35 ` [82/98] security: testing the wrong variable in create_by_name() Greg KH
2010-05-10 22:35 ` [83/98] md: restore ability of spare drives to spin down Greg KH
2010-05-10 22:35 ` [84/98] virtio: initialize earlier Greg KH
2010-05-10 22:35 ` [85/98] md/raid6: Fix raid-6 read-error correction in degraded state Greg KH
2010-05-10 22:35 ` [86/98] V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference" Greg KH
2010-05-10 22:35 ` [87/98] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads Greg KH
2010-05-11 3:39 ` Alex Chiang
2010-05-10 22:35 ` [88/98] power_meter: acpi_device_class "power_meter_resource" too long Greg KH
2010-05-10 22:35 ` [89/98] ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x Greg KH
2010-05-10 22:35 ` [90/98] cpuidle: Fix incorrect optimization Greg KH
2010-05-10 22:35 ` [91/98] [ARM] pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h Greg KH
2010-05-10 22:35 ` [92/98] SCSI: fix locking around blk_abort_request() Greg KH
2010-05-10 22:35 ` [93/98] SCSI: libiscsi: regression: fix header digest errors Greg KH
2010-05-10 22:35 ` [94/98] [SCSI] scsi_debug: virtual_gb ignores sector_size Greg KH
2010-05-10 22:35 ` [95/98] [SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error Greg KH
2010-05-10 22:35 ` [96/98] SCSI: Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 " Greg KH
2010-05-10 22:35 ` [97/98] MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions Greg KH
2010-05-10 22:35 ` [98/98] MIPS: uasm: Add OR instruction Greg KH
2010-05-11 11:53 ` [Stable-review] " Stefan Bader
2010-05-11 12:00 ` Stefan Bader
2010-05-11 15:02 ` Greg KH
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=20100510223535.528832417@kvm.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=darren@dvhart.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=peterz@infradead.org \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/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
Powered by JetHome