<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include/asm/thread_info.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-03-16T21:13:11Z</updated>
<entry>
<title>x86: Introduce restart_block-&gt;arch_data to remove TS_COMPAT_RESTART</title>
<updated>2021-03-16T21:13:11Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2021-02-01T17:47:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2e9df850c58c2b36e915e7d3bed3f6107cccba6'/>
<id>urn:sha1:b2e9df850c58c2b36e915e7d3bed3f6107cccba6</id>
<content type='text'>
Save the current_thread_info()-&gt;status of X86 in the new
restart_block-&gt;arch_data field so TS_COMPAT_RESTART can be removed again.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210201174716.GA17898@redhat.com

</content>
</entry>
<entry>
<title>x86: Introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall()</title>
<updated>2021-03-16T21:13:11Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2021-02-01T17:47:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c150ba2fb5995c84a7a43848250d444a3329a7d'/>
<id>urn:sha1:8c150ba2fb5995c84a7a43848250d444a3329a7d</id>
<content type='text'>
The comment in get_nr_restart_syscall() says:

	 * The problem is that we can get here when ptrace pokes
	 * syscall-like values into regs even if we're not in a syscall
	 * at all.

Yes, but if not in a syscall then the

	status &amp; (TS_COMPAT|TS_I386_REGS_POKED)

check below can't really help:

	- TS_COMPAT can't be set

	- TS_I386_REGS_POKED is only set if regs-&gt;orig_ax was changed by
	  32bit debugger; and even in this case get_nr_restart_syscall()
	  is only correct if the tracee is 32bit too.

Suppose that a 64bit debugger plays with a 32bit tracee and

	* Tracee calls sleep(2)	// TS_COMPAT is set
	* User interrupts the tracee by CTRL-C after 1 sec and does
	  "(gdb) call func()"
	* gdb saves the regs by PTRACE_GETREGS
	* does PTRACE_SETREGS to set %rip='func' and %orig_rax=-1
	* PTRACE_CONT		// TS_COMPAT is cleared
	* func() hits int3.
	* Debugger catches SIGTRAP.
	* Restore original regs by PTRACE_SETREGS.
	* PTRACE_CONT

get_nr_restart_syscall() wrongly returns __NR_restart_syscall==219, the
tracee calls ia32_sys_call_table[219] == sys_madvise.

Add the sticky TS_COMPAT_RESTART flag which survives after return to user
mode. It's going to be removed in the next step again by storing the
information in the restart block. As a further cleanup it might be possible
to remove also TS_I386_REGS_POKED with that.

Test-case:

  $ cvs -d :pserver:anoncvs:anoncvs@sourceware.org:/cvs/systemtap co ptrace-tests
  $ gcc -o erestartsys-trap-debuggee ptrace-tests/tests/erestartsys-trap-debuggee.c --m32
  $ gcc -o erestartsys-trap-debugger ptrace-tests/tests/erestartsys-trap-debugger.c -lutil
  $ ./erestartsys-trap-debugger
  Unexpected: retval 1, errno 22
  erestartsys-trap-debugger: ptrace-tests/tests/erestartsys-trap-debugger.c:421

Fixes: 609c19a385c8 ("x86/ptrace: Stop setting TS_COMPAT in ptrace code")
Reported-by: Jan Kratochvil &lt;jan.kratochvil@redhat.com&gt;
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210201174709.GA17895@redhat.com

</content>
</entry>
<entry>
<title>x86: Move TS_COMPAT back to asm/thread_info.h</title>
<updated>2021-03-16T21:13:11Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2021-02-01T17:46:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=66c1b6d74cd7035e85c426f0af4aede19e805c8a'/>
<id>urn:sha1:66c1b6d74cd7035e85c426f0af4aede19e805c8a</id>
<content type='text'>
Move TS_COMPAT back to asm/thread_info.h, close to TS_I386_REGS_POKED.

It was moved to asm/processor.h by b9d989c7218a ("x86/asm: Move the
thread_info::status field to thread_struct"), then later 37a8f7c38339
("x86/asm: Move 'status' from thread_struct to thread_info") moved the
'status' field back but TS_COMPAT was forgotten.

Preparatory patch to fix the COMPAT case for get_nr_restart_syscall()

Fixes: 609c19a385c8 ("x86/ptrace: Stop setting TS_COMPAT in ptrace code")
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210201174649.GA17880@redhat.com
</content>
</entry>
<entry>
<title>x86: Reclaim unused x86 TI flags</title>
<updated>2020-11-16T20:53:16Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2020-11-16T17:42:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51af3f23063946344330a77a7d1dece6fc6bb5d8'/>
<id>urn:sha1:51af3f23063946344330a77a7d1dece6fc6bb5d8</id>
<content type='text'>
Reclaim TI flags that were migrated to syscall_work flags.

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/20201116174206.2639648-11-krisman@collabora.com

</content>
</entry>
<entry>
<title>x86: Expose syscall_work field in thread_info</title>
<updated>2020-11-16T20:53:15Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2020-11-16T17:41:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b4581a52caff79eab1ea6caaaa4e08526ce2782b'/>
<id>urn:sha1:b4581a52caff79eab1ea6caaaa4e08526ce2782b</id>
<content type='text'>
This field will be used by SYSCALL_WORK flags, migrated from TI flags.

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/20201116174206.2639648-2-krisman@collabora.com

</content>
</entry>
<entry>
<title>x86: Wire up TIF_NOTIFY_SIGNAL</title>
<updated>2020-10-29T10:29:51Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2020-10-26T20:32:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8d5ed67936fddbe2ae845fc80397718006322d7'/>
<id>urn:sha1:c8d5ed67936fddbe2ae845fc80397718006322d7</id>
<content type='text'>
The generic entry code has support for TIF_NOTIFY_SIGNAL already. Just
provide the TIF bit.

[ tglx: Adopted to other TIF changes in x86 ]

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20201026203230.386348-4-axboe@kernel.dk

</content>
</entry>
<entry>
<title>x86: Reclaim TIF_IA32 and TIF_X32</title>
<updated>2020-10-26T12:46:47Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2020-10-04T03:25:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d71d2bf6efec3032208958c483a247f529ffb16'/>
<id>urn:sha1:8d71d2bf6efec3032208958c483a247f529ffb16</id>
<content type='text'>
Now that these flags are no longer used, reclaim those TIF bits.

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-11-krisman@collabora.com

</content>
</entry>
<entry>
<title>x86: remove address space overrides using set_fs()</title>
<updated>2020-09-09T02:21:36Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2020-09-03T14:22:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=47058bb54b57962b3958a936ddbc59355e4c5504'/>
<id>urn:sha1:47058bb54b57962b3958a936ddbc59355e4c5504</id>
<content type='text'>
Stop providing the possibility to override the address space using
set_fs() now that there is no need for that any more.  To properly
handle the TASK_SIZE_MAX checking for 4 vs 5-level page tables on
x86 a new alternative is introduced, which just like the one in
entry_64.S has to use the hardcoded virtual address bits to escape
the fact that TASK_SIZE_MAX isn't actually a constant when 5-level
page tables are enabled.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>x86/entry: Use generic syscall entry function</title>
<updated>2020-07-24T13:04:59Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2020-07-22T22:00:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=27d6b4d14f5c3ab21c4aef87dd04055a2d7adf14'/>
<id>urn:sha1:27d6b4d14f5c3ab21c4aef87dd04055a2d7adf14</id>
<content type='text'>
Replace the syscall entry work handling with the generic version. Provide
the necessary helper inlines to handle the real architecture specific
parts, e.g. ptrace.

Use a temporary define for idtentry_enter_user which will be cleaned up
seperately.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lkml.kernel.org/r/20200722220520.376213694@linutronix.de


</content>
</entry>
<entry>
<title>Merge tag 'x86-splitlock-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2020-03-31T02:35:52Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-03-31T02:35:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2853d5fafb1e21707e89aa2e227c90bb2c1ea4a9'/>
<id>urn:sha1:2853d5fafb1e21707e89aa2e227c90bb2c1ea4a9</id>
<content type='text'>
Pull x86 splitlock updates from Thomas Gleixner:
 "Support for 'split lock' detection:

  Atomic operations (lock prefixed instructions) which span two cache
  lines have to acquire the global bus lock. This is at least 1k cycles
  slower than an atomic operation within a cache line and disrupts
  performance on other cores. Aside of performance disruption this is a
  unpriviledged form of DoS.

  Some newer CPUs have the capability to raise an #AC trap when such an
  operation is attempted. The detection is by default enabled in warning
  mode which will warn once when a user space application is caught. A
  command line option allows to disable the detection or to select fatal
  mode which will terminate offending applications with SIGBUS"

* tag 'x86-splitlock-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/split_lock: Avoid runtime reads of the TEST_CTRL MSR
  x86/split_lock: Rework the initialization flow of split lock detection
  x86/split_lock: Enable split lock detection by kernel
</content>
</entry>
</feed>
