<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm64/kernel/traps.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-01-29T09:59:24Z</updated>
<entry>
<title>arm64/bpf: Remove 128MB limit for BPF JIT programs</title>
<updated>2022-01-29T09:59:24Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2021-11-05T16:50:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8b6cb05dc3ff29977daee64ba1900211e65824f'/>
<id>urn:sha1:f8b6cb05dc3ff29977daee64ba1900211e65824f</id>
<content type='text'>
commit b89ddf4cca43f1269093942cf5c4e457fd45c335 upstream.

Commit 91fc957c9b1d ("arm64/bpf: don't allocate BPF JIT programs in module
memory") restricts BPF JIT program allocation to a 128MB region to ensure
BPF programs are still in branching range of each other. However this
restriction should not apply to the aarch64 JIT, since BPF_JMP | BPF_CALL
are implemented as a 64-bit move into a register and then a BLR instruction -
which has the effect of being able to call anything without proximity
limitation.

The practical reason to relax this restriction on JIT memory is that 128MB of
JIT memory can be quickly exhausted, especially where PAGE_SIZE is 64KB - one
page is needed per program. In cases where seccomp filters are applied to
multiple VMs on VM launch - such filters are classic BPF but converted to
BPF - this can severely limit the number of VMs that can be launched. In a
world where we support BPF JIT always on, turning off the JIT isn't always an
option either.

Fixes: 91fc957c9b1d ("arm64/bpf: don't allocate BPF JIT programs in module memory")
Suggested-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Russell King &lt;russell.king@oracle.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Tested-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Link: https://lore.kernel.org/bpf/1636131046-5982-2-git-send-email-alan.maguire@oracle.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-next/misc' into for-next/core</title>
<updated>2021-10-29T11:24:59Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2021-10-29T11:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2bc655ce29422b94fcb4c9710d12664195897e42'/>
<id>urn:sha1:2bc655ce29422b94fcb4c9710d12664195897e42</id>
<content type='text'>
* for-next/misc:
  arm64: Select POSIX_CPU_TIMERS_TASK_WORK
  arm64: Document boot requirements for FEAT_SME_FA64
  arm64: ftrace: use function_nocfi for _mcount as well
  arm64: asm: setup.h: export common variables
  arm64/traps: Avoid unnecessary kernel/user pointer conversion
</content>
</entry>
<entry>
<title>Merge branch 'for-next/extable' into for-next/core</title>
<updated>2021-10-29T11:24:37Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2021-10-29T11:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99fe09c857c69be504ae43d6a417d21eafcc6cfb'/>
<id>urn:sha1:99fe09c857c69be504ae43d6a417d21eafcc6cfb</id>
<content type='text'>
* for-next/extable:
  arm64: vmlinux.lds.S: remove `.fixup` section
  arm64: extable: add load_unaligned_zeropad() handler
  arm64: extable: add a dedicated uaccess handler
  arm64: extable: add `type` and `data` fields
  arm64: extable: use `ex` for `exception_table_entry`
  arm64: extable: make fixup_exception() return bool
  arm64: extable: consolidate definitions
  arm64: gpr-num: support W registers
  arm64: factor out GPR numbering helpers
  arm64: kvm: use kvm_exception_table_entry
  arm64: lib: __arch_copy_to_user(): fold fixups into body
  arm64: lib: __arch_copy_from_user(): fold fixups into body
  arm64: lib: __arch_clear_user(): fold fixups into body
</content>
</entry>
<entry>
<title>arm64: extable: add a dedicated uaccess handler</title>
<updated>2021-10-21T09:45:22Z</updated>
<author>
<name>Mark Rutland</name>
</author>
<published>2021-10-19T16:02:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2e77a62cb3a6d2eb9dd875516411bcd131dd04e7'/>
<id>urn:sha1:2e77a62cb3a6d2eb9dd875516411bcd131dd04e7</id>
<content type='text'>
For inline assembly, we place exception fixups out-of-line in the
`.fixup` section such that these are out of the way of the fast path.
This has a few drawbacks:

* Since the fixup code is anonymous, backtraces will symbolize fixups as
  offsets from the nearest prior symbol, currently
  `__entry_tramp_text_end`. This is confusing, and painful to debug
  without access to the relevant vmlinux.

* Since the exception handler adjusts the PC to execute the fixup, and
  the fixup uses a direct branch back into the function it fixes,
  backtraces of fixups miss the original function. This is confusing,
  and violates requirements for RELIABLE_STACKTRACE (and therefore
  LIVEPATCH).

* Inline assembly and associated fixups are generated from templates,
  and we have many copies of logically identical fixups which only
  differ in which specific registers are written to and which address is
  branched to at the end of the fixup. This is potentially wasteful of
  I-cache resources, and makes it hard to add additional logic to fixups
  without significant bloat.

This patch address all three concerns for inline uaccess fixups by
adding a dedicated exception handler which updates registers in
exception context and subsequent returns back into the function which
faulted, removing the need for fixups specialized to each faulting
instruction.

Other than backtracing, there should be no functional change as a result
of this patch.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: James Morse &lt;james.morse@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: https://lore.kernel.org/r/20211019160219.5202-12-mark.rutland@arm.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm64: Add handling of CNTVCTSS traps</title>
<updated>2021-10-19T09:56:20Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2021-10-17T12:42:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae976f063b605dd558571eff40c8229ffbc39e24'/>
<id>urn:sha1:ae976f063b605dd558571eff40c8229ffbc39e24</id>
<content type='text'>
Since CNTVCTSS obey the same control bits as CNTVCT, add the necessary
decoding to the hook table. Note that there is no known user of
this at the moment.

Acked-by: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20211017124225.3018098-17-maz@kernel.org
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm64/traps: Avoid unnecessary kernel/user pointer conversion</title>
<updated>2021-09-29T15:44:20Z</updated>
<author>
<name>Amit Daniel Kachhap</name>
</author>
<published>2021-09-17T05:58:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5b650f887f30dda15a8d524249e48a407544126'/>
<id>urn:sha1:f5b650f887f30dda15a8d524249e48a407544126</id>
<content type='text'>
Annotating a pointer from kernel to __user and then back again requires
an extra __force annotation to silent sparse warning. In call_undef_hook()
this unnecessary complexity can be avoided by modifying the intermediate
user pointer to unsigned long.

This way there is no inter-changeable use of user and kernel pointers
and the code is consistent.

Note: This patch adds no functional changes to code.

Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Amit Daniel Kachhap &lt;amit.kachhap@arm.com&gt;
Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Link: https://lore.kernel.org/r/20210917055811.22341-1-amit.kachhap@arm.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-next/insn' into for-next/core</title>
<updated>2021-06-24T13:03:24Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2021-06-24T13:03:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=181a126979307a0192f41a4a1fac235d6f4ac9f0'/>
<id>urn:sha1:181a126979307a0192f41a4a1fac235d6f4ac9f0</id>
<content type='text'>
Refactoring of our instruction decoding routines and addition of some
missing encodings.

* for-next/insn:
  arm64: insn: avoid circular include dependency
  arm64: insn: move AARCH64_INSN_SIZE into &lt;asm/insn.h&gt;
  arm64: insn: decouple patching from insn code
  arm64: insn: Add load/store decoding helpers
  arm64: insn: Add some opcodes to instruction decoder
  arm64: insn: Add barrier encodings
  arm64: insn: Add SVE instruction class
  arm64: Move instruction encoder/decoder under lib/
  arm64: Move aarch32 condition check functions
  arm64: Move patching utilities out of instruction encoding/decoding
</content>
</entry>
<entry>
<title>arm64: insn: move AARCH64_INSN_SIZE into &lt;asm/insn.h&gt;</title>
<updated>2021-06-11T10:19:27Z</updated>
<author>
<name>Mark Rutland</name>
</author>
<published>2021-06-09T10:23:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e00e39d9dad48360ebd518726ebf81da1b84c10'/>
<id>urn:sha1:3e00e39d9dad48360ebd518726ebf81da1b84c10</id>
<content type='text'>
For histroical reasons, we define AARCH64_INSN_SIZE in
&lt;asm/alternative-macros.h&gt;, but it would make more sense to do so in
&lt;asm/insn.h&gt;. Let's move it into &lt;asm/insn.h&gt;, and add the necessary
include directives for this.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: https://lore.kernel.org/r/20210609102301.17332-3-mark.rutland@arm.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm64: insn: decouple patching from insn code</title>
<updated>2021-06-11T10:19:27Z</updated>
<author>
<name>Mark Rutland</name>
</author>
<published>2021-06-09T10:23:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78b92c7337e10519312e8aab64d7a1651206bd61'/>
<id>urn:sha1:78b92c7337e10519312e8aab64d7a1651206bd61</id>
<content type='text'>
Currently, &lt;asm/insn.h&gt; includes &lt;asm/patching.h&gt;. We intend that
&lt;asm/insn.h&gt; will be usable from userspace, so it doesn't make sense to
include headers for kernel-only features such as the patching routines,
and we'd intended to restrict &lt;asm/insn.h&gt; to instruction encoding
details.

Let's decouple the patching code from &lt;asm/insn.h&gt;, and explicitly
include &lt;asm/patching.h&gt; where it is needed. Since &lt;asm/patching.h&gt;
isn't included from assembly, we can drop the __ASSEMBLY__ guards.

At the same time, sort the kprobes includes so that it's easier to see
what is and isn't incldued.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: https://lore.kernel.org/r/20210609102301.17332-2-mark.rutland@arm.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm64: entry: split bad stack entry</title>
<updated>2021-06-07T10:35:56Z</updated>
<author>
<name>Mark Rutland</name>
</author>
<published>2021-06-07T09:46:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8168f098867f6584295ea408c683f61e945c6ff1'/>
<id>urn:sha1:8168f098867f6584295ea408c683f61e945c6ff1</id>
<content type='text'>
We'd like to keep all the entry sequencing in entry-common.c, as this
will allow us to ensure this is consistent, and free from any unsound
instrumentation.

Currently handle_bad_stack() performs the NMI entry sequence in traps.c.
Let's split the low-level entry sequence from the reporting, moving the
former to entry-common.c and keeping the latter in traps.c. To make it
clear that reporting function never returns, it is renamed to
panic_bad_stack().

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Marc Zyngier &lt;maz@kernel.org&gt;
Reviewed-by: Joey Gouly &lt;joey.gouly@arm.com&gt;
Cc: James Morse &lt;james.morse@arm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: https://lore.kernel.org/r/20210607094624.34689-17-mark.rutland@arm.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
</feed>
