mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Wilson <wilsons@start.ca>
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Anca Emanuel <anca.emanuel@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	"Luck, Tony" <tony.luck@intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: BUG: unable to handle kernel paging request
Date: Sun, 27 Mar 2011 13:52:03 -0400	[thread overview]
Message-ID: <20110327175203.GA15862@fibrous.localdomain> (raw)
In-Reply-To: <AANLkTikyd5GkR_9BUBFeL+Knxd17uozBJoARThVoOrW9@mail.gmail.com>

On Mon, Mar 28, 2011 at 12:00:44AM +0800, Américo Wang wrote:
> On Sun, Mar 27, 2011 at 11:37 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> > Al, this smells like your /proc cleanups/fixes...
> >
> > On Sun, Mar 27, 2011 at 2:16 AM, Anca Emanuel <anca.emanuel@gmail.com> wrote:
> >> Hi, I'm using latest kernel git.
> >>
> >>
> >> [15117.080119] BUG: unable to handle kernel paging request at fffffffffffffff3
> >
> > That's "-13" (possibly -EACCES)
> >
> >> [15117.080152] IP: [<ffffffff811b4989>] vma_stop+0x19/0x40
> >
> > .. and the code disassembles to
> >
> >   0:   55                      push   %rbp
> >   1:   48 89 e5                mov    %rsp,%rbp
> >   4:   53                      push   %rbx
> >   5:   48 83 ec 08             sub    $0x8,%rsp
> >   9:   0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
> >   e:   48 85 f6                test   %rsi,%rsi
> >  11:   74 1a                   je     0x2d
> >  13:   48 39 77 10             cmp    %rsi,0x10(%rdi)
> >  17:   74 14                   je     0x2d
> >  19:   8b 1e                   mov    (%rsi),%ebx
> >  1b:   48 8d 7b 60             lea    0x60(%rbx),%rdi
> >  1f:   e8 eb 2f ed ff          callq  up_read
> >
> > where that instruction at 0x19 is the access "mm = vma->vm_mm". So
> > it's vma that is -EPERM.
> >
> > I bet it's due to commit ec6fd8a4355c ("report errors in /proc/*/*map*
> > sanely"), which replaces NULL with various ERR_PTR() cases.
> >
> 
> Exactly... should be fixed by something like:
> 
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 7c708a4..6b82632 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -90,7 +90,7 @@ static void pad_len_spaces(struct seq_file *m, int len)
> 
>  static void vma_stop(struct proc_maps_private *priv, struct
> vm_area_struct *vma)
>  {
> -       if (vma && vma != priv->tail_vma) {
> +       if (vma && !IS_ERR(vma) && vma != priv->tail_vma) {
>                 struct mm_struct *mm = vma->vm_mm;
>                 up_read(&mm->mmap_sem);
>                 mmput(mm);

FWIW, that looks like the right fix to me.

Also CC'ing Tony Luck as he reported what appears to be the same issue
on the 25'th.

-- 
steve


  parent reply	other threads:[~2011-03-27 17:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27  9:16 Anca Emanuel
2011-03-27 15:37 ` Linus Torvalds
2011-03-27 16:00   ` Américo Wang
2011-03-27 17:44     ` Anca Emanuel
2011-03-27 17:52     ` Stephen Wilson [this message]
2011-03-28  3:46       ` [Patch] proc: check error pointer returned by m_start() Amerigo Wang
2011-03-28  3:58         ` Linus Torvalds
2011-03-28  5:02           ` Cong Wang
2011-03-28  5:26           ` [Patch V2] " Amerigo Wang
2011-03-28  5:45             ` Cong Wang
2011-03-28  7:07               ` [PATCH 1/2] proc: Use IS_ERR_OR_NULL() helper Amerigo Wang
2011-03-28  7:07                 ` [PATCH 2/2] proc: do cleanup in m_start() rather than m_stop() Amerigo Wang
2011-03-28  7:15                 ` [PATCH 1/2] proc: Use IS_ERR_OR_NULL() helper Mike Frysinger
2011-03-28  5:46             ` [Patch V2] proc: check error pointer returned by m_start() Anca Emanuel
2011-03-28  5:49               ` Cong Wang
  -- strict thread matches above, loose matches on Subject: below --
2010-05-31  1:24 BUG: unable to handle kernel paging request Thomas Fjellstrom
2010-05-23 16:29 Markus
2010-05-23 18:38 ` Borislav Petkov
2010-05-23 20:44   ` Markus
2010-05-23 21:17     ` Borislav Petkov
2010-05-23 21:48       ` Markus
2010-05-24 11:44       ` Markus
2010-05-25 13:09       ` Markus
2010-05-25 14:31         ` Borislav Petkov
2010-05-25 14:54           ` Markus
2008-05-05 22:33 thomas
2008-05-07  6:55 ` Andrew Morton

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=20110327175203.GA15862@fibrous.localdomain \
    --to=wilsons@start.ca \
    --cc=anca.emanuel@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiyou.wangcong@gmail.com \
    /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

all inboxes | Powered by JetHome®