<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/syslinux.git/com32/lib/exit.c, branch syslinux-6.02-pre4</title>
<subtitle>git.kernel.org: pub/scm/boot/syslinux/syslinux.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/'/>
<entry>
<title>exit.c: Truncate exit status to uint8_t</title>
<updated>2011-04-26T09:05:38+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@linux.intel.com</email>
</author>
<published>2011-04-15T10:48:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=5af736cf7677485da73bdc7ea4633960c8640cb6'/>
<id>5af736cf7677485da73bdc7ea4633960c8640cb6</id>
<content type='text'>
The valid range for an exit status is 0 - 255, so we need to truncate
the value passed to _exit().

I noticed this when a module was doing _exit(-1), and ended up calling

	longjmp(.., 0xffffffff + 1)

which meant that setjmp() in spawn_load() returned 0. Obviously, we
wanted the setjmp() to return 256 (0xff + 1), because the code in
spawn_load() handles the return value like so,

		ret_val = setjmp(module-&gt;u.x.process_exit);

		if (ret_val)
			ret_val--;              /* Valid range is 0-255 */
		else if (!module-&gt;main_func)
			ret_val = -1;
		else
			exit((module-&gt;main_func)(argc, argv)); /* Actually run! */

There actually is code in spawn_load() to properly truncate 'ret_val',
but it is applied too late. The truncation needs to happen when we
pass the exit status to longjmp().

Suggested-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The valid range for an exit status is 0 - 255, so we need to truncate
the value passed to _exit().

I noticed this when a module was doing _exit(-1), and ended up calling

	longjmp(.., 0xffffffff + 1)

which meant that setjmp() in spawn_load() returned 0. Obviously, we
wanted the setjmp() to return 256 (0xff + 1), because the code in
spawn_load() handles the return value like so,

		ret_val = setjmp(module-&gt;u.x.process_exit);

		if (ret_val)
			ret_val--;              /* Valid range is 0-255 */
		else if (!module-&gt;main_func)
			ret_val = -1;
		else
			exit((module-&gt;main_func)(argc, argv)); /* Actually run! */

There actually is code in spawn_load() to properly truncate 'ret_val',
but it is applied too late. The truncation needs to happen when we
pass the exit status to longjmp().

Suggested-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elflink: change the exit.c, remove the exit.S to make process exit working</title>
<updated>2010-07-20T03:10:03+00:00</updated>
<author>
<name>Feng Tang</name>
<email>feng.tang@intel.com</email>
</author>
<published>2010-06-17T09:09:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=71d5d1ba646e676cf1faf394e0d54950e416fe1c'/>
<id>71d5d1ba646e676cf1faf394e0d54950e416fe1c</id>
<content type='text'>
following elflink branch
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
following elflink branch
</pre>
</div>
</content>
</entry>
<entry>
<title>Run Nindent on com32/lib/exit.c</title>
<updated>2009-05-29T22:10:23+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2009-05-29T22:10:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=b92ffe7dacd1c2143cd7492d1941f828f6462207'/>
<id>b92ffe7dacd1c2143cd7492d1941f828f6462207</id>
<content type='text'>
Automatically reformat com32/lib/exit.c using Nindent.

Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Automatically reformat com32/lib/exit.c using Nindent.

Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year</title>
<updated>2008-01-10T19:13:57+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2008-01-10T19:13:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=244d2fe917cec1565b4fd992ea9e8cc46749a661'/>
<id>244d2fe917cec1565b4fd992ea9e8cc46749a661</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove CVS-era $Id$ tags.</title>
<updated>2006-08-17T21:26:53+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2006-08-17T21:26:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=4604b77ad1d301d2f0a571ea3376c38f5b990813'/>
<id>4604b77ad1d301d2f0a571ea3376c38f5b990813</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Across-the-board stealth whitespace cleanup</title>
<updated>2006-05-04T00:32:15+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2006-05-04T00:32:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=28eecd8965aedbd75727fb0797a2e7033d5c54ee'/>
<id>28eecd8965aedbd75727fb0797a2e7033d5c54ee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Library to decode console codes; demo program</title>
<updated>2004-12-01T02:44:34+00:00</updated>
<author>
<name>hpa</name>
<email>hpa</email>
</author>
<published>2004-12-01T02:44:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=70832b411a726871652ec66b33182fdff7270310'/>
<id>70832b411a726871652ec66b33182fdff7270310</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Very first cut at a klibc-derived C library for com32</title>
<updated>2004-11-10T22:31:50+00:00</updated>
<author>
<name>hpa</name>
<email>hpa</email>
</author>
<published>2004-11-10T22:31:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=17f967640cef484f83d755c9dd016a946711236f'/>
<id>17f967640cef484f83d755c9dd016a946711236f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
