Go to file
Marc Zyngier 1e1136fbe8 pinctrl: stmfx: Fix hazardous u8[] to unsigned long cast
commit 1b73e588f47397dee6e4bdfd953e0306c60b5fe5 upstream.

Casting a small array of u8 to an unsigned long is *never* OK:

- it does funny thing when the array size is less than that of a long,
  as it accesses random places in the stack
- it makes everything even more fun with a BE kernel

Fix this by building the unsigned long used as a bitmap byte by byte,
in a way that works across endianess and has no undefined behaviours.

An extra BUILD_BUG_ON() catches the unlikely case where the array
would be larger than a single unsigned long.

Fixes: 1490d9f841 ("pinctrl: Add STMFX GPIO expander Pinctrl/GPIO driver")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Cc: Amelie Delaunay <amelie.delaunay@foss.st.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Link: https://lore.kernel.org/r/20210725180830.250218-1-maz@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-18 13:40:07 +02:00
arch xen: fix setting of max_pfn in shared_info 2021-09-18 13:40:06 +02:00
block blk-zoned: allow BLKREPORTZONE without CAP_SYS_ADMIN 2021-09-18 13:40:06 +02:00
certs certs: Trigger creation of RSA module signing key if it's not an RSA key 2021-09-15 09:50:29 +02:00
crypto crypto: sm2 - fix a memory leak in sm2 2021-07-14 16:56:06 +02:00
Documentation lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ 2021-09-15 09:50:42 +02:00
drivers pinctrl: stmfx: Fix hazardous u8[] to unsigned long cast 2021-09-18 13:40:07 +02:00
fs ceph: fix dereference of null pointer cf 2021-09-18 13:40:06 +02:00
include Revert "time: Handle negative seconds correctly in timespec64_to_ns()" 2021-09-16 12:51:23 +02:00
init sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
ipc ipc/mqueue, msg, sem: avoid relying on a stack reference past its expiry 2021-05-26 12:06:54 +02:00
kernel Revert "posix-cpu-timers: Force next expiration recalc after itimer reset" 2021-09-16 12:51:23 +02:00
lib lib/mpi: use kcalloc in mpi_resize 2021-09-15 09:50:29 +02:00
LICENSES
mm mm/page_alloc: speed up the iteration of max_order 2021-09-12 08:58:26 +02:00
net 9p/xen: Fix end of loop tests for list_for_each_entry 2021-09-18 13:40:06 +02:00
samples samples: pktgen: add missing IPv6 option to pktgen scripts 2021-09-15 09:50:40 +02:00
scripts scripts/tracing: fix the bug that can't parse raw_trace_func 2021-08-12 13:22:12 +02:00
security IMA: remove the dependency on CRYPTO_MD5 2021-09-15 09:50:48 +02:00
sound ASoC: rt5682: Remove unused variable in rt5682_i2c_remove() 2021-09-15 09:50:46 +02:00
tools tools/thermal/tmon: Add cross compiling support 2021-09-18 13:40:07 +02:00
usr
virt KVM: Do not leak memory for duplicate debugfs directories 2021-08-12 13:22:17 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
.mailmap mailmap: add two more addresses of Uwe Kleine-König 2020-12-06 10:19:07 -08:00
COPYING
CREDITS MAINTAINERS: Move Jason Cooper to CREDITS 2020-11-30 10:20:34 +01:00
Kbuild
Kconfig
MAINTAINERS f2fs: move ioctl interface definitions to separated file 2021-05-19 10:13:00 +02:00
Makefile Linux 5.10.66 2021-09-16 12:51:23 +02: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 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.