Bug 7205 - [samba] mount.cifs seg fault during mount share
[samba] mount.cifs seg fault during mount share
Status: RESOLVED DUPLICATE of bug 7315
Product: Samba 3.5
Classification: Unclassified
Component: Client Tools
3.5.0
x86 Linux
: P3 major
: ---
Assigned To: Jeff Layton
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-03 10:04 UTC by Alexander
Modified: 2010-05-27 04:58 UTC (History)
0 users

See Also:


Attachments
Patch that fixed this issue (421 bytes, patch)
2010-03-03 10:06 UTC, Alexander
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander 2010-03-03 10:04:11 UTC
Description:
Missing ptr check in mount.cifs.c at line 1566, so on my systen withour ipv6 it couse segfault when I try to mount samba shares.

My patch, that solve problem publish below.

Additional info:
* Distr: Arch Linux
* package version(s): smbclient (samba) 3.5.0-1, kernel26 2.6.32.9-1, glibc 2.11.1-1
* config and/or log files etc: default configs


Steps to reproduce:
1. disable ipv6
1.1. network without ipv6 hosts
2. run command similar to:
sudo mount.cifs //GAZ/torrents /home/hatred/smb4k/GAZ/torrents -o uid=1000,gid=101,port=445,rw,file_mode=0644,dir_mode=0755,perm,nosetuids,noserverino,nomapchars,iocharset=utf8,domain=GAZHOME,ip=192.168.1.2,guest

Patch, that solve this issue:
~~~~~~~~~~~~~~~~~~~~~~~ begin cut here ~~~~~~~~~~~~~~~~~~~~~~~
--- mount.cifs.c.orig	2010-03-03 13:42:02.143936727 +1000
+++ mount.cifs.c	2010-03-04 01:53:22.752879004 +1000
@@ -1563,7 +1563,7 @@
 		}
 	}
 
-	if (addr->ai_addr->sa_family == AF_INET6 && addr6->sin6_scope_id) {
+	if (addr && addr->ai_addr->sa_family == AF_INET6 && addr6->sin6_scope_id) {
 		strlcat(options, "%", options_size);
 		current_len = strnlen(options, options_size);
 		optionstail = options + current_len;
~~~~~~~~~~~~~~~~~~~~~~~~ end cut here ~~~~~~~~~~~~~~~~~~~~~~~~
Comment 1 Alexander 2010-03-03 10:06:16 UTC
Created attachment 5448 [details]
Patch that fixed this issue
Comment 2 Karolin Seeger 2010-03-30 09:35:12 UTC
Jeff, is there a chance to review the patch until tomorrow?
If it's correct, we could include it in 3.5.2 then.

Thanks!
Comment 3 Jeff Layton 2010-03-30 09:44:22 UTC
Patch is correct and is already in cifs-utils 4.1. Should be fine for samba to take the same one.
Comment 4 Karolin Seeger 2010-05-27 04:58:39 UTC

*** This bug has been marked as a duplicate of bug 7315 ***