LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jan Engelhardt <jengelh@linux01.gwdg.de>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Bodo Eggert <7eggert@gmx.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	Jon Masters <jonathan@jonmasters.org>,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH/RFC] alternative aproach to: Ban module license tag string termination trick
Date: Sat, 3 Feb 2007 12:38:47 +0100 (MET)	[thread overview]
Message-ID: <Pine.LNX.4.61.0702031236340.27840@yvahk01.tjqt.qr> (raw)
In-Reply-To: <20070203081426.GA10520@flint.arm.linux.org.uk>


On Feb 3 2007 08:14, Russell King wrote:
>On Sat, Feb 03, 2007 at 03:08:14AM +0100, Bodo Eggert wrote:
>> This patch changes the module license handling code to:
>> - prevent the "GPL\0 for nothing"-trick
>
>You can achieve this effect without changing the existing module
>format, and it's far more difficult to bypass with build-with-
>modified module.h tricks.
>
>+static int check_modinfo_objects(Elf_Shdr *sechdrs,
>+				 unsigned int symindex,
>+				 unsigned int infoindex)
>+{
>+	unsigned int i;
>+	Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr;
>+	char *info = (char *)sechdrs[infoindex].sh_addr;
>+
>+	for (i = 1; i < sechdrs[symindex].sh_size/sizeof(*sym); i++) {
>+		if (sym[i].st_shndx == infoindex &&
>+		    ELF_ST_TYPE(sym[i].st_info) == STT_OBJECT) {
>+			if (strlen(info + sym[i].st_value) + 1 != sym[i].st_size)
>+				return -ENOEXEC;
>+		}
>+	}

What happens when there is no symbol for the "license=GPL\0foo..." string?
To me it looks like we'll miss it.



Jan
-- 
ft: http://freshmeat.net/p/chaostables/

  reply	other threads:[~2007-02-03 11:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-03  2:08 Bodo Eggert
2007-02-03  8:14 ` Russell King
2007-02-03 11:38   ` Jan Engelhardt [this message]
2007-02-03 19:56   ` Alan
2007-02-03 20:12     ` Randy Dunlap
2007-02-03 11:32 ` Jan Engelhardt
2007-02-03 11:54   ` Theodore Tso
2007-02-03 14:04   ` Bodo Eggert
2007-02-03 19:47     ` Alan
2007-02-03 20:02 ` Alan
2007-02-05 13:08   ` Bodo Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0702031236340.27840@yvahk01.tjqt.qr \
    --to=jengelh@linux01.gwdg.de \
    --cc=7eggert@gmx.de \
    --cc=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --subject='Re: [PATCH/RFC] alternative aproach to: Ban module license tag string termination trick' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).