Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 1998 00:03:49 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        cracauer@cons.org (Martin Cracauer)
Cc:        tlambert@primenet.com, freebsd-current@FreeBSD.ORG
Subject:   Re: Standardizing a BSD/ELF ABI...
Message-ID:  <199809040003.RAA06884@usr09.primenet.com>
In-Reply-To: <19980903122603.A24806@cons.org> from "Martin Cracauer" at Sep 3, 98 12:26:03 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I didn't see anyone posting a piece of code to show the problem, maybe
> I overlooked something?


Your program is:

	main()
	{
		extern char foo[];

		initme();	/* get from shared library*/
		/* override default initilization from library*/
		strcpy( foo, "up to 16 bytes");
	}

Link it against a library with a foo of size 16, and then run it with
a (newer) library with a foo of size 4.

If the data is from the library, then based on a sizeof(foo) == 16, where
are the extra 12 'X' characters going?

The shared library is insufficient to meet the relink clause of the
GPL.


Now  your program is:

	main()
	{
		initme();	/* get from shared library*/
	}

If the data is from the image instead of the library, then link it
against a library with a foo of size 4, and then run it with a
(newer) library with a foo of size 16.

The shared library is insufficient to meet the relink clause of the
GPL.

Either place the data goes, I can create a case which will result
in a buffer overrun.


This is the problem with data interfaces rather than procedural
interfaces.

This is why you have to rebuild libkvm and rebuild (rather than
relink) "ps" when you change the proc structure in FreeBSD: the
failure of data interfaces to procedurally abstract data access.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809040003.RAA06884>