mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Steve French" <smfrench@gmail.com>
To: "Jeff Layton" <jlayton@redhat.com>,
	marcin.slusarz@gmail.com,
	"Andrew Morton" <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Fwd: [patch (for 2.6.26?) 1/1] cifs: fix oops on mount when CONFIG_CIFS_DFS_UPCALL is enabled
Date: Tue, 10 Jun 2008 12:14:26 -0500	[thread overview]
Message-ID: <524f69650806101014r6a068a7dvacb7fba58a230a63@mail.gmail.com> (raw)
In-Reply-To: <524f69650806100947g4392b44es12b800e39a406d75@mail.gmail.com>

I don't have the original note (ie patch without whitespace mangled by
the mailers) that I can ack to Linus on this but would like it merged
into mainline as an individual patch (my cifs-2.6.git tree has
additional patches in it that I don't want to merged into
linux-2.6.git yet).


---------- Forwarded message ----------
From: Steve French <smfrench@gmail.com>
Date: Tue, Jun 10, 2008 at 11:47 AM
Subject: Re: [patch (for 2.6.26?) 1/1] cifs: fix oops on mount when
CONFIG_CIFS_DFS_UPCALL is enabled
To: akpm@linux-foundation.org
Cc: sfrench@us.ibm.com, marcin.slusarz@gmail.com, sfrench@samba.org,
stable@kernel.org


ACK

On Mon, Jun 9, 2008 at 6:48 PM,  <akpm@linux-foundation.org> wrote:
> From: Marcin Slusarz <marcin.slusarz@gmail.com>
>
> simple "mount -t cifs //xxx /mnt" oopsed on strlen of options
> http://kerneloops.org/guilty.php?guilty=cifs_get_sb&version=2.6.25-release&start=1671168&end=1703935&class=oops
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> Cc: Steve French <sfrench@samba.org>
> Cc: <stable@kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
>  fs/cifs/cifsfs.c |   21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff -puN fs/cifs/cifsfs.c~cifs-fix-oops-on-mount-when-config_cifs_dfs_upcall-is-enabled fs/cifs/cifsfs.c
> --- a/fs/cifs/cifsfs.c~cifs-fix-oops-on-mount-when-config_cifs_dfs_upcall-is-enabled
> +++ a/fs/cifs/cifsfs.c
> @@ -124,9 +124,6 @@ cifs_read_super(struct super_block *sb,
>  {
>        struct inode *inode;
>        struct cifs_sb_info *cifs_sb;
> -#ifdef CONFIG_CIFS_DFS_UPCALL
> -       int len;
> -#endif
>        int rc = 0;
>
>        /* BB should we make this contingent on mount parm? */
> @@ -144,15 +141,17 @@ cifs_read_super(struct super_block *sb,
>         * complex operation (mount), and in case of fail
>         * just exit instead of doing mount and attempting
>         * undo it if this copy fails?*/
> -       len = strlen(data);
> -       cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
> -       if (cifs_sb->mountdata == NULL) {
> -               kfree(sb->s_fs_info);
> -               sb->s_fs_info = NULL;
> -               return -ENOMEM;
> +       if (data) {
> +               int len = strlen(data);
> +               cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
> +               if (cifs_sb->mountdata == NULL) {
> +                       kfree(sb->s_fs_info);
> +                       sb->s_fs_info = NULL;
> +                       return -ENOMEM;
> +               }
> +               strncpy(cifs_sb->mountdata, data, len + 1);
> +               cifs_sb->mountdata[len] = '\0';
>        }
> -       strncpy(cifs_sb->mountdata, data, len + 1);
> -       cifs_sb->mountdata[len] = '\0';
>  #endif
>
>        rc = cifs_mount(sb, cifs_sb, data, devname);
> _
>



--
Thanks,

Steve



-- 
Thanks,

Steve

       reply	other threads:[~2008-06-10 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200806092348.m59NmsZd015641@imap1.linux-foundation.org>
     [not found] ` <524f69650806100947g4392b44es12b800e39a406d75@mail.gmail.com>
2008-06-10 17:14   ` Steve French [this message]
2008-06-10 21:10     ` Andrew Morton

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=524f69650806101014r6a068a7dvacb7fba58a230a63@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.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 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®