No description
  • C 98.2%
  • Assembly 1%
  • Makefile 0.3%
  • Shell 0.2%
  • Python 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
D Scott Phillips 1db90f97d7 arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
commit 8ec8490a1950efeccb00967698cf7cb2fcd25ca7 upstream.

CONFIG_UBSAN_SHIFT with gcc-5 complains that the shifting of
ARM_CPU_IMP_AMPERE (0xC0) into bits [31:24] by MIDR_CPU_MODEL() is
undefined behavior. Well, sort of, it actually spells the error as:

 arch/arm64/kernel/proton-pack.c: In function 'spectre_bhb_loop_affected':
 arch/arm64/include/asm/cputype.h:44:2: error: initializer element is not constant
   (((imp)   << MIDR_IMPLEMENTOR_SHIFT) | \
   ^

This isn't an issue for other Implementor codes, as all the other codes
have zero in the top bit and so are representable as a signed int.

Cast the implementor code to unsigned in MIDR_CPU_MODEL to remove the
undefined behavior.

Fixes: 0e5d5ae837c8 ("arm64: Add AMPERE1 to the Spectre-BHB affected list")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
Link: https://lore.kernel.org/r/20221102160106.1096948-1-scott@os.amperecomputing.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 11:53:54 +02:00
arch arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro 2023-08-11 11:53:54 +02:00
block
certs
crypto
Documentation Documentation: security-bugs.rst: clarify CVE handling 2023-08-11 11:53:52 +02:00
drivers cpufreq: intel_pstate: Drop ACPI _PSS states table patching 2023-08-11 11:53:53 +02:00
fs btrfs: fix race between quota disable and quota assign ioctls 2023-08-11 11:53:54 +02:00
include block: Fix a source code comment in include/uapi/linux/blkzoned.h 2023-08-11 11:53:49 +02:00
init
ipc
kernel tracing: Fix warning in trace_buffered_event_disable() 2023-08-11 11:53:50 +02:00
lib
LICENSES
mm
net net/sched: sch_qfq: account for stab overhead in qfq_enqueue 2023-08-11 11:53:54 +02:00
samples
scripts
security
sound ASoC: cs42l51: fix driver to properly autoload with automatic module loading 2023-08-11 11:53:54 +02:00
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
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 Restructured Text 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.