All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: Check fsname's length in get_filesystem_list().
Date: Thu, 9 Apr 2009 22:02:13 +0100	[thread overview]
Message-ID: <20090409210213.GG26366@ZenIV.linux.org.uk> (raw)
In-Reply-To: <200904092018.GDD69286.OVOLJSFtFOQMHF@I-love.SAKURA.ne.jp>

On Thu, Apr 09, 2009 at 08:18:11PM +0900, Tetsuo Handa wrote:
> Since "struct file_system_type"->name does not limit the max length,
> one might pass a name with strlen(name) >= 80.
> 
>   while (tmp && len < PAGE_SIZE - 80) {
>           len += sprintf(buf+len, "%s\t%s\n",
>                   (tmp->fs_flags & FS_REQUIRES_DEV) ? "" : "nodev",
>                   tmp->name);
> 
> This can cause buffer overrun if somebody builts in very very long filesystem
> name (as shown in example code below); although unlikely happens, for
> get_filesystem_list() is called only once upon boot.

Doctor, it hurts when I do it...

      reply	other threads:[~2009-04-09 21:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-09 11:18 [PATCH] fs: Check fsname's length in get_filesystem_list() Tetsuo Handa
2009-04-09 21:02 ` Al Viro [this message]

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=20090409210213.GG26366@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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.