Patchwork Error segmentation fault.

login
register
mail settings
Submitter Jeff Layton
Date March 8, 2010, midnight
Message ID <20100307190019.6291bbd2@tlielax.poochiereds.net>
Download mbox | patch
Permalink /patch/47097/
State New
Headers show

Comments

Jeff Layton - March 8, 2010, midnight
On Sun, 7 Mar 2010 19:02:12 +0100
Stef Bon <stefbon@gmail.com> wrote:

> Hello,
> 
> some days ago I've posted a message I could not compile cifs-utils,
> because it needs a kerberos header.
> 
> I've installed kerberos from source, so now I've installed it.
> 
> But when I try to use it, it only gives errors. First I thought it had
> to do with the kernel (version 2.6.30.5),
> so I installed the latest kernel at this moment, 2.6 33.
> 
> Now I'm trying at again, but again errors:
> 
> mount.cifs  //sclfs20091030/public mount -o ip=192.168.0.1,guest
> 
> Mar  7 18:59:21 clfs20091030 kernel: mount.cifs[6035]: segfault at 14
> ip 0804bffe sp bff54cc0 error 4 in mount.cifs[8048000+7000]
> 
> This is the same when I use a valid credentialsfile.
> When I reinstall the mount.cifs from the samba-3.4.4 source everything
> works again.
> 

Does the attached patch fix it?
Jeff Layton - March 8, 2010, 11:38 a.m.
On Mon, 8 Mar 2010 07:19:23 +0100
Stef Bon <stefbon@gmail.com> wrote:

> Yes that did it!
> 
> Stef Bon
> 
> 
> 2010/3/8 Jeff Layton <jlayton@samba.org>:
> > On Sun, 7 Mar 2010 19:02:12 +0100
> > Stef Bon <stefbon@gmail.com> wrote:
> >
> >> Hello,
> >>
> >> some days ago I've posted a message I could not compile cifs-utils,
> >> because it needs a kerberos header.
> >>
> >> I've installed kerberos from source, so now I've installed it.
> >>
> >> But when I try to use it, it only gives errors. First I thought it had
> >> to do with the kernel (version 2.6.30.5),
> >> so I installed the latest kernel at this moment, 2.6 33.
> >>
> >> Now I'm trying at again, but again errors:
> >>
> >> mount.cifs  //sclfs20091030/public mount -o ip=192.168.0.1,guest
> >>
> >> Mar  7 18:59:21 clfs20091030 kernel: mount.cifs[6035]: segfault at 14
> >> ip 0804bffe sp bff54cc0 error 4 in mount.cifs[8048000+7000]
> >>
> >> This is the same when I use a valid credentialsfile.
> >> When I reinstall the mount.cifs from the samba-3.4.4 source everything
> >> works again.
> >>
> >
> > Does the attached patch fix it?
> >
> > --
> > Jeff Layton <jlayton@samba.org>
> >
> 

Ok, committed to git. It'll make the next release.

Patch

From cff3f7cb2b94aec118f27ee8dd904ef216489938 Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@redhat.com>
Date: Sun, 7 Mar 2010 18:49:33 -0500
Subject: [PATCH] mount.cifs: check for NULL addr pointer before handling scopeid

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 mount.cifs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mount.cifs.c b/mount.cifs.c
index 5237476..4e38415 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -1604,7 +1604,7 @@  mount_retry:
 		}
 	}
 
-	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;
-- 
1.6.6.1