<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include/asm/elf.h, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-01-06T13:41:17Z</updated>
<entry>
<title>x32: make X32, !IA32_EMULATION setups able to execute x32 binaries</title>
<updated>2021-01-06T13:41:17Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2021-01-04T23:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=85f2ada718a81b282ee78a96d0ab1450543612e7'/>
<id>urn:sha1:85f2ada718a81b282ee78a96d0ab1450543612e7</id>
<content type='text'>
It's really trivial - the only wrinkle is making sure that
compiler knows that ia32-related side of COMPAT_ARCH_DLINFO
is dead code on such configs (we don't get there without
having passed compat_elf_check_arch(), and on such configs
that'll fail for ia32 binary).

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>x86: vdso: Expose sigreturn address on vdso to the kernel</title>
<updated>2020-12-02T09:32:16Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2020-11-27T19:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c5c878125ad5aca199dfc10b1af4010165aaa596'/>
<id>urn:sha1:c5c878125ad5aca199dfc10b1af4010165aaa596</id>
<content type='text'>
Syscall user redirection requires the signal trampoline code to not be
captured, in order to support returning with a locked selector while
avoiding recursion back into the signal handler.  For ia-32, which has
the trampoline in the vDSO, expose the entry points to the kernel, such
that it can avoid dispatching syscalls from that region to userspace.

Suggested-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@collabora.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Acked-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20201127193238.821364-2-krisman@collabora.com

</content>
</entry>
<entry>
<title>x86/elf: Use e_machine to check for x32/ia32 in setup_additional_pages()</title>
<updated>2020-10-26T12:46:47Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2020-10-04T03:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3316ec8ccd34e19690a12e65801d605d25155031'/>
<id>urn:sha1:3316ec8ccd34e19690a12e65801d605d25155031</id>
<content type='text'>
Since TIF_X32 is going away, avoid using it to find the ELF type when
choosing which additional pages to set up.

According to SysV AMD64 ABI Draft, an AMD64 ELF object using ILP32 must
have ELFCLASS32 with (E_MACHINE == EM_X86_64), so use that ELF field to
differentiate a x32 object from a IA32 object when executing
setup_additional_pages() in compat mode.

Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@collabora.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20201004032536.1229030-9-krisman@collabora.com


</content>
</entry>
<entry>
<title>x86/elf: Use e_machine to select start_thread for x32</title>
<updated>2020-10-26T12:46:46Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2020-10-04T03:25:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2424b14605c71a7187c14edd525044eb36bdea47'/>
<id>urn:sha1:2424b14605c71a7187c14edd525044eb36bdea47</id>
<content type='text'>
Since TIF_X32 is going away, avoid using it to find the ELF type in
compat_start_thread.

According to SysV AMD64 ABI Draft, an AMD64 ELF object using ILP32 must
have ELFCLASS32 with (E_MACHINE == EM_X86_64), so use that ELF field to
differentiate a x32 object from a IA32 object when executing start_thread()
in compat mode.

Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@collabora.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Link: https://lore.kernel.org/r/20201004032536.1229030-7-krisman@collabora.com


</content>
</entry>
<entry>
<title>x86/elf: Use e_machine to choose DLINFO in compat</title>
<updated>2020-10-26T12:46:46Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2020-10-04T03:25:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2656af0d5abfa26d7f1e40f92e9953fe155b950a'/>
<id>urn:sha1:2656af0d5abfa26d7f1e40f92e9953fe155b950a</id>
<content type='text'>
Since TIF_X32 is going away, avoid using it to find the ELF type on
ARCH_DLINFO.

According to SysV AMD64 ABI Draft, an AMD64 ELF object using ILP32 must
have ELFCLASS32 with (E_MACHINE == EM_X86_64), so use that ELF field to
differentiate a x32 object from a IA32 object when loading ARCH_DLINFO in
compat mode.

Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@collabora.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Link: https://lore.kernel.org/r/20201004032536.1229030-5-krisman@collabora.com

</content>
</entry>
<entry>
<title>kill elf_fpxregs_t</title>
<updated>2020-07-27T18:29:23Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2020-06-13T04:23:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a896028adcfbff4552e6748e8fc8d06036c132c'/>
<id>urn:sha1:7a896028adcfbff4552e6748e8fc8d06036c132c</id>
<content type='text'>
all uses are conditional upon ELF_CORE_COPY_XFPREGS, which has not
been defined on any architecture since 2010

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>x86/elf: Disable automatic READ_IMPLIES_EXEC on 64-bit</title>
<updated>2020-04-20T17:24:33Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2020-03-27T06:48:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9fccc5c0c99f238aa1b0460fccbdb30a887e7036'/>
<id>urn:sha1:9fccc5c0c99f238aa1b0460fccbdb30a887e7036</id>
<content type='text'>
With modern x86 64-bit environments, there should never be a need for
automatic READ_IMPLIES_EXEC, as the architecture is intended to always
be execute-bit aware (as in, the default memory protection should be NX
unless a region explicitly requests to be executable).

There were very old x86_64 systems that lacked the NX bit, but for those,
the NX bit is, obviously, unenforceable, so these changes should have
no impact on them.

Suggested-by: Hector Marco-Gisbert &lt;hecmargi@upv.es&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Link: https://lkml.kernel.org/r/20200327064820.12602-4-keescook@chromium.org
</content>
</entry>
<entry>
<title>x86/elf: Split READ_IMPLIES_EXEC from executable PT_GNU_STACK</title>
<updated>2020-04-20T17:09:38Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2020-03-27T06:48:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=122306117afe4ba202b5e57c61dfbeffc5c41387'/>
<id>urn:sha1:122306117afe4ba202b5e57c61dfbeffc5c41387</id>
<content type='text'>
The READ_IMPLIES_EXEC workaround was designed for old toolchains that
lacked the ELF PT_GNU_STACK marking under the assumption that toolchains
that couldn't specify executable permission flags for the stack may not
know how to do it correctly for any memory region.

This logic is sensible for having ancient binaries coexist in a system
with possibly NX memory, but was implemented in a way that equated having
a PT_GNU_STACK marked executable as being as "broken" as lacking the
PT_GNU_STACK marking entirely. Things like unmarked assembly and stack
trampolines may cause PT_GNU_STACK to need an executable bit, but they
do not imply all mappings must be executable.

This confusion has led to situations where modern programs with explicitly
marked executable stacks are forced into the READ_IMPLIES_EXEC state when
no such thing is needed. (And leads to unexpected failures when mmap()ing
regions of device driver memory that wish to disallow VM_EXEC[1].)

In looking for other reasons for the READ_IMPLIES_EXEC behavior, Jann
Horn noted that glibc thread stacks have always been marked RWX (until
2003 when they started tracking the PT_GNU_STACK flag instead[2]). And
musl doesn't support executable stacks at all[3]. As such, no breakage
for multithreaded applications is expected from this change.

[1] https://lkml.kernel.org/r/20190418055759.GA3155@mellanox.com
[2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=54ee14b3882
[3] https://lkml.kernel.org/r/20190423192534.GN23599@brightrain.aerifal.cx

Suggested-by: Hector Marco-Gisbert &lt;hecmargi@upv.es&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Link: https://lkml.kernel.org/r/20200327064820.12602-3-keescook@chromium.org
</content>
</entry>
<entry>
<title>x86/elf: Add table to document READ_IMPLIES_EXEC</title>
<updated>2020-04-20T13:28:40Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2020-03-27T06:48:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d9e435f3f2492bfd196acacb61cc9a9212d8170'/>
<id>urn:sha1:9d9e435f3f2492bfd196acacb61cc9a9212d8170</id>
<content type='text'>
Add a table to document the current behavior of READ_IMPLIES_EXEC in
preparation for changing the behavior.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Link: https://lkml.kernel.org/r/20200327064820.12602-2-keescook@chromium.org
</content>
</entry>
<entry>
<title>Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2018-10-23T14:24:22Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-10-23T14:24:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1d20beae70eb918cca7f07a77ce199fd148fdd2'/>
<id>urn:sha1:e1d20beae70eb918cca7f07a77ce199fd148fdd2</id>
<content type='text'>
Pull x86 asm updates from Ingo Molnar:
 "The main changes in this cycle were the fsgsbase related preparatory
  patches from Chang S. Bae - but there's also an optimized
  memcpy_flushcache() and a cleanup for the __cmpxchg_double() assembly
  glue"

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/fsgsbase/64: Clean up various details
  x86/segments: Introduce the 'CPUNODE' naming to better document the segment limit CPU/node NR trick
  x86/vdso: Initialize the CPU/node NR segment descriptor earlier
  x86/vdso: Introduce helper functions for CPU and node number
  x86/segments/64: Rename the GDT PER_CPU entry to CPU_NUMBER
  x86/fsgsbase/64: Factor out FS/GS segment loading from __switch_to()
  x86/fsgsbase/64: Convert the ELF core dump code to the new FSGSBASE helpers
  x86/fsgsbase/64: Make ptrace use the new FS/GS base helpers
  x86/fsgsbase/64: Introduce FS/GS base helper functions
  x86/fsgsbase/64: Fix ptrace() to read the FS/GS base accurately
  x86/asm: Use CC_SET()/CC_OUT() in __cmpxchg_double()
  x86/asm: Optimize memcpy_flushcache()
</content>
</entry>
</feed>
