LKML Archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: ziy@nvidia.com, linux-mm@kvack.org, fstests@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	willy@infradead.org, hare@suse.de, john.g.garry@oracle.com,
	p.raghav@samsung.com, da.gomez@samsung.com
Subject: Re: [PATCH 1/2] mm/huge_memory: skip invalid debugfs file entry for folio split
Date: Mon, 29 Apr 2024 09:23:07 -0700	[thread overview]
Message-ID: <20240429092307.37bf51c79f70bad4922f6277@linux-foundation.org> (raw)
In-Reply-To: <Zi8cYrtxyO7Uw-Mc@bombadil.infradead.org>

On Sun, 28 Apr 2024 21:04:50 -0700 Luis Chamberlain <mcgrof@kernel.org> wrote:

> On Thu, Apr 25, 2024 at 02:01:26PM -0700, Andrew Morton wrote:
> > On Wed, 24 Apr 2024 15:54:48 -0700 Luis Chamberlain <mcgrof@kernel.org> wrote:
> > 
> > > If the file entry is too long we may easily end up going out of bounds
> > > and crash after strsep() on sscanf(). 
> > > 
> > 
> > Can you explain why?  I'm not seeing it.
> 
> I couldn't see it either but I just looked at the crash below and
> its the only thing I could think of. So I think its when userspace
> somehow abuses MAX_INPUT_BUF_SZ a lot somehow.

This isn't a good basis for making kernel changes :(

Can you investigate a little further please?  What actually is present
at *buf when your new checks succeed?  Could we be seeing 0xNNN,0xNNN
and leaving new_order unaltered?  Or something.

  reply	other threads:[~2024-04-29 16:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 22:54 [PATCH 0/2] mm/huge_memory: couple fixes and one cleanup Luis Chamberlain
2024-04-24 22:54 ` [PATCH 1/2] mm/huge_memory: skip invalid debugfs file entry for folio split Luis Chamberlain
2024-04-25  1:03   ` Zi Yan
2024-04-25 22:40     ` Luis Chamberlain
2024-04-25 21:01   ` Andrew Morton
2024-04-29  4:04     ` Luis Chamberlain
2024-04-29 16:23       ` Andrew Morton [this message]
2024-05-07  0:30         ` Luis Chamberlain
2024-04-24 22:54 ` [PATCH 2/2] mm/huge_memory: cap max length on debugfs file entry " Luis Chamberlain
2024-04-25  1:05   ` Zi Yan
2024-04-24 22:55 ` [PATCH 0/2] mm/huge_memory: couple fixes and one cleanup Luis Chamberlain

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=20240429092307.37bf51c79f70bad4922f6277@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=da.gomez@samsung.com \
    --cc=fstests@vger.kernel.org \
    --cc=hare@suse.de \
    --cc=john.g.garry@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=willy@infradead.org \
    --cc=ziy@nvidia.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).