linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: syzbot <syzbot+ccc0e1cfdb72b664f0d8@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	pasha.tatashin@soleen.com, syzkaller-bugs@googlegroups.com,
	linux-usb@vger.kernel.org
Subject: Re: [syzbot] [mm?] kernel BUG in __page_table_check_zero (2)
Date: Tue, 5 Nov 2024 15:42:12 -0500	[thread overview]
Message-ID: <c5a71213-ca55-4165-8e50-2686d05614e3@rowland.harvard.edu> (raw)
In-Reply-To: <20241105110236.40819b7effad3f44de73dddf@linux-foundation.org>

On Tue, Nov 05, 2024 at 11:02:36AM -0800, Andrew Morton wrote:
> On Tue, 5 Nov 2024 11:39:59 -0500 Alan Stern <stern@rowland.harvard.edu> wrote:
> 
> > On Mon, Nov 04, 2024 at 08:00:07PM -0800, Andrew Morton wrote:
> > > On Wed, 30 Oct 2024 21:54:22 -0700 syzbot <syzbot+ccc0e1cfdb72b664f0d8@syzkaller.appspotmail.com> wrote:
> > > 
> > > > Hello,
> > > > 
> > > > syzbot found the following issue on:
> > > 
> > > Thanks.  I'm suspecting some USB issue - fault injection was used to
> > > trigger a memory allocation failure and dec_usb_memory_use_count() ended
> > > up freeing an in-use page.  Could USB folks please have a look?
> > 
> > Andrew, I'm not sure what to look for.
> 
> Thanks for looking.
> 
> > Can you read through 
> > usbdev_mmap() in drivers/usb/core/devio.c, along with the four short 
> > routines preceding it, and let us know if anything seems obviously 
> > wrong?
> 
> All I see is lots of USB code which I don't understand ;) It seems odd

Well, I wouldn't expect you to understand the USB-specific stuff.  I was 
really asking about the memory-management calls and error handling.

> that usbdev_mmap() calls dec_usb_memory_use_count() on some error
> paths, but goes direct to usbfs_decrease_memory_usage() on others.

The paths that call dec_usb_memory_use_count() are those on which a 
memory buffer has been allocated and needs to be deallocated.  That 
routine then calls usbfs_decrease_memory_usage() as needed.

> Did you try running the "C reproducer"?

No, I haven't.  I haven't had much time to work on this.  In fact, I 
couldn't even tell exactly which call in dec_usb_memory_use_count() 
caused the fault; the line number listed in the bug report didn't match 
up with any obvious suspects in my copy of the kernel source.  Was it 
the kfree(usbm) call?

Alan Stern


  reply	other threads:[~2024-11-05 20:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31  4:54 syzbot
2024-11-05  4:00 ` Andrew Morton
2024-11-05 16:39   ` Alan Stern
2024-11-05 19:02     ` Andrew Morton
2024-11-05 20:42       ` Alan Stern [this message]
2024-11-05 21:30         ` Andrew Morton
2024-12-11 15:59 ` syzbot

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=c5a71213-ca55-4165-8e50-2686d05614e3@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=syzbot+ccc0e1cfdb72b664f0d8@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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