All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: syzbot <syzbot+4c50ac32e5b10e4133e1@syzkaller.appspotmail.com>,
	andriin@fb.com, ast@kernel.org, axboe@kernel.dk,
	bpf@vger.kernel.org, daniel@iogearbox.net,
	john.fastabend@gmail.com, kafai@fb.com, kpsingh@chromium.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, songliubraving@fb.com,
	syzkaller-bugs@googlegroups.com, yhs@fb.com
Subject: Re: WARNING in submit_bio_checks
Date: Mon, 13 Jul 2020 09:16:14 -0700	[thread overview]
Message-ID: <20200713161614.GC1696@sol.localdomain> (raw)
In-Reply-To: <20200713101836.GA536@infradead.org>

On Mon, Jul 13, 2020 at 11:18:36AM +0100, Christoph Hellwig wrote:
> On Fri, Jul 10, 2020 at 10:34:19PM -0700, syzbot wrote:
> > Hello,
> > 
> > syzbot found the following crash on:
> 
> This is not a crash, but a WARN_ONCE.  A pre-existing one that just
> slightly changed the printed message recently.
> 

It doesn't really matter.  WARN is for indicating kernel bugs only.
A user-triggable WARN is a bug.  Either the bug that makes the WARN
reachable needs to be fixed, or if the WARN is legitimately user-reachable
it needs to be removed or replaced with a proper ratelimited log message.

This one looks legitimately user-reachable, so we could do:

diff --git a/block/blk-core.c b/block/blk-core.c
index d9d632639bd1..354c51ad5c81 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -854,8 +854,8 @@ static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part)
 		if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
 			return false;
 
-		WARN_ONCE(1,
-		       "Trying to write to read-only block-device %s (partno %d)\n",
+		pr_warn_ratelimited(
+		       "block: trying to write to read-only block-device %s (partno %d)\n",
 			bio_devname(bio, b), part->partno);
 		/* Older lvm-tools actually trigger this */
 		return false;


We could also show current->comm and current->pid if they would be useful here.

And yes, this is preexisting which is why syzbot has reported this before
(https://syzkaller.appspot.com/bug?id=79eda145ab047a0dc7d03ca5fcb1cf12206eb481).
Just no one has bothered to fix it yet.

- Eric

  reply	other threads:[~2020-07-13 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-11  5:34 WARNING in submit_bio_checks syzbot
2020-07-13 10:18 ` Christoph Hellwig
2020-07-13 16:16   ` Eric Biggers [this message]
2020-07-16  5:00 ` syzbot
2021-09-03  7:41 Hao Sun

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=20200713161614.GC1696@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hch@infradead.org \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=syzbot+4c50ac32e5b10e4133e1@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=yhs@fb.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 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.