linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
@ 2020-09-28  7:48 syzbot
  2020-09-28  7:51 ` Dmitry Vyukov
  0 siblings, 1 reply; 6+ messages in thread
From: syzbot @ 2020-09-28  7:48 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    c9c9e6a4 Merge tag 'trace-v5.9-rc5-2' of git://git.kernel...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12e98c8d900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=5f4c828c9e3cef97
dashboard link: https://syzkaller.appspot.com/bug?extid=54b10a5da9e59f1ed979
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=150881c3900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1605b927900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+54b10a5da9e59f1ed979@syzkaller.appspotmail.com

BFS-fs: bfs_fill_super(): WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
  2020-09-28  7:48 WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway syzbot
@ 2020-09-28  7:51 ` Dmitry Vyukov
  2020-09-28  8:23   ` Tigran Aivazian
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Vyukov @ 2020-09-28  7:51 UTC (permalink / raw)
  To: syzbot, Tigran Aivazian; +Cc: LKML, syzkaller-bugs

On Mon, Sep 28, 2020 at 9:48 AM syzbot
<syzbot+54b10a5da9e59f1ed979@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:    c9c9e6a4 Merge tag 'trace-v5.9-rc5-2' of git://git.kernel...
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=12e98c8d900000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=5f4c828c9e3cef97
> dashboard link: https://syzkaller.appspot.com/bug?extid=54b10a5da9e59f1ed979
> compiler:       gcc (GCC) 10.1.0-syz 20200507
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=150881c3900000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1605b927900000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+54b10a5da9e59f1ed979@syzkaller.appspotmail.com
>
> BFS-fs: bfs_fill_super(): WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway

This looks like a BFS issue. +BFS maintainers.

> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
>
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> syzbot can test patches for this issue, for details see:
> https://goo.gl/tpsmEJ#testing-patches
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/000000000000b7551005b05ae3b8%40google.com.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
  2020-09-28  7:51 ` Dmitry Vyukov
@ 2020-09-28  8:23   ` Tigran Aivazian
  2020-09-28  8:29     ` Dmitry Vyukov
  0 siblings, 1 reply; 6+ messages in thread
From: Tigran Aivazian @ 2020-09-28  8:23 UTC (permalink / raw)
  To: Dmitry Vyukov; +Cc: syzbot, LKML, syzkaller-bugs

Hello Dmitry,

On Mon, 28 Sep 2020 at 08:51, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Mon, Sep 28, 2020 at 9:48 AM syzbot
> <syzbot+54b10a5da9e59f1ed979@syzkaller.appspotmail.com> wrote:
> > BFS-fs: bfs_fill_super(): WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
>
> This looks like a BFS issue. +BFS maintainers.

No, this is not an issue. In the latest change to BFS I added the
following comment to the header fs/bfs/bfs.h, which explains it:

/* In theory BFS supports up to 512 inodes, numbered from 2 (for /) up
to 513 inclusive.
   In actual fact, attempting to create the 512th inode (i.e. inode
No. 513 or file No. 511)
   will fail with ENOSPC in bfs_add_entry(): the root directory cannot
contain so many entries, counting '..'.
   So, mkfs.bfs(8) should really limit its -N option to 511 and not
512. For now, we just print a warning
   if a filesystem is mounted with such "impossible to fill up" number
of inodes */

Kind regards,
Tigran

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
  2020-09-28  8:23   ` Tigran Aivazian
@ 2020-09-28  8:29     ` Dmitry Vyukov
  2020-09-28  9:08       ` Tigran Aivazian
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Vyukov @ 2020-09-28  8:29 UTC (permalink / raw)
  To: Tigran Aivazian; +Cc: syzbot, LKML, syzkaller-bugs

On Mon, Sep 28, 2020 at 10:23 AM Tigran Aivazian
<aivazian.tigran@gmail.com> wrote:
>
> Hello Dmitry,
>
> On Mon, 28 Sep 2020 at 08:51, Dmitry Vyukov <dvyukov@google.com> wrote:
> > On Mon, Sep 28, 2020 at 9:48 AM syzbot
> > <syzbot+54b10a5da9e59f1ed979@syzkaller.appspotmail.com> wrote:
> > > BFS-fs: bfs_fill_super(): WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
> >
> > This looks like a BFS issue. +BFS maintainers.
>
> No, this is not an issue. In the latest change to BFS I added the
> following comment to the header fs/bfs/bfs.h, which explains it:
>
> /* In theory BFS supports up to 512 inodes, numbered from 2 (for /) up
> to 513 inclusive.
>    In actual fact, attempting to create the 512th inode (i.e. inode
> No. 513 or file No. 511)
>    will fail with ENOSPC in bfs_add_entry(): the root directory cannot
> contain so many entries, counting '..'.
>    So, mkfs.bfs(8) should really limit its -N option to 511 and not
> 512. For now, we just print a warning
>    if a filesystem is mounted with such "impossible to fill up" number
> of inodes */

Hi Tigran,

There are rules for use of "WARNING" in output required to support
kernel testing:
https://github.com/torvalds/linux/blob/master/include/asm-generic/bug.h#L67-L80
This seems to be triggerable by exteranal inputs and breaks these rules.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
  2020-09-28  8:29     ` Dmitry Vyukov
@ 2020-09-28  9:08       ` Tigran Aivazian
  2020-12-07 13:13         ` Dmitry Vyukov
  0 siblings, 1 reply; 6+ messages in thread
From: Tigran Aivazian @ 2020-09-28  9:08 UTC (permalink / raw)
  To: Dmitry Vyukov; +Cc: syzbot, LKML, syzkaller-bugs

On Mon, 28 Sep 2020 at 09:29, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Mon, Sep 28, 2020 at 10:23 AM Tigran Aivazian
> > No, this is not an issue. In the latest change to BFS I added the
> > following comment to the header fs/bfs/bfs.h, which explains it:
> >
> > /* In theory BFS supports up to 512 inodes, numbered from 2 (for /) up
> > to 513 inclusive.
> >    In actual fact, attempting to create the 512th inode (i.e. inode
> > No. 513 or file No. 511)
> >    will fail with ENOSPC in bfs_add_entry(): the root directory cannot
> > contain so many entries, counting '..'.
> >    So, mkfs.bfs(8) should really limit its -N option to 511 and not
> > 512. For now, we just print a warning
> >    if a filesystem is mounted with such "impossible to fill up" number
> > of inodes */
>
> There are rules for use of "WARNING" in output required to support
> kernel testing:
> https://github.com/torvalds/linux/blob/master/include/asm-generic/bug.h#L67-L80
> This seems to be triggerable by exteranal inputs and breaks these rules.

Thank you, I didn't know about these rules. Ok, then, since this
warning does not "need prompt attention if it should ever occur at
runtime", the easiest solution is to change "WARNING" to lower case
"warning" in that printk in fs/bfs/inode.c:

--- fs/bfs/inode.c.0 2020-09-28 10:03:00.658549556 +0100
+++ fs/bfs/inode.c 2020-09-28 10:03:05.408548250 +0100
@@ -351,7 +351,7 @@

  info->si_lasti = (le32_to_cpu(bfs_sb->s_start) - BFS_BSIZE) /
sizeof(struct bfs_inode) + BFS_ROOT_INO - 1;
  if (info->si_lasti == BFS_MAX_LASTI)
- printf("WARNING: filesystem %s was created with 512 inodes, the real
maximum is 511, mounting anyway\n", s->s_id);
+ printf("warning: filesystem %s was created with 512 inodes, the real
maximum is 511, mounting anyway\n", s->s_id);
  else if (info->si_lasti > BFS_MAX_LASTI) {
  printf("Impossible last inode number %lu > %d on %s\n",
info->si_lasti, BFS_MAX_LASTI, s->s_id);
  goto out1;

If you want to submit this patch to the appropriate place(s), feel
free to do this -- I approve it. If the comment in asm/bug.h is
inaccurate and its mention of "BUG/WARNING" implies the lowercase
"bug/warning" also, then one can remove the prefix "warning: " from
the patch altogether and proper case "filesystem" to "Filesystem".

Kind regards,
Tigran

Acked-By: Tigran Aivazian <aivazian.tigran@gmail.com>
Approved-By: Tigran Aivazian <aivazian.tigran@gmail.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway
  2020-09-28  9:08       ` Tigran Aivazian
@ 2020-12-07 13:13         ` Dmitry Vyukov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Vyukov @ 2020-12-07 13:13 UTC (permalink / raw)
  To: Tigran Aivazian; +Cc: syzbot, LKML, syzkaller-bugs

On Mon, Sep 28, 2020 at 11:08 AM Tigran Aivazian
<aivazian.tigran@gmail.com> wrote:
>
> On Mon, 28 Sep 2020 at 09:29, Dmitry Vyukov <dvyukov@google.com> wrote:
> > On Mon, Sep 28, 2020 at 10:23 AM Tigran Aivazian
> > > No, this is not an issue. In the latest change to BFS I added the
> > > following comment to the header fs/bfs/bfs.h, which explains it:
> > >
> > > /* In theory BFS supports up to 512 inodes, numbered from 2 (for /) up
> > > to 513 inclusive.
> > >    In actual fact, attempting to create the 512th inode (i.e. inode
> > > No. 513 or file No. 511)
> > >    will fail with ENOSPC in bfs_add_entry(): the root directory cannot
> > > contain so many entries, counting '..'.
> > >    So, mkfs.bfs(8) should really limit its -N option to 511 and not
> > > 512. For now, we just print a warning
> > >    if a filesystem is mounted with such "impossible to fill up" number
> > > of inodes */
> >
> > There are rules for use of "WARNING" in output required to support
> > kernel testing:
> > https://github.com/torvalds/linux/blob/master/include/asm-generic/bug.h#L67-L80
> > This seems to be triggerable by exteranal inputs and breaks these rules.
>
> Thank you, I didn't know about these rules. Ok, then, since this
> warning does not "need prompt attention if it should ever occur at
> runtime", the easiest solution is to change "WARNING" to lower case
> "warning" in that printk in fs/bfs/inode.c:
>
> --- fs/bfs/inode.c.0 2020-09-28 10:03:00.658549556 +0100
> +++ fs/bfs/inode.c 2020-09-28 10:03:05.408548250 +0100
> @@ -351,7 +351,7 @@
>
>   info->si_lasti = (le32_to_cpu(bfs_sb->s_start) - BFS_BSIZE) /
> sizeof(struct bfs_inode) + BFS_ROOT_INO - 1;
>   if (info->si_lasti == BFS_MAX_LASTI)
> - printf("WARNING: filesystem %s was created with 512 inodes, the real
> maximum is 511, mounting anyway\n", s->s_id);
> + printf("warning: filesystem %s was created with 512 inodes, the real
> maximum is 511, mounting anyway\n", s->s_id);
>   else if (info->si_lasti > BFS_MAX_LASTI) {
>   printf("Impossible last inode number %lu > %d on %s\n",
> info->si_lasti, BFS_MAX_LASTI, s->s_id);
>   goto out1;
>
> If you want to submit this patch to the appropriate place(s), feel
> free to do this -- I approve it. If the comment in asm/bug.h is
> inaccurate and its mention of "BUG/WARNING" implies the lowercase
> "bug/warning" also, then one can remove the prefix "warning: " from
> the patch altogether and proper case "filesystem" to "Filesystem".
>
> Kind regards,
> Tigran
>
> Acked-By: Tigran Aivazian <aivazian.tigran@gmail.com>
> Approved-By: Tigran Aivazian <aivazian.tigran@gmail.com>


#syz fix: bfs: don't use WARNING: string when it's just info.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-07 13:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28  7:48 WARNING: filesystem loop0 was created with 512 inodes, the real maximum is 511, mounting anyway syzbot
2020-09-28  7:51 ` Dmitry Vyukov
2020-09-28  8:23   ` Tigran Aivazian
2020-09-28  8:29     ` Dmitry Vyukov
2020-09-28  9:08       ` Tigran Aivazian
2020-12-07 13:13         ` Dmitry Vyukov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).