linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Johannes Weiner <hannes@saeurebad.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kernel Testers List <kernel-testers@vger.kernel.org>,
	Randy Dunlap <randy.dunlap@oracle.com>
Subject: Re: [PATCH] mm: make unmap_vmas() handle non-page-aligned boundary addresses
Date: Sun, 17 Aug 2008 12:30:34 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0808171151190.13521@blonde.site> (raw)
In-Reply-To: <87fxp4pi0r.fsf_-_@skyscraper.fehenstaub.lan>

On Sun, 17 Aug 2008, Johannes Weiner wrote:
> zap_pte_range() overruns the page tables if the distance between the
> start and end is not a multiple of the pagesize.  Because then,
> `start' will never be equal to `end' and we will keep looping.
> 
> To fix this, round the boundary addresses to exclude partial pages from
> the range completely, we must not unmap them anyway.

You've a good idea here, but no.

> 
> Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
> ---
> 
> Hugh Dickins <hugh@veritas.com> writes:
> 
> > On Sat, 16 Aug 2008, Rafael J. Wysocki wrote:
> >> 
> >> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=11335
> >> Subject		: 2.6.27-rc2-git5 BUG: unable to handle kernel paging request
> >> Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
> >> Date		: 2008-08-12 4:18 (5 days old)
> >> References	: http://marc.info/?l=linux-kernel&m=121851477201960&w=4
> >> Handled-By	: Hugh Dickins <hugh@veritas.com>
> >
> > This should still be listed for now, it's interesting,
> > but I doubt we'll make any progress unless it can be reproduced.
> 
> I think this patch fixes it.  exit_mmap() even calls unmap_vmas() with
> an ending address of -1UL which is not page-aligned in my book and on my
> architecture :)

You need to take into consideration that gazillions of calls to
exit_mmap(), unmap_vmas() and zap_pte_range() have been succeeding
since we reworked those loops three years ago.  exit_mmap() calls
unmap_vmas() with a start_addr of 0 (so your patch won't help that),
and the (unsigned long) end_addr of -1 is simply an upper bound on
on how far the vma loop goes, it doesn't need the alignment your
patch enforces.

That's a great idea that overrunning a pagetable may account for
Randy's apparent pagetable corruption: I (and please, you too) need
to go back over the info he's given with that hypothesis in mind,
it certainly fits well the fact that 6 out of 7 entries were found
bad at the _start_ of a pagetable before collapsing - though OTOH
I don't think it does fit with the two processes seeing similar
but different corruption, or the general protection faults.
But definitely worth pursuing, it hadn't crossed my mind.

But if a pagetable is being overrun in that way, doesn't that mean
that a vma->vm_start (or vma->vm_end?) has got corrupted, and then
we'll need to work that out.  vm_start and vm_end (unless corrupted)
are always page aligned, and there's lots of code which assumes that:
or have you noticed somewhere that's not so?

> 
> It is a similar problem to what we had with gup some weeks ago.

You're right that those pgd_addr_end() etc. loops have an implicit
and fragile dependence on the page alignment of addr and end.  They
were written that way to maximize efficiency and be homogeneous
across the levels, while handling the wrapped end 0 case.  But both
fast gup and pagewalk have stumbled on those assumptions recently.

Hugh

  reply	other threads:[~2008-08-17 11:30 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-16 19:00 2.6.27-rc3-git3: Reported regressions from 2.6.26 Rafael J. Wysocki
2008-08-16 19:00 ` [Bug #11141] no battery or DC status - Dell i1501 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11191] 2.6.26-git8: spinlock lockup in c1e_idle() Rafael J. Wysocki
2008-08-18 21:45   ` Mikhail Kshevetskiy
2008-08-18 21:54     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11205] x86: 2.6.27-rc1 does not build with gcc-3.2.3 any more Rafael J. Wysocki
2008-08-17  9:12   ` Mikael Pettersson
2008-08-17 10:27     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11209] 2.6.27-rc1 process time accounting Rafael J. Wysocki
2008-08-17  8:07   ` Peter Zijlstra
2008-08-17 12:19     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11189] sky2 WOL broken Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11207] VolanoMark regression with 2.6.27-rc1 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11210] libata badness Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11220] Heavy suspend and io problems in 2.6.27-rc1-00156-g94ad374 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11215] INFO: possible recursive locking detected ps2_command Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11219] KVM modules break emergency reboot Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11224] Only three cores found on quad-core machine Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11245] acpi error on 2.6.27-rc1+ (ACPI Error (dsobject-0501)) Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11230] Kconfig no longer outputs a .config with freshly updated defconfigs Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11228] p54usb broken by commit b19fa1f Rafael J. Wysocki
2008-08-17 21:25   ` Larry Finger
2008-08-16 19:02 ` [Bug #11237] corrupt PMD after resume Rafael J. Wysocki
2008-08-16 23:36   ` Hugh Dickins
2008-08-17 12:18     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11260] Regression: USB memory stick triggers several USB resets before settling with bogus capacity Rafael J. Wysocki
2008-08-16 23:33   ` Hugh Dickins
2008-08-17 12:18     ` Rafael J. Wysocki
2008-08-17 15:03     ` James Bottomley
2008-08-16 19:02 ` [Bug #11254] KVM: fix userspace ABI breakage Rafael J. Wysocki
2008-08-17 18:45   ` Adrian Bunk
2008-08-16 19:02 ` [Bug #11263] Re: 2.6.27-rc2: uvcvideo WARNING after suspend to ram Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11272] BUG: parport_serial in 2.6.27-rc1 for NetMos Technology PCI 9835 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11271] BUG: fealnx in 2.6.27-rc1 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11276] build error: CONFIG_OPTIMIZE_INLINING=y causes gcc 4.2 to do stupid things Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11264] Invalid op opcode in kernel/workqueue Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11282] Please fix x86 defconfig regression Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11278] 2.6.27-rc2: Very odd top: '5124095h kthreadd' display Rafael J. Wysocki
2008-08-16 22:37   ` Grant Coady
2008-08-17  8:07   ` Peter Zijlstra
2008-08-17 12:22     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11279] 2.6.27-rc0 Power Bugs with HP/Compaq Laptops Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11296] 2.6.27-rc2-git4: suspend and power off fails on Asus M3A32-MVP Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11293] 2.6.27-rc2: suspend regression on EeePC Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11308] tbench regression on each kernel release from 2.6.22 -&gt; 2.6.28 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11316] severe performance regression for iptables nat routing Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11323] /proc/diskstats does not contain all disk devices Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11313] Plugging HDMI causes "unable to handle kernel paging request" Rafael J. Wysocki
2008-08-17 19:28   ` Rafał Miłecki
2008-08-17 19:35     ` Rafael J. Wysocki
2008-08-19 21:31     ` Jeremy Fitzhardinge
2008-08-19 23:53     ` Jeremy Fitzhardinge
2008-08-20 11:10       ` Rafał Miłecki
2008-08-20 16:00         ` Jeremy Fitzhardinge
2008-08-20 20:27           ` Rafał Miłecki
2008-08-20 20:46             ` Jeremy Fitzhardinge
2008-08-21 18:13             ` Jeremy Fitzhardinge
2008-08-21 18:34               ` Rafael J. Wysocki
2008-08-21 18:56               ` Hugh Dickins
2008-08-21 18:59                 ` Jeremy Fitzhardinge
2008-08-21 19:07               ` Yinghai Lu
2008-08-16 19:02 ` [Bug #11330] int3: 0000 in tsc_read_refs when using powernow_k7 Rafael J. Wysocki
2008-08-18 17:15   ` Alok Kataria
2008-08-18 18:33     ` Ingo Molnar
2008-08-19  0:22       ` Ingo Molnar
2008-08-19 17:02         ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11336] 2.6.27-rc2:stall while mounting root fs Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11335] 2.6.27-rc2-git5 BUG: unable to handle kernel paging request Rafael J. Wysocki
2008-08-16 23:38   ` Hugh Dickins
2008-08-17  1:06     ` [PATCH] mm: make unmap_vmas() handle non-page-aligned boundary addresses Johannes Weiner
2008-08-17 11:30       ` Hugh Dickins [this message]
2008-08-17 12:22         ` Johannes Weiner
2008-08-17 13:24           ` Hugh Dickins
2008-08-17 14:41             ` Johannes Weiner
2008-08-16 19:02 ` [Bug #11334] myri10ge: use ioremap_wc: compilation failure on ARM Rafael J. Wysocki
2008-08-17  6:27   ` Martin Michlmayr
2008-08-17 12:35     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11333] Rewrite SSB DMA API breaks compilation " Rafael J. Wysocki
2008-08-17 12:21   ` Martin Michlmayr
2008-08-17 12:43     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11337] Warning in during hotplug on 2.6.27-rc2-git5 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11338] ia64 allmodconfig on current mainline Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11341] 2.6.27-rc1 - ext4 e2fsck false prompting for fixing i_size of Inode Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11339] Only one of my cpus seems to powered down by cpufreq Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11340] LTP overnight run resulted in unusable box Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11343] SATA Cold Boot Problems with 2.6.27-rc[23] on nVidia 680i Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11346] kernel BUG at arch/x86/mm/pat.c:233! Rafael J. Wysocki
2008-08-16 20:45   ` Jean Delvare
2008-08-17 12:35     ` Rafael J. Wysocki
2008-08-17 12:46       ` Ingo Molnar
2008-08-16 19:02 ` [Bug #11355] Regression in 2.6.27-rc2 when cross-building the kernel Rafael J. Wysocki
2008-08-16 20:54   ` Larry Finger
2008-08-17 12:39     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11354] AMD Elan regression with 2.6.27-rc3 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11344] lockdep link failed Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11356] Linux 2.6.27-rc3 - build failure: undefined reference to `.lockdep_count_forward_deps' Rafael J. Wysocki
2008-08-17 13:51 ` 2.6.27-rc3-git3: Reported regressions from 2.6.26 Theodore Tso
2008-08-17 16:33   ` Rafael J. Wysocki
     [not found] ` <200808230019.09040.rjw@sisk.pl>
     [not found]   ` <680ad8bc0808230032g458319b6nbcaddd24ad84f7a4@mail.gmail.com>
2008-08-23 10:26     ` [Bug #11279] 2.6.27-rc0 Power Bugs with HP/Compaq Laptops Rafael J. Wysocki

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=Pine.LNX.4.64.0808171151190.13521@blonde.site \
    --to=hugh@veritas.com \
    --cc=hannes@saeurebad.de \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=rjw@sisk.pl \
    /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).