Bug 7315 - mount.cifs segfaults after upgrade to 2.6.33
Summary: mount.cifs segfaults after upgrade to 2.6.33
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.5.1
Hardware: x86 Linux
: P3 major
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
: 7205 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-01 07:23 UTC by tomekk
Modified: 2010-05-27 04:58 UTC (History)
3 users (show)

See Also:
sfrench: review+


Attachments
patch -- check for NULL addr pointer before handling scopeid (837 bytes, patch)
2010-05-12 06:06 UTC, Jeff Layton
jlayton: review+
jlayton: review? (sfrench)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tomekk 2010-04-01 07:23:27 UTC
Hey

I'm using slackware-current with my own kernel 2.6.33

When I try to mount remote share I get this:
[root@zonk]:/home# mount.cifs //server/home /mnt/server/ -o ip=10.0.1.1,guest
Segmentation fault

After some retries, dmesg output:
[tomekk@zonk]:/# dmesg | tail -n 6
mount.cifs[26159]: segfault at 14 ip b77a9693 sp bfa9b200 error 4 in mount.cifs[b77a5000+7000]
mount.cifs[26399]: segfault at 14 ip b7739693 sp bfd4a7d0 error 4 in mount.cifs[b7735000+7000]
mount.cifs[27604]: segfault at 14 ip b7887693 sp bfe787c0 error 4 in mount.cifs[b7883000+7000]
mount.cifs[27745]: segfault at 14 ip b7828693 sp bfdcd060 error 4 in mount.cifs[b7824000+7000]
mount.cifs[6355]: segfault at 14 ip b77fa693 sp bfc8c2f0 error 4 in mount.cifs[b77f6000+7000]
mount.cifs[6609]: segfault at 14 ip b78f5693 sp bf9d50e0 error 4 in mount.cifs[b78f1000+7000]

On the previous kernel all were OK.

Any solution?

Best regards
tomekk
Comment 1 Karolin Seeger 2010-05-12 03:42:16 UTC
Reassigning to Jeff and changing the component.
Comment 2 Jeff Layton 2010-05-12 05:49:58 UTC
What version of mount.cifs do you have? Can you run:

# mount.cifs -V

and paste the output here? I believe the problem is likely an older bug fixed by this commit in the cifs-utils repo:

commit cff3f7cb2b94aec118f27ee8dd904ef216489938
Author: Jeff Layton <jlayton@redhat.com>
Date:   Sun Mar 7 18:49:33 2010 -0500

    mount.cifs: check for NULL addr pointer before handling scopeid
    
    Signed-off-by: Jeff Layton <jlayton@redhat.com>

Comment 3 tomekk 2010-05-12 05:55:50 UTC
[root@zonk]:/home# mount.cifs -V
mount.cifs version: 1.14-3.5.2
Comment 4 Jeff Layton 2010-05-12 06:06:33 UTC
Created attachment 5699 [details]
patch -- check for NULL addr pointer before handling scopeid

Known problem, I think. We just haven't pushed this patch into 3.5. Can you test this patch and see if it resolves the issue for you?
Comment 5 Jeff Layton 2010-05-12 06:11:01 UTC
cc'ing Steve so he can review the patch and Karolin since we'll need to push this into v3.5.
Comment 6 Jeff Layton 2010-05-12 06:12:18 UTC
Comment on attachment 5699 [details]
patch -- check for NULL addr pointer before handling scopeid

Steve, could you review this patch for the mount.cifs still shipping in the older samba releases? It's a pretty straightforward NULL pointer check.
Comment 7 Jeff Layton 2010-05-12 06:15:35 UTC
BTW, I don't think the kernel really matters for this. Did you happen to upgrade mount.cifs at the same time you upgraded your kernel?
Comment 8 tomekk 2010-05-12 06:33:17 UTC
I've just recompiled samba with your patch manually,

[root@zonk]:/tmp# mount | grep server
//server/home on /mnt/server type cifs (rw,mand)

the patch did the job

>> Did you happen to upgrade mount.cifs at the same time you upgraded your kernel?
I just upgraded the kernel, but the samba was the same like before, from current tree.
Comment 9 tomekk 2010-05-12 06:47:14 UTC
i've recompiled samba without your patch,unfortunatly:
mount.cifs[15565]: segfault at 14 ip b7752881 sp bfdc08d0 error 4 in mount.cifs[b774e000+8000]

Then, your patch is OK.

Thanks.
Best regards,
tomekk
Comment 10 Steve French 2010-05-12 13:11:42 UTC
Reviewed-by: Steve French <sfrench@us.ibm.com>
Comment 11 Jeff Layton 2010-05-12 13:23:44 UTC
Karolin, steve reviewed the patch. Anything else we need to do to get it into 3.5?
Comment 12 Jeff Layton 2010-05-12 13:26:04 UTC
Comment on attachment 5699 [details]
patch -- check for NULL addr pointer before handling scopeid

Setting flag to '+' based on Steve's comment.
Comment 13 Guenther Deschner 2010-05-12 16:00:11 UTC
reassigning to karolin for inclusion in next 3.5 release
Comment 14 Karolin Seeger 2010-05-17 02:25:06 UTC
(In reply to comment #11)
> Karolin, steve reviewed the patch. Anything else we need to do to get it into
> 3.5?
> 

A positive feedback and reassigning to me is perfectly fine, thanks!
Comment 15 Karolin Seeger 2010-05-17 02:25:36 UTC
Pushed to v3-5-test.
Will be included in 3.5.3.
Closing out bug report.

Thanks!
Comment 16 Karolin Seeger 2010-05-27 04:58:39 UTC
*** Bug 7205 has been marked as a duplicate of this bug. ***