Fwd: Segmentation Fault: madwifi and hostapd

Chad Meister chadlich at yahoo.com
Thu Feb 2 20:10:41 EST 2006


Excellent!  Happy to help out.  Thanks enabling me to
setup my own secure AP.

I'll test the code tonight or tomorrow on the current
release of hostapd.  If I get brave enough to face
other issues, I'll test it out on the development
hostapd code as well.

Now that I have your attention, could I make a few
suggestions:

1) I find the whole hostap logger configuration
settings confusing and non-user friendly; i.e, setting
bitfield makes sense only to programmers. I think it
would be great if the logging settings could be
reworked to something more straightforward.  A change
in the bitfield operations in the code may not be
necessary; the new config settings could simply be
translated into the old bit values.

2) It would be helpful if hostapd apopted the debian
patch that places all hostapd config files in one
location; e.g., in debian it's /etc/hostapd/.  (The
debian patch also changes a few file names) - rather
than having them  all float around the other files in
/etc.

Just my two cents.  Thanks again for all your hard
work.  And I'll post my results as soon as I can run
some tests.

Thanks,

Chad

--- Jouni Malinen <jkmaline at cc.hut.fi> wrote:

> On Tue, Jan 31, 2006 at 05:30:08PM -0800, Chad
> Meister wrote:
> 
> > Setting logger_stdout=0 did the trick.  Hostapd no
> > longer seg faults.
> 
> Thanks! That was enough to finally get to the bottom
> of this issue. This
> must be one of the oldest bugs that has been found
> in hostapd.. The code
> has been this way for almost three years now.
> 
> Variable arguments to hostapd_logger() were not
> processed correctly and
> if both stdout and syslog were enabled, some CPU/C
> lib/compiler
> combinations could apparently trigger a segmentation
> fault in vsyslog().
> For some reason, I have never seen this in any of my
> test setups.
> 
> I've fixed this now in CVS. Could you please test
> whether the attached
> patch fixes this issue for you? You can either apply
> the patch to
> hostapd.c (hostapd_logger() function) or download
> the current snapshot
> of the development branch from my CVS repository.
> 
> -- 
> Jouni Malinen                                       
>     PGP id EFC895FA
> > Index: hostapd.c
>
===================================================================
> RCS file:
> /home/jm/cvsroot/hostap/hostapd/hostapd.c,v
> retrieving revision 1.113
> diff -u -p -u -p -r1.113 hostapd.c
> --- hostapd.c	13 Oct 2005 02:28:45 -0000	1.113
> +++ hostapd.c	1 Feb 2006 03:17:53 -0000
> @@ -74,8 +74,6 @@ void hostapd_logger(struct
> hostapd_data 
>  	if (!format)
>  		return;
>  
> -	va_start(ap, fmt);
> -
>  	if (hapd && hapd->conf) {
>  		conf_syslog_level =
> hapd->conf->logger_syslog_level;
>  		conf_stdout_level =
> hapd->conf->logger_stdout_level;
> @@ -128,7 +126,9 @@ void hostapd_logger(struct
> hostapd_data 
>  
>  	if ((conf_stdout & module) && level >=
> conf_stdout_level) {
>  		wpa_debug_print_timestamp();
> +		va_start(ap, fmt);
>  		vprintf(format, ap);
> +		va_end(ap);
>  		printf("\n");
>  	}
>  
> @@ -152,12 +152,12 @@ void hostapd_logger(struct
> hostapd_data 
>  			priority = LOG_INFO;
>  			break;
>  		}
> +		va_start(ap, fmt);
>  		vsyslog(priority, format, ap);
> +		va_end(ap);
>  	}
>  
>  	free(format);
> -
> -	va_end(ap);
>  }
>  
>  
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the HostAP mailing list