<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/entry/common.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-04-18T08:37:11Z</updated>
<entry>
<title>x86/fred: Fix INT80 emulation for FRED</title>
<updated>2024-04-18T08:37:11Z</updated>
<author>
<name>Xin Li (Intel)</name>
</author>
<published>2024-04-17T17:47:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32f5f73b79ffdef215e2e1bcb6ad74387c0f925c'/>
<id>urn:sha1:32f5f73b79ffdef215e2e1bcb6ad74387c0f925c</id>
<content type='text'>
Add a FRED-specific INT80 handler and document why it differs from the
current one. Eventually, the common bits will be unified once FRED hw is
available and it turns out that no further changes are needed but for
now, keep the handlers separate for everyone's sanity's sake.

  [ bp: Zap duplicated commit message, massage. ]

Fixes: 55617fb991df ("x86/entry: Do not allow external 0x80 interrupts")
Suggested-by: H. Peter Anvin (Intel) &lt;hpa@zytor.com&gt;
Signed-off-by: Xin Li (Intel) &lt;xin@zytor.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20240417174731.4189592-1-xin@zytor.com
</content>
</entry>
<entry>
<title>x86/bhi: Add support for clearing branch history at syscall entry</title>
<updated>2024-04-08T17:27:05Z</updated>
<author>
<name>Pawan Gupta</name>
</author>
<published>2024-03-11T15:56:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7390db8aea0d64e9deb28b8e1ce716f5020c7ee5'/>
<id>urn:sha1:7390db8aea0d64e9deb28b8e1ce716f5020c7ee5</id>
<content type='text'>
Branch History Injection (BHI) attacks may allow a malicious application to
influence indirect branch prediction in kernel by poisoning the branch
history. eIBRS isolates indirect branch targets in ring0.  The BHB can
still influence the choice of indirect branch predictor entry, and although
branch predictor entries are isolated between modes when eIBRS is enabled,
the BHB itself is not isolated between modes.

Alder Lake and new processors supports a hardware control BHI_DIS_S to
mitigate BHI.  For older processors Intel has released a software sequence
to clear the branch history on parts that don't support BHI_DIS_S. Add
support to execute the software sequence at syscall entry and VMexit to
overwrite the branch history.

For now, branch history is not cleared at interrupt entry, as malicious
applications are not believed to have sufficient control over the
registers, since previous register state is cleared at interrupt
entry. Researchers continue to poke at this area and it may become
necessary to clear at interrupt entry as well in the future.

This mitigation is only defined here. It is enabled later.

Signed-off-by: Pawan Gupta &lt;pawan.kumar.gupta@linux.intel.com&gt;
Co-developed-by: Daniel Sneddon &lt;daniel.sneddon@linux.intel.com&gt;
Signed-off-by: Daniel Sneddon &lt;daniel.sneddon@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;

</content>
</entry>
<entry>
<title>x86/syscall: Don't force use of indirect calls for system calls</title>
<updated>2024-04-08T17:27:05Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-04-03T23:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1e3ad78334a69b36e107232e337f9d693dcc9df2'/>
<id>urn:sha1:1e3ad78334a69b36e107232e337f9d693dcc9df2</id>
<content type='text'>
Make &lt;asm/syscall.h&gt; build a switch statement instead, and the compiler can
either decide to generate an indirect jump, or - more likely these days due
to mitigations - just a series of conditional branches.

Yes, the conditional branches also have branch prediction, but the branch
prediction is much more controlled, in that it just causes speculatively
running the wrong system call (harmless), rather than speculatively running
possibly wrong random less controlled code gadgets.

This doesn't mitigate other indirect calls, but the system call indirection
is the first and most easily triggered case.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Daniel Sneddon &lt;daniel.sneddon@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;

</content>
</entry>
<entry>
<title>x86/entry: Do not allow external 0x80 interrupts</title>
<updated>2023-12-07T17:51:29Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2023-12-04T08:31:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55617fb991df535f953589586468612351575704'/>
<id>urn:sha1:55617fb991df535f953589586468612351575704</id>
<content type='text'>
The INT 0x80 instruction is used for 32-bit x86 Linux syscalls. The
kernel expects to receive a software interrupt as a result of the INT
0x80 instruction. However, an external interrupt on the same vector
also triggers the same codepath.

An external interrupt on vector 0x80 will currently be interpreted as a
32-bit system call, and assuming that it was a user context.

Panic on external interrupts on the vector.

To distinguish software interrupts from external ones, the kernel checks
the APIC ISR bit relevant to the 0x80 vector. For software interrupts,
this bit will be 0.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.0+
</content>
</entry>
<entry>
<title>x86/entry: Convert INT 0x80 emulation to IDTENTRY</title>
<updated>2023-12-07T17:51:29Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2023-12-04T08:31:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be5341eb0d43b1e754799498bd2e8756cc167a41'/>
<id>urn:sha1:be5341eb0d43b1e754799498bd2e8756cc167a41</id>
<content type='text'>
There is no real reason to have a separate ASM entry point implementation
for the legacy INT 0x80 syscall emulation on 64-bit.

IDTENTRY provides all the functionality needed with the only difference
that it does not:

  - save the syscall number (AX) into pt_regs::orig_ax
  - set pt_regs::ax to -ENOSYS

Both can be done safely in the C code of an IDTENTRY before invoking any of
the syscall related functions which depend on this convention.

Aside of ASM code reduction this prepares for detecting and handling a
local APIC injected vector 0x80.

[ kirill.shutemov: More verbose comments ]
Suggested-by: Linus Torvalds &lt;torvalds@linuxfoundation.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.0+
</content>
</entry>
<entry>
<title>x86/entry/32: Clean up syscall fast exit tests</title>
<updated>2023-10-13T11:05:28Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2023-10-11T22:43:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a09a27153f91cd7676b2d4ca574577572a8c999'/>
<id>urn:sha1:1a09a27153f91cd7676b2d4ca574577572a8c999</id>
<content type='text'>
Merge compat and native code and clarify comments.

No change in functionality expected.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Uros Bizjak &lt;ubizjak@gmail.com&gt;
Link: https://lore.kernel.org/r/20231011224351.130935-4-brgerst@gmail.com
</content>
</entry>
<entry>
<title>x86/entry/64: Use TASK_SIZE_MAX for canonical RIP test</title>
<updated>2023-10-13T11:05:28Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2023-10-11T22:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58978b44df7276f7c75a2c6aad6c201421cd4daa'/>
<id>urn:sha1:58978b44df7276f7c75a2c6aad6c201421cd4daa</id>
<content type='text'>
Using shifts to determine if an address is canonical is difficult for
the compiler to optimize when the virtual address width is variable
(LA57 feature) without using inline assembly.  Instead, compare RIP
against TASK_SIZE_MAX.  The only user executable address outside of that
range is the deprecated vsyscall page, which can fall back to using IRET.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Uros Bizjak &lt;ubizjak@gmail.com&gt;
Link: https://lore.kernel.org/r/20231011224351.130935-3-brgerst@gmail.com
</content>
</entry>
<entry>
<title>x86/entry/64: Convert SYSRET validation tests to C</title>
<updated>2023-10-13T11:05:28Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2023-10-11T22:43:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca282b486a570a0bfda5c1a4595ace7fa14243bf'/>
<id>urn:sha1:ca282b486a570a0bfda5c1a4595ace7fa14243bf</id>
<content type='text'>
No change in functionality expected.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Uros Bizjak &lt;ubizjak@gmail.com&gt;
Link: https://lore.kernel.org/r/20231011224351.130935-2-brgerst@gmail.com
</content>
</entry>
<entry>
<title>x86/entry/32: Remove SEP test for SYSEXIT</title>
<updated>2023-10-05T08:06:43Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2023-07-21T16:10:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bab9fa6dc5e4483749838877deebe038de3ce97e'/>
<id>urn:sha1:bab9fa6dc5e4483749838877deebe038de3ce97e</id>
<content type='text'>
SEP must be already be present in order for do_fast_syscall_32() to be
called on native 32-bit, so checking it again is unnecessary.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: https://lore.kernel.org/r/20230721161018.50214-6-brgerst@gmail.com
</content>
</entry>
<entry>
<title>x86/entry/32: Convert do_fast_syscall_32() to bool return type</title>
<updated>2023-10-05T08:06:42Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2023-07-21T16:10:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d3109ad2e6125add5b3c88e8de3fb7bfd4e8c49'/>
<id>urn:sha1:0d3109ad2e6125add5b3c88e8de3fb7bfd4e8c49</id>
<content type='text'>
Doesn't have to be 'long' - this simplifies the code a bit.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: https://lore.kernel.org/r/20230721161018.50214-5-brgerst@gmail.com
</content>
</entry>
</feed>
