Linux kernel source tree
Go to file
Daniel Mentz f63237f54c iommu/arm-smmu-v3: Fix last_sid_idx calculation for sid_bits==32
The function arm_smmu_init_strtab_2lvl uses the expression

((1 << smmu->sid_bits) - 1)

to calculate the largest StreamID value. However, this fails for the
maximum allowed value of SMMU_IDR1.SIDSIZE which is 32. The C standard
states:

"If the value of the right operand is negative or is greater than or
equal to the width of the promoted left operand, the behavior is
undefined."

With smmu->sid_bits being 32, the prerequisites for undefined behavior
are met.  We observed that the value of (1 << 32) is 1 and not 0 as we
initially expected.

Similar bit shift operations in arm_smmu_init_strtab_linear seem to not
be affected, because it appears to be unlikely for an SMMU to have
SMMU_IDR1.SIDSIZE set to 32 but then not support 2-level Stream tables

This issue was found by Ryan Huang <tzukui@google.com> on our team.

Fixes: ce410410f1 ("iommu/arm-smmu-v3: Add arm_smmu_strtab_l1/2_idx()")
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Link: https://lore.kernel.org/r/20241002015357.1766934-1-danielmentz@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2024-10-08 18:37:48 +01:00
arch ARM64: 2024-10-06 10:53:28 -07:00
block block-6.12-20241004 2024-10-04 10:43:44 -07:00
certs
crypto move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
Documentation platform-drivers-x86 for v6.12-2 2024-10-06 11:11:01 -07:00
drivers iommu/arm-smmu-v3: Fix last_sid_idx calculation for sid_bits==32 2024-10-08 18:37:48 +01:00
fs bcachefs fixes for 6.12-rc2 2024-10-05 15:18:04 -07:00
include Power management fixes for 6.12-rc2 2024-10-04 11:57:15 -07:00
init
io_uring io_uring/net: harden multishot termination case for recv 2024-09-30 08:26:59 -06:00
ipc
kernel Various fixes for tracing: 2024-10-04 12:11:06 -07:00
lib slab fixes for 6.12-rc1 2024-10-04 12:05:39 -07:00
LICENSES
mm mm, slab: suppress warnings in test_leak_destroy kunit test 2024-10-02 16:28:46 +02:00
net Including fixes from ieee802154, bluetooth and netfilter. 2024-10-03 09:44:00 -07:00
rust rust: kunit: use C-string literals to clean warning 2024-10-01 23:46:42 +02:00
samples [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
scripts kbuild: deb-pkg: Remove blank first line from maint scripts 2024-10-07 02:36:38 +09:00
security hardening fixes for v6.12-rc2 2024-10-05 10:19:14 -07:00
sound sound fixes for 6.12-rc2 2024-10-04 11:29:46 -07:00
tools ARM64: 2024-10-06 10:53:28 -07:00
usr
virt x86: 2024-09-28 09:20:14 -07:00
.clang-format
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS platform-drivers-x86 for v6.12-2 2024-10-06 11:11:01 -07:00
Makefile Linux 6.12-rc2 2024-10-06 15:32:27 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.