cifs: fix oops on mount when CONFIG_CIFS_DFS_UPCALL is enabled
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 cifs: fix oops on mount when CONFIG_CIFS_DFS_UPCALL is enabled
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 <[email protected]>
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
ACK
Quoted 53 lines · On Mon, Jun 9, 2008 at 6:48 PM, <[email protected]> wrote:
From: Marcin Slusarz <[email protected]>
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=oopsSigned-off-by Marcin Slusarz <[email protected]>Cc Steve French <[email protected]>Cc <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
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-enabledfs/cifs/cifsfs.cfs/cifs/cifsfs.c renamed from fs/cifs/cifsfs.c~cifs-fix-oops-on-mount-when-config_cifs_dfs_upcall-is-enabled +10
-11@@ -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);
Quoted 2 lines
_
--
Thanks,
Steve
Signature · 3 lines
Thanks, Steve
Quoted 1 line · On Tue, 10 Jun 2008 12:14:26 -0500 "Steve French" <[email protected]> wrote:
From: "Steve French" <[email protected]>
argh. [email protected] == [email protected] == [email protected].
This always bugs me because I never know which is preferred, most reliable, least likely to get mangled, etc.
Quoted 10 lines
To: "Jeff Layton" <[email protected]>, [email protected], "Andrew Morton" <[email protected]>, LKML <[email protected]>
Subject: Fwd: [patch (for 2.6.26?) 1/1] cifs: fix oops on mount whenCONFIG_CIFS_DFS_UPCALLis enabled
Date: Tue, 10 Jun 2008 12:14:26 -0500I 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).
I'll send this on to Linus and [email protected] in my next batch.
Quoted 10 lines
---------- Forwarded message ----------
From: Steve French <[email protected]>
Date: Tue, Jun 10, 2008 at 11:47 AM
Subject: Re: [patch (for 2.6.26?) 1/1] cifs: fix oops on mount whenCONFIG_CIFS_DFS_UPCALLis enabled
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]ACK
Please don't top-post. It really does make it hard to keep things vaguely coherent?