From: Anmol Karn <anmol.karan123@gmail.com> To: willy@infradead.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, anmol.karan123@gmail.com, syzbot+f7204dcf3df4bb4ce42c@syzkaller.appspotmail.com Subject: [Linux-kernel-mentees] [PATCH] idr: remove WARN_ON_ONCE() when trying to check id Date: Mon, 14 Sep 2020 12:47:24 +0530 [thread overview] Message-ID: <20200914071724.202365-1-anmol.karan123@gmail.com> (raw) idr_get_next() gives WARN_ON_ONCE() when it gets (id > INT_MAX) true and this happens when syzbot does fuzzing, and that warning is expected, but WARN_ON_ONCE() is not required here and, cecking the condition and returning NULL value would be suffice. Reference: commit b9959c7a347 ("filldir[64]: remove WARN_ON_ONCE() for bad directory entries") Reported-and-tested-by: syzbot+f7204dcf3df4bb4ce42c@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=f7204dcf3df4bb4ce42c Signed-off-by: Anmol Karn <anmol.karan123@gmail.com> --- lib/idr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/idr.c b/lib/idr.c index 4d2eef0259d2..7c67560c1ecd 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -266,7 +266,7 @@ void *idr_get_next(struct idr *idr, int *nextid) unsigned long id = *nextid; void *entry = idr_get_next_ul(idr, &id); - if (WARN_ON_ONCE(id > INT_MAX)) + if (id > INT_MAX) return NULL; *nextid = id; return entry; -- 2.28.0
WARNING: multiple messages have this Message-ID (diff)
From: Anmol Karn <anmol.karan123@gmail.com> To: willy@infradead.org Cc: linux-fsdevel@vger.kernel.org, syzbot+f7204dcf3df4bb4ce42c@syzkaller.appspotmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [Linux-kernel-mentees] [PATCH] idr: remove WARN_ON_ONCE() when trying to check id Date: Mon, 14 Sep 2020 12:47:24 +0530 [thread overview] Message-ID: <20200914071724.202365-1-anmol.karan123@gmail.com> (raw) idr_get_next() gives WARN_ON_ONCE() when it gets (id > INT_MAX) true and this happens when syzbot does fuzzing, and that warning is expected, but WARN_ON_ONCE() is not required here and, cecking the condition and returning NULL value would be suffice. Reference: commit b9959c7a347 ("filldir[64]: remove WARN_ON_ONCE() for bad directory entries") Reported-and-tested-by: syzbot+f7204dcf3df4bb4ce42c@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=f7204dcf3df4bb4ce42c Signed-off-by: Anmol Karn <anmol.karan123@gmail.com> --- lib/idr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/idr.c b/lib/idr.c index 4d2eef0259d2..7c67560c1ecd 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -266,7 +266,7 @@ void *idr_get_next(struct idr *idr, int *nextid) unsigned long id = *nextid; void *entry = idr_get_next_ul(idr, &id); - if (WARN_ON_ONCE(id > INT_MAX)) + if (id > INT_MAX) return NULL; *nextid = id; return entry; -- 2.28.0 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next reply other threads:[~2020-09-14 7:17 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-14 7:17 Anmol Karn [this message] 2020-09-14 7:17 ` [Linux-kernel-mentees] [PATCH] idr: remove WARN_ON_ONCE() when trying to check id Anmol Karn 2020-09-14 11:08 ` Matthew Wilcox 2020-09-14 11:08 ` Matthew Wilcox 2020-09-14 18:47 ` Anmol Karn 2020-09-14 18:47 ` Anmol Karn 2020-09-14 19:26 ` Matthew Wilcox 2020-09-14 19:26 ` Matthew Wilcox 2020-09-15 5:13 ` Anmol Karn 2020-09-15 5:13 ` Anmol Karn 2020-09-15 5:26 ` Eric Biggers 2020-09-15 5:26 ` [Linux-kernel-mentees] " Eric Biggers 2020-09-15 5:51 ` Anmol Karn 2020-09-15 5:51 ` [Linux-kernel-mentees] " Anmol Karn
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=20200914071724.202365-1-anmol.karan123@gmail.com \ --to=anmol.karan123@gmail.com \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel-mentees@lists.linuxfoundation.org \ --cc=linux-kernel@vger.kernel.org \ --cc=syzbot+f7204dcf3df4bb4ce42c@syzkaller.appspotmail.com \ --cc=willy@infradead.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.