From: Randy Dunlap <rdunlap@infradead.org>
To: Jeff Mahoney <jeffm@suse.com>, Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
reiserfs-devel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
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 19:05:31 -0700 [thread overview]
Message-ID: <e1d9b08a-4510-df2e-9731-4ff157834320@infradead.org> (raw)
In-Reply-To: <5e9ea36a-6a6a-921c-81b3-bc623a9e125a@suse.com>
On 04/04/2018 06:48 PM, Jeff Mahoney wrote:
> On 4/4/18 9:45 PM, Andrew Morton wrote:
>> 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()?
OK, thanks.
> Yep. That's exactly it.
>
> Acked-by: Jeff Mahoney <jeffm@suse.com>
>
> Thanks,
>
> -Jeff
>
>> --- 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;
>> _
>>
>>
>
>
--
~Randy
next prev parent reply other threads:[~2018-04-05 2:05 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
2018-04-05 1:48 ` Jeff Mahoney
2018-04-05 2:05 ` Randy Dunlap [this message]
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=e1d9b08a-4510-df2e-9731-4ff157834320@infradead.org \
--to=rdunlap@infradead.org \
--cc=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=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®