mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	reiserfs-devel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Jeff Mahoney <jeffm@suse.com>, Jan Kara <jack@suse.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	syzkaller-bugs@googlegroups.com,
	syzbot+6bd77b88c1977c03f584@syzkaller.appspotmail.com
Subject: Re: [PATCH?] reiserfs: prevent panic: don't allow %-char in journal dev. name
Date: Wed, 4 Apr 2018 18:45:17 -0700	[thread overview]
Message-ID: <20180404184517.9f2b91b856a56f71464f5f7f@linux-foundation.org> (raw)
In-Reply-To: <d9b518a5-287a-72b3-05f1-ea89e25563ba@infradead.org>

On Wed, 4 Apr 2018 18:25:16 -0700 Randy Dunlap <rdunlap@infradead.org> wrote:

> From: Randy Dunlap <rdunlap@infradead.org>
> 
> If the reiserfs mount option's journal name contains a '%' character,
> it can lead to a WARN_ONCE() in lib/vsprintf.c::format_decode(),
> saying: "Please remove unsupported %/ in format string."
> That's OK until panic_on_warn is set, at which point it's dead, Jim.
> 
> To placate this situation, check the journal name string for a '%'
> character and return an error if one is found. Also print a warning
> (one that won't panic the kernel) about the invalid journal name (e.g.):
> 
>   reiserfs: journal device name is invalid: %/file0
> 
> (In this example, the caller app specified the journal device name as
> "%/file0".)
> 

Well, that is a valid filename and we should support it...

Isn't the bug in journal_init_dev()?

--- a/fs/reiserfs/journal.c~a
+++ a/fs/reiserfs/journal.c
@@ -2643,7 +2643,7 @@ static int journal_init_dev(struct super
 	if (IS_ERR(journal->j_dev_bd)) {
 		result = PTR_ERR(journal->j_dev_bd);
 		journal->j_dev_bd = NULL;
-		reiserfs_warning(super,
+		reiserfs_warning(super, "sh-457",
 				 "journal_init_dev: Cannot open '%s': %i",
 				 jdev_name, result);
 		return result;
_

  reply	other threads:[~2018-04-05  1:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05  1:25 Randy Dunlap
2018-04-05  1:45 ` Andrew Morton [this message]
2018-04-05  1:48   ` Jeff Mahoney
2018-04-05  2:05     ` Randy Dunlap
2018-04-09 14:25     ` Jan Kara
2018-04-09 14:30       ` Dmitry Vyukov
2018-04-09 14:34       ` Jan Kara
2018-04-05  9:04   ` Rasmus Villemoes
2018-04-06 13:45     ` Rasmus Villemoes
2018-04-06 16:55     ` Jeff Mahoney

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=20180404184517.9f2b91b856a56f71464f5f7f@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dedekind1@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jack@suse.com \
    --cc=jeffm@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=syzbot+6bd77b88c1977c03f584@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®