[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <IA0PR11MB71850525CBC7D541CAB45DF1F8DB2@IA0PR11MB7185.namprd11.prod.outlook.com>
Date: Tue, 9 Jul 2024 21:36:00 +0000
From: "Kasireddy, Vivek" <vivek.kasireddy@...el.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: syzbot <syzbot+f1d7fb4f94764243d23e@...kaller.appspotmail.com>,
"airlied@...hat.com" <airlied@...hat.com>, "kraxel@...hat.com"
<kraxel@...hat.com>, "linux-fsdevel@...r.kernel.org"
<linux-fsdevel@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-mm@...ck.org" <linux-mm@...ck.org>,
"muchun.song@...ux.dev" <muchun.song@...ux.dev>,
"syzkaller-bugs@...glegroups.com" <syzkaller-bugs@...glegroups.com>
Subject: RE: [syzbot] [fs?] [mm?] INFO: task hung in remove_inode_hugepages
Hi Andrew,
>
> Hello,
>
> syzbot has tested the proposed patch and the reproducer did not trigger any
> issue:
>
> Reported-and-tested-by:
> syzbot+f1d7fb4f94764243d23e@...kaller.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@...el.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@...el.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.
Powered by blists - more mailing lists