<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/personality.h, branch v4.4.183</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.183</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.183'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-04-12T19:03:31Z</updated>
<entry>
<title>Remove rest of exec domains.</title>
<updated>2015-04-12T19:03:31Z</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2015-04-11T19:45:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9058f3b326dbe8cd2ebea7f3cfe367b0d101039b'/>
<id>urn:sha1:9058f3b326dbe8cd2ebea7f3cfe367b0d101039b</id>
<content type='text'>
It is gone from all archs, now we can remove
the final bits.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UAPI: (Scripted) Disintegrate include/linux</title>
<updated>2012-10-13T09:46:48Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2012-10-13T09:46:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=607ca46e97a1b6594b29647d98a32d545c24bdff'/>
<id>urn:sha1:607ca46e97a1b6594b29647d98a32d545c24bdff</id>
<content type='text'>
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Acked-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>Add a personality to report 2.6.x version numbers</title>
<updated>2011-08-25T17:17:28Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2011-08-19T23:15:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=be27425dcc516fd08245b047ea57f83b8f6f0903'/>
<id>urn:sha1:be27425dcc516fd08245b047ea57f83b8f6f0903</id>
<content type='text'>
I ran into a couple of programs which broke with the new Linux 3.0
version.  Some of those were binary only.  I tried to use LD_PRELOAD to
work around it, but it was quite difficult and in one case impossible
because of a mix of 32bit and 64bit executables.

For example, all kind of management software from HP doesnt work, unless
we pretend to run a 2.6 kernel.

  $ uname -a
  Linux svivoipvnx001 3.0.0-08107-g97cd98f #1062 SMP Fri Aug 12 18:11:45 CEST 2011 i686 i686 i386 GNU/Linux

  $ hpacucli ctrl all show

  Error: No controllers detected.

  $ rpm -qf /usr/sbin/hpacucli
  hpacucli-8.75-12.0

Another notable case is that Python now reports "linux3" from
sys.platform(); which in turn can break things that were checking
sys.platform() == "linux2":

  https://bugzilla.mozilla.org/show_bug.cgi?id=664564

It seems pretty clear to me though it's a bug in the apps that are using
'==' instead of .startswith(), but this allows us to unbreak broken
programs.

This patch adds a UNAME26 personality that makes the kernel report a
2.6.40+x version number instead.  The x is the x in 3.x.

I know this is somewhat ugly, but I didn't find a better workaround, and
compatibility to existing programs is important.

Some programs also read /proc/sys/kernel/osrelease.  This can be worked
around in user space with mount --bind (and a mount namespace)

To use:

  wget ftp://ftp.kernel.org/pub/linux/kernel/people/ak/uname26/uname26.c
  gcc -o uname26 uname26.c
  ./uname26 program

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sys_personality: change sys_personality() to accept "unsigned int" instead of u_long</title>
<updated>2010-06-04T22:21:45Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2010-06-04T21:14:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=485d527686850d68a0e9006dd9904f19f122485e'/>
<id>urn:sha1:485d527686850d68a0e9006dd9904f19f122485e</id>
<content type='text'>
task_struct-&gt;pesonality is "unsigned int", but sys_personality() paths use
"unsigned long pesonality".  This means that every assignment or
comparison is not right.  In particular, if this argument does not fit
into "unsigned int" __set_personality() changes the caller's personality
and then sys_personality() returns -EINVAL.

Turn this argument into "unsigned int" and avoid overflows.  Obviously,
this is the user-visible change, we just ignore the upper bits.  But this
can't break the sane application.

There is another thing which can confuse the poorly written applications.
User-space thinks that this syscall returns int, not long.  This means
that the returned value can be negative and look like the error code.  But
note that libc won't be confused and thus errno won't be set, and with
this patch the user-space can never get -1 unless sys_personality() really
fails.  And, most importantly, the negative RET != -1 is only possible if
that app previously called personality(RET).

Pointed-out-by: Wenming Zhang &lt;wezhang@redhat.com&gt;
Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.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>personality: fix PER_CLEAR_ON_SETID</title>
<updated>2009-07-12T19:21:33Z</updated>
<author>
<name>Julien Tinnes</name>
<email>jt@cr0.org</email>
</author>
<published>2009-06-26T18:27:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f9fabcb58a6d26d6efde842d1703ac7cfa9427b6'/>
<id>urn:sha1:f9fabcb58a6d26d6efde842d1703ac7cfa9427b6</id>
<content type='text'>
We have found that the current PER_CLEAR_ON_SETID mask on Linux doesn't
include neither ADDR_COMPAT_LAYOUT, nor MMAP_PAGE_ZERO.

The current mask is READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE.

We believe it is important to add MMAP_PAGE_ZERO, because by using this
personality it is possible to have the first page mapped inside a
process running as setuid root.  This could be used in those scenarios:

 - Exploiting a NULL pointer dereference issue in a setuid root binary
 - Bypassing the mmap_min_addr restrictions of the Linux kernel: by
   running a setuid binary that would drop privileges before giving us
   control back (for instance by loading a user-supplied library), we
   could get the first page mapped in a process we control.  By further
   using mremap and mprotect on this mapping, we can then completely
   bypass the mmap_min_addr restrictions.

Less importantly, we believe ADDR_COMPAT_LAYOUT should also be added
since on x86 32bits it will in practice disable most of the address
space layout randomization (only the stack will remain randomized).

Signed-off-by: Julien Tinnes &lt;jt@cr0.org&gt;
Signed-off-by: Tavis Ormandy &lt;taviso@sdf.lonestar.org&gt;
Cc: stable@kernel.org
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Acked-by: Kees Cook &lt;kees@ubuntu.com&gt;
Acked-by: Eugene Teo &lt;eugene@redhat.com&gt;
[ Shortened lines and fixed whitespace as per Christophs' suggestion ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Remove the macro get_personality</title>
<updated>2008-04-29T15:06:02Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2008-04-29T07:59:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ecd0fa9825a1270e31fb48bc9edcfb28918b6c51'/>
<id>urn:sha1:ecd0fa9825a1270e31fb48bc9edcfb28918b6c51</id>
<content type='text'>
Remove the macro get_personality, use -&gt;personality instead.

Cc: Christoph Hellwig &lt;hch@infradead.org
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Bryan Wu &lt;bryan.wu@analog.com&gt;
Signed-off-by: WANG Cong &lt;xiyou.wangcong@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>[PATCH] Fix missing parens in set_personality()</title>
<updated>2006-11-13T15:40:42Z</updated>
<author>
<name>Russell King</name>
<email>rmk+lkml@arm.linux.org.uk</email>
</author>
<published>2006-11-10T20:27:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d8b295f29091310d746509bb6d5828aaf4907a18'/>
<id>urn:sha1:d8b295f29091310d746509bb6d5828aaf4907a18</id>
<content type='text'>
If you call set_personality() with an expression such as:

	set_personality(foo ? PERS_FOO1 : PERS_FOO2);

then this evaluates to:

	((current-&gt;personality == foo ? PERS_FOO1 : PERS_FOO2) ? ...

which is obviously not the intended result.  Add the missing parents
to ensure this gets evaluated as expected:

	((current-&gt;personality == (foo ? PERS_FOO1 : PERS_FOO2)) ? ...

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Make &lt;linux/personality.h&gt; userspace proof</title>
<updated>2006-10-20T17:26:35Z</updated>
<author>
<name>Ralf Baechle</name>
<email>ralf@linux-mips.org</email>
</author>
<published>2006-10-20T06:28:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=34e856e6a522a8fc0feba7497f5b05aeaa13d473'/>
<id>urn:sha1:34e856e6a522a8fc0feba7497f5b05aeaa13d473</id>
<content type='text'>
&lt;linux/personality.h&gt; contains the constants for personality(2) but also
some defintions that are useless or even harmful in userspace such as the
personality() macro.

Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Randomisation: add ADDR_NO_RANDOMIZE personality</title>
<updated>2005-03-05T01:25:55Z</updated>
<author>
<name>Arjan van de Ven</name>
<email>arjan@infradead.org</email>
</author>
<published>2005-03-05T01:25:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8ec0defa78358ecae2b24146666e384af30950b5'/>
<id>urn:sha1:8ec0defa78358ecae2b24146666e384af30950b5</id>
<content type='text'>
Introduce a personality that disables randomisation, so that users can use
setarch and related commands to run specific applications without
randomisation.

Signed-off-by: Arjan van de Ven &lt;arjan@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] FRV: Add FDPIC ELF binary format driver</title>
<updated>2005-01-04T13:21:32Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2005-01-04T13:21:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=91808d6ebe39ed3c6ab7737e720d13af1e40a687'/>
<id>urn:sha1:91808d6ebe39ed3c6ab7737e720d13af1e40a687</id>
<content type='text'>
The attached patch adds a new binary format driver that allows a special
variety of ELF to be used that permits the dynamic sections that comprise an
executable, its dynamic loader and its shared libaries and its stack and data
to be located anywhere within the address space.

This is used to provide shared libraries and shared executables (at least, as
far as the read-only dynamic sections go) on uClinux. Not only that, but the
same binaries can be run on MMU linux without a problem.

This is achieved by:

 (1) Passing loadmaps to the dynamic loader (or to a statically linked
     executable) to indicate the whereabouts of the various dynamic sections.

 (2) Using a GOT inside the program.

 (3) Passing setup_arg_pages() the stack pointer to be.

 (4) Allowing the arch greated control over how an executable is laid out in
     memory in MMU Linux.

 (5) Rewriting mm/nommu.c to support MAP_PRIVATE on files, thus allowing _mmap_
     to handle sharing of private-readonly mappings.

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
