From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: syzbot <syzbot+f1d7fb4f94764243d23e@syzkaller.appspotmail.com>,
"airlied@redhat.com" <airlied@redhat.com>,
"kraxel@redhat.com" <kraxel@redhat.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"muchun.song@linux.dev" <muchun.song@linux.dev>,
"syzkaller-bugs@googlegroups.com"
<syzkaller-bugs@googlegroups.com>
Subject: RE: [syzbot] [fs?] [mm?] INFO: task hung in remove_inode_hugepages
Date: Tue, 9 Jul 2024 21:36:00 +0000 [thread overview]
Message-ID: <IA0PR11MB71850525CBC7D541CAB45DF1F8DB2@IA0PR11MB7185.namprd11.prod.outlook.com> (raw)
In-Reply-To: <000000000000da3147061ccb5b55@google.com>
Hi Andrew,
>
> Hello,
>
> syzbot has tested the proposed patch and the reproducer did not trigger any
> issue:
>
> Reported-and-tested-by:
> syzbot+f1d7fb4f94764243d23e@syzkaller.appspotmail.com
>
> Tested on:
>
> commit: 581a87b1 fixup! mm/gup: introduce memfd_pin_folios() f..
> git tree: https://gitlab.freedesktop.org/Vivek/drm-tip.git
> syzbot_fix_remove_inode
How do you prefer to take the following short fix for this issue?
commit 581a87b19b3739da8c10750b499c55062ea54bf4
Author: Vivek Kasireddy <vivek.kasireddy@intel.com>
Date: Mon Jul 8 23:04:48 2024 -0700
fixup! mm/gup: introduce memfd_pin_folios() for pinning memfd folios
Return -EINVAL if the end offset is greater than the size of memfd.
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
diff --git a/mm/gup.c b/mm/gup.c
index 43f6d2f689d2..54d0dc3831fb 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -3630,6 +3630,9 @@ long memfd_pin_folios(struct file *memfd, loff_t start, loff_t end,
if (!shmem_file(memfd) && !is_file_hugepages(memfd))
return -EINVAL;
+ if (end >= i_size_read(file_inode(memfd)))
+ return -EINVAL;
+
if (is_file_hugepages(memfd)) {
h = hstate_file(memfd);
Thanks,
Vivek
> console output: https://syzkaller.appspot.com/x/log.txt?x=145a8535980000
> kernel config: https://syzkaller.appspot.com/x/.config?x=409b5fcdf33b7555
> dashboard link:
> https://syzkaller.appspot.com/bug?extid=f1d7fb4f94764243d23e
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian)
> 2.40
>
> Note: no patches were applied.
> Note: testing is done by a robot and is best-effort only.
prev parent reply other threads:[~2024-07-09 21:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 18:11 syzbot
2024-07-09 6:39 ` Kasireddy, Vivek
2024-07-09 7:20 ` syzbot
2024-07-09 21:36 ` Kasireddy, Vivek [this message]
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=IA0PR11MB71850525CBC7D541CAB45DF1F8DB2@IA0PR11MB7185.namprd11.prod.outlook.com \
--to=vivek.kasireddy@intel.com \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=kraxel@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=syzbot+f1d7fb4f94764243d23e@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