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
Andrej Shadura 37fb0fd3fb Bluetooth: Fix type of len in rfcomm_sock_getsockopt{,_old}()
commit 5fe6caa62b07fd39cd6a28acc8f92ba2955e11a6 upstream.

Commit 9bf4e919ccad worked around an issue introduced after an innocuous
optimisation change in LLVM main:

> len is defined as an 'int' because it is assigned from
> '__user int *optlen'. However, it is clamped against the result of
> sizeof(), which has a type of 'size_t' ('unsigned long' for 64-bit
> platforms). This is done with min_t() because min() requires compatible
> types, which results in both len and the result of sizeof() being casted
> to 'unsigned int', meaning len changes signs and the result of sizeof()
> is truncated. From there, len is passed to copy_to_user(), which has a
> third parameter type of 'unsigned long', so it is widened and changes
> signs again. This excessive casting in combination with the KCSAN
> instrumentation causes LLVM to fail to eliminate the __bad_copy_from()
> call, failing the build.

The same issue occurs in rfcomm in functions rfcomm_sock_getsockopt and
rfcomm_sock_getsockopt_old.

Change the type of len to size_t in both rfcomm_sock_getsockopt and
rfcomm_sock_getsockopt_old and replace min_t() with min().

Cc: stable@vger.kernel.org
Co-authored-by: Aleksei Vetrov <vvvvvv@google.com>
Improves: 9bf4e919ccad ("Bluetooth: Fix type of len in {l2cap,sco}_sock_getsockopt_old()")
Link: https://github.com/ClangBuiltLinux/linux/issues/2007
Link: https://github.com/llvm/llvm-project/issues/85647
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:44:36 +01:00
arch m68k: coldfire/device.c: only build FEC when HW macros are defined 2024-12-14 19:44:31 +01:00
block
certs
crypto crypto: pcrypt - Call crypto layer directly when padata_do_parallel() return -EBUSY 2024-12-14 19:44:23 +01:00
Documentation dt-bindings: clock: axi-clkgen: include AXI clk 2024-12-14 19:44:30 +01:00
drivers tty: ldsic: fix tty_ldisc_autoload sysctl's proc_handler 2024-12-14 19:44:36 +01:00
fs jfs: xattr: check invalid xattr size more strictly 2024-12-14 19:44:35 +01:00
include cgroup: Move rcu_head up near the top of cgroup_root 2024-12-14 19:44:35 +01:00
init initramfs: avoid filename buffer overrun 2024-12-14 19:44:21 +01:00
ipc
kernel cgroup: Make operations on the cgroup root_list RCU safe 2024-12-14 19:44:35 +01:00
lib
LICENSES
mm mm: revert "mm: shmem: fix data-race in shmem_getattr()" 2024-12-14 19:44:19 +01:00
net Bluetooth: Fix type of len in rfcomm_sock_getsockopt{,_old}() 2024-12-14 19:44:36 +01:00
samples bpf: Fix the xdp_adjust_tail sample prog issue 2024-12-14 19:44:26 +01:00
scripts kbuild: Use uname for LINUX_COMPILE_HOST detection 2024-12-14 19:44:19 +01:00
security apparmor: fix 'Do simple duplicate message elimination' 2024-12-14 19:44:34 +01:00
sound ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata() 2024-12-14 19:44:36 +01:00
tools perf trace: Avoid garbage when not printing a syscall's arguments 2024-12-14 19:44:32 +01:00
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.