From: Guoyu Yin <y04609127@gmail.com>
To: akpm@linux-foundation.org
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [BUG] WARNING in gup_vma_lookup
Date: Thu, 15 May 2025 19:22:31 +0800 [thread overview]
Message-ID: <CAJNGr6tvycbeVx+C_ER-BDPsRK3M76B2ufQLDSvC79mUKwMGSA@mail.gmail.com> (raw)
Hi,
This crash occurs due to a mismatched symlink length validation in
ext4 when handling corrupted inode data, combined with improper stack
expansion handling in GUP. The crash can be reproduced through
syzkaller's filesystem stress tests involving symlink operations and
direct I/O writes.
The key issues are:
1. In __ext4_iget() at fs/ext4/inode.c:5012:
inode_set_cached_link() triggers a warning when detecting a symlink
with actual length 39 bytes while expecting 29 bytes. This indicates
either disk corruption or a kernel bug in symlink length handling. The
problem likely stems from improper validation of i_extra_isize and
fast symlink storage in ext4_inode.
2. In gup_vma_lookup() at mm/gup.c:1362:
The warning "GUP no longer grows the stack" appears when handling VMA
lookups for addresses below the stack region. This occurs during
direct I/O writes (ext4_dio_write_iter) when pin_user_pages_fast()
attempts to access user memory near stack boundaries, but the kernel
refuses to expand the stack automatically.
Suggested fixes:
1. For ext4: Add stronger validation of i_extra_isize and inline data
size before calling inode_set_cached_link() in __ext4_iget
2. For GUP: Re-examine the stack growth policy when handling direct
I/O operations near stack boundaries to avoid filesystem corruption
cascades
This can be reproduced on:
HEAD commit:
38fec10eb60d687e30c8c6b5420d86e8149f7557
report: https://pastebin.com/raw/wDUgDsV0
console output : https://pastebin.com/raw/HndaBU1E
kernel config : https://pastebin.com/raw/u0Efyj5P
C reproducer :
part1: https://pastebin.com/raw/3AA1ZHUd
part2: https://pastebin.com/raw/0LaFkaAd
reply other threads:[~2025-05-15 11:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=CAJNGr6tvycbeVx+C_ER-BDPsRK3M76B2ufQLDSvC79mUKwMGSA@mail.gmail.com \
--to=y04609127@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=akpm@linux-foundation.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tytso@mit.edu \
/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