public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/basic/fixdep segfault on pathological string-o-death
@ 2007-05-02 11:49 Andy Green
  2007-05-02 19:37 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Green @ 2007-05-02 11:49 UTC (permalink / raw)
  To: lkml

build scripts: fixdep blows segfault on string CONFIG_MODULE seen

The string "CONFIG_MODULE" appearing anywhere in a source file causes
fixdep to segfault.  This string appeared in the wild in the current
mISDN sources (I think they meant CONFIG_MODULES).  But it shouldn't
segfault (esp as CONFIG_MODULE appeared in a quoted string).

Signed-off-by: Andy Green <andy@warmcat.com>
---
 scripts/basic/fixdep.c |    2 ++
 1 file changed, 2 insertions(+)

Index: 2.6.21-1.3116.fc7-i686/scripts/basic/fixdep.c
===================================================================
--- 2.6.21-1.3116.fc7-i686.orig/scripts/basic/fixdep.c
+++ 2.6.21-1.3116.fc7-i686/scripts/basic/fixdep.c
@@ -249,6 +249,8 @@ void parse_config_file(char *map, size_t
 	found:
 		if (!memcmp(q - 7, "_MODULE", 7))
 			q -= 7;
+		if( (q-p-7) < 0 )
+			continue;
 		use_config(p+7, q-p-7);
 	}
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/basic/fixdep segfault on pathological string-o-death
  2007-05-02 11:49 [PATCH] scripts/basic/fixdep segfault on pathological string-o-death Andy Green
@ 2007-05-02 19:37 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2007-05-02 19:37 UTC (permalink / raw)
  To: Andy Green; +Cc: lkml

On Wed, May 02, 2007 at 12:49:06PM +0100, Andy Green wrote:
> build scripts: fixdep blows segfault on string CONFIG_MODULE seen
> 
> The string "CONFIG_MODULE" appearing anywhere in a source file causes
> fixdep to segfault.  This string appeared in the wild in the current
> mISDN sources (I think they meant CONFIG_MODULES).  But it shouldn't
> segfault (esp as CONFIG_MODULE appeared in a quoted string).
> 
> Signed-off-by: Andy Green <andy@warmcat.com>

Applied and forwarded to stable@kernel.org.

Thanks,
	Sam

> ---
>  scripts/basic/fixdep.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: 2.6.21-1.3116.fc7-i686/scripts/basic/fixdep.c
> ===================================================================
> --- 2.6.21-1.3116.fc7-i686.orig/scripts/basic/fixdep.c
> +++ 2.6.21-1.3116.fc7-i686/scripts/basic/fixdep.c
> @@ -249,6 +249,8 @@ void parse_config_file(char *map, size_t
>  	found:
>  		if (!memcmp(q - 7, "_MODULE", 7))
>  			q -= 7;
> +		if( (q-p-7) < 0 )
> +			continue;
>  		use_config(p+7, q-p-7);
>  	}
>  }
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-02 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-02 11:49 [PATCH] scripts/basic/fixdep segfault on pathological string-o-death Andy Green
2007-05-02 19:37 ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox