Go to file
Michael Ellerman feea65a338 powerpc/powernv: Fix fortify source warnings in opal-prd.c
As reported by Mahesh & Aneesh, opal_prd_msg_notifier() triggers a
FORTIFY_SOURCE warning:

  memcpy: detected field-spanning write (size 32) of single field "&item->msg" at arch/powerpc/platforms/powernv/opal-prd.c:355 (size 4)
  WARNING: CPU: 9 PID: 660 at arch/powerpc/platforms/powernv/opal-prd.c:355 opal_prd_msg_notifier+0x174/0x188 [opal_prd]
  NIP opal_prd_msg_notifier+0x174/0x188 [opal_prd]
  LR  opal_prd_msg_notifier+0x170/0x188 [opal_prd]
  Call Trace:
    opal_prd_msg_notifier+0x170/0x188 [opal_prd] (unreliable)
    notifier_call_chain+0xc0/0x1b0
    atomic_notifier_call_chain+0x2c/0x40
    opal_message_notify+0xf4/0x2c0

This happens because the copy is targeting item->msg, which is only 4
bytes in size, even though the enclosing item was allocated with extra
space following the msg.

To fix the warning define struct opal_prd_msg with a union of the header
and a flex array, and have the memcpy target the flex array.

Reported-by: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Reported-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Tested-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230821142820.497107-1-mpe@ellerman.id.au
2023-08-24 22:33:04 +10:00
Documentation powerpc/idle: Add support for nohlt 2023-08-18 21:19:13 +10:00
LICENSES
arch powerpc/powernv: Fix fortify source warnings in opal-prd.c 2023-08-24 22:33:04 +10:00
block
certs
crypto
drivers PCI: rpaphp: Error out on busy status from get-sensor-state 2023-08-18 23:30:22 +10:00
fs Bug and regression fixes for 6.5-rc3 for ext4's mballoc and jbd2's 2023-07-23 10:21:49 -07:00
include perf/hw_breakpoint: Remove arch breakpoint hooks 2023-08-16 23:54:50 +10:00
init
io_uring
ipc
kernel perf/hw_breakpoint: Remove arch breakpoint hooks 2023-08-16 23:54:50 +10:00
lib
mm
net Including fixes from BPF, netfilter, bluetooth and CAN. 2023-07-20 14:46:39 -07:00
rust
samples
scripts Kbuild fixes for v6.5 2023-07-23 14:55:41 -07:00
security
sound
tools selftests/powerpc: add const qualification where possible 2023-08-18 17:03:15 +10:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 6.5-rc3 2023-07-23 15:24:10 -07:00
README

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.