<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/objtool, branch v5.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-07-12T01:15:25Z</updated>
<entry>
<title>Merge tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2022-07-12T01:15:25Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-07-12T01:15:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce114c866860aa9eae3f50974efc68241186ba60'/>
<id>urn:sha1:ce114c866860aa9eae3f50974efc68241186ba60</id>
<content type='text'>
Pull x86 retbleed fixes from Borislav Petkov:
 "Just when you thought that all the speculation bugs were addressed and
  solved and the nightmare is complete, here's the next one: speculating
  after RET instructions and leaking privileged information using the
  now pretty much classical covert channels.

  It is called RETBleed and the mitigation effort and controlling
  functionality has been modelled similar to what already existing
  mitigations provide"

* tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (54 commits)
  x86/speculation: Disable RRSBA behavior
  x86/kexec: Disable RET on kexec
  x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported
  x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry
  x86/bugs: Add Cannon lake to RETBleed affected CPU list
  x86/retbleed: Add fine grained Kconfig knobs
  x86/cpu/amd: Enumerate BTC_NO
  x86/common: Stamp out the stepping madness
  KVM: VMX: Prevent RSB underflow before vmenter
  x86/speculation: Fill RSB on vmexit for IBRS
  KVM: VMX: Fix IBRS handling after vmexit
  KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS
  KVM: VMX: Convert launched argument to flags
  KVM: VMX: Flatten __vmx_vcpu_run()
  objtool: Re-add UNWIND_HINT_{SAVE_RESTORE}
  x86/speculation: Remove x86_spec_ctrl_mask
  x86/speculation: Use cached host SPEC_CTRL value for guest entry/exit
  x86/speculation: Fix SPEC_CTRL write on SMT state change
  x86/speculation: Fix firmware entry SPEC_CTRL handling
  x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n
  ...
</content>
</entry>
<entry>
<title>x86/ibt, objtool: Don't discard text references from tracepoint section</title>
<updated>2022-07-07T11:26:54Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2022-06-28T10:57:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=38e0e4d04d4187c63d6b511396faae7db6a3cd9e'/>
<id>urn:sha1:38e0e4d04d4187c63d6b511396faae7db6a3cd9e</id>
<content type='text'>
On Tue, Jun 28, 2022 at 04:28:58PM +0800, Pengfei Xu wrote:

&gt; # ./ftracetest
&gt; === Ftrace unit tests ===
&gt; [1] Basic trace file check      [PASS]
&gt; [2] Basic test for tracers      [PASS]
&gt; [3] Basic trace clock test      [PASS]
&gt; [4] Basic event tracing check   [PASS]
&gt; [5] Change the ringbuffer size  [PASS]
&gt; [6] Snapshot and tracing setting        [PASS]
&gt; [7] trace_pipe and trace_marker [PASS]
&gt; [8] Test ftrace direct functions against tracers        [UNRESOLVED]
&gt; [9] Test ftrace direct functions against kprobes        [UNRESOLVED]
&gt; [10] Generic dynamic event - add/remove eprobe events   [FAIL]
&gt; [11] Generic dynamic event - add/remove kprobe events
&gt;
&gt; It 100% reproduced in step 11 and then missing ENDBR BUG generated:
&gt; "
&gt; [ 9332.752836] mmiotrace: enabled CPU7.
&gt; [ 9332.788612] mmiotrace: disabled.
&gt; [ 9337.103426] traps: Missing ENDBR: syscall_regfunc+0x0/0xb0

It turns out that while syscall_regfunc() does have an ENDBR when
generated, it gets sealed by objtool's .ibt_endbr_seal list.

Since the only text references to this function:

  $ git grep syscall_regfunc
  include/linux/tracepoint.h:extern int syscall_regfunc(void);
  include/trace/events/syscalls.h:        syscall_regfunc, syscall_unregfunc
  include/trace/events/syscalls.h:        syscall_regfunc, syscall_unregfunc
  kernel/tracepoint.c:int syscall_regfunc(void)

appear in the __tracepoint section which is excluded by objtool.

Fixes: 3c6f9f77e618 ("objtool: Rework ibt and extricate from stack validation")
Reported-by: Pengfei Xu &lt;pengfei.xu@intel.com
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/Yrrepdaow4F5kqG0@hirez.programming.kicks-ass.net
</content>
</entry>
<entry>
<title>x86/retbleed: Add fine grained Kconfig knobs</title>
<updated>2022-06-29T15:43:41Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2022-06-27T22:21:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f43b9876e857c739d407bc56df288b0ebe1a9164'/>
<id>urn:sha1:f43b9876e857c739d407bc56df288b0ebe1a9164</id>
<content type='text'>
Do fine-grained Kconfig for all the various retbleed parts.

NOTE: if your compiler doesn't support return thunks this will
silently 'upgrade' your mitigation to IBPB, you might not like this.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>objtool: Re-add UNWIND_HINT_{SAVE_RESTORE}</title>
<updated>2022-06-27T08:34:00Z</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2022-06-24T10:52:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8faea26e611189e933ea2281975ff4dc7c1106b6'/>
<id>urn:sha1:8faea26e611189e933ea2281975ff4dc7c1106b6</id>
<content type='text'>
Commit

  c536ed2fffd5 ("objtool: Remove SAVE/RESTORE hints")

removed the save/restore unwind hints because they were no longer
needed. Now they're going to be needed again so re-add them.

Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>objtool: Add entry UNRET validation</title>
<updated>2022-06-27T08:34:00Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2022-06-14T21:16:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a09a6e2399ba0595c3042b3164f3ca68a3cff33e'/>
<id>urn:sha1:a09a6e2399ba0595c3042b3164f3ca68a3cff33e</id>
<content type='text'>
Since entry asm is tricky, add a validation pass that ensures the
retbleed mitigation has been done before the first actual RET
instruction.

Entry points are those that either have UNWIND_HINT_ENTRY, which acts
as UNWIND_HINT_EMPTY but marks the instruction as an entry point, or
those that have UWIND_HINT_IRET_REGS at +0.

This is basically a variant of validate_branch() that is
intra-function and it will simply follow all branches from marked
entry points and ensures that all paths lead to ANNOTATE_UNRET_END.

If a path hits RET or an indirection the path is a fail and will be
reported.

There are 3 ANNOTATE_UNRET_END instances:

 - UNTRAIN_RET itself
 - exception from-kernel; this path doesn't need UNTRAIN_RET
 - all early exceptions; these also don't need UNTRAIN_RET

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>objtool: Update Retpoline validation</title>
<updated>2022-06-27T08:33:59Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2022-06-14T21:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9bb2ec608a209018080ca262f771e6a9ff203b6f'/>
<id>urn:sha1:9bb2ec608a209018080ca262f771e6a9ff203b6f</id>
<content type='text'>
Update retpoline validation with the new CONFIG_RETPOLINE requirement of
not having bare naked RET instructions.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>x86: Add magic AMD return-thunk</title>
<updated>2022-06-27T08:33:59Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2022-06-14T21:15:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a149180fbcf336e97ce4eb2cdc13672727feb94d'/>
<id>urn:sha1:a149180fbcf336e97ce4eb2cdc13672727feb94d</id>
<content type='text'>
Note: needs to be in a section distinct from Retpolines such that the
Retpoline RET substitution cannot possibly use immediate jumps.

ORC unwinding for zen_untrain_ret() and __x86_return_thunk() is a
little tricky but works due to the fact that zen_untrain_ret() doesn't
have any stack ops and as such will emit a single ORC entry at the
start (+0x3f).

Meanwhile, unwinding an IP, including the __x86_return_thunk() one
(+0x40) will search for the largest ORC entry smaller or equal to the
IP, these will find the one ORC entry (+0x3f) and all works.

  [ Alexandre: SVM part. ]
  [ bp: Build fix, massages. ]

Suggested-by: Andrew Cooper &lt;Andrew.Cooper3@citrix.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>objtool: Treat .text.__x86.* as noinstr</title>
<updated>2022-06-27T08:33:59Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2022-06-14T21:15:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=951ddecf435659553ed15a9214e153a3af43a9a1'/>
<id>urn:sha1:951ddecf435659553ed15a9214e153a3af43a9a1</id>
<content type='text'>
Needed because zen_untrain_ret() will be called from noinstr code.

Also makes sense since the thunks MUST NOT contain instrumentation nor
be poked with dynamic instrumentation.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>x86,objtool: Create .return_sites</title>
<updated>2022-06-27T08:33:58Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2022-06-14T21:15:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d9e9d2300681d68a775c28de6aa6e5290ae17796'/>
<id>urn:sha1:d9e9d2300681d68a775c28de6aa6e5290ae17796</id>
<content type='text'>
Find all the return-thunk sites and record them in a .return_sites
section such that the kernel can undo this.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>x86/extable: Annotate ex_handler_msr_mce() as a dead end</title>
<updated>2022-05-27T10:34:45Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-05-20T19:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2028a255f4df3af9e759f01f958d3237f825f256'/>
<id>urn:sha1:2028a255f4df3af9e759f01f958d3237f825f256</id>
<content type='text'>
Fix

  vmlinux.o: warning: objtool: fixup_exception+0x2d6: unreachable instruction

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20220520192729.23969-1-bp@alien8.de
</content>
</entry>
</feed>
