Re: [PATCH] Blacklist binary-only modules lying about their license

From: Tomas Szepe
Date: Sat May 01 2004 - 04:20:49 EST


On Apr-27 2004, Tue, 23:34 +0200
Robert M. Stockmann <stock@xxxxxxxxxxx> wrote:

> > Hmm. At least with -sdt=c99 it should be trivial, with something like
> >
> > #define __MODULE_INFO(tag, name, info) \
> > static struct { int len; const char value[] } \
> > __module_cat(name,__LINE__) __attribute_used__ \
> > __attribute__((section(".modinfo"),unused)) = \
> > { sizeof(__stringify(tag) "=" info), \
> > __stringify(tag) "=" info }
> >
> > doing the job.
> >
> > That should make it pretty easy to parse the .modinfo section too.
> >
> > Linus
>
> Its a joke anyway gcc3.x allows this to happen.

Why? Initializing a char pointer to a byte stream that contains a NUL
is perfectly legal C.

> As i posted on the gcc mailinglist some time ago :
[snip]
> checking version of gcc... 2.95.3, bad
> configure: error: Please upgrade your gcc compiler to gcc-2.96+ or gcc-3+
> version! Earlier compiler versions will NOT work as these do not support
> unnamed/annonymous structures and unions which are used heavily in linux-ntfs.
> [jackson:stock]:(~/src/ntfsprogs-1.8.4)$
>
> Aha, unnamed/annonymous structures and unions .....
>
> Well thats briljant... in 2 years time all Open Source code will be unnamed
> and anonymous in the form of propiatary .o modules, and Linus will still
> be happy to deliver his /usr/src/linux/kernel subtree of the Linux
[snip]

Well, what was the GCC folks' response? I'd place my bet on
"Do you even know what an unnamed structure/union is?"

--
Tomas Szepe <szepe@xxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/