Go to file
Kuniyuki Iwashima 1ce8362b4a kcm: Fix error handling for SOCK_DGRAM in kcm_sendmsg().
[ Upstream commit a22730b1b4bf437c6bbfdeff5feddf54be4aeada ]

syzkaller found a memory leak in kcm_sendmsg(), and commit c821a88bd720
("kcm: Fix memory leak in error path of kcm_sendmsg()") suppressed it by
updating kcm_tx_msg(head)->last_skb if partial data is copied so that the
following sendmsg() will resume from the skb.

However, we cannot know how many bytes were copied when we get the error.
Thus, we could mess up the MSG_MORE queue.

When kcm_sendmsg() fails for SOCK_DGRAM, we should purge the queue as we
do so for UDP by udp_flush_pending_frames().

Even without this change, when the error occurred, the following sendmsg()
resumed from a wrong skb and the queue was messed up.  However, we have
yet to get such a report, and only syzkaller stumbled on it.  So, this
can be changed safely.

Note this does not change SOCK_SEQPACKET behaviour.

Fixes: c821a88bd720 ("kcm: Fix memory leak in error path of kcm_sendmsg()")
Fixes: ab7ac4eb98 ("kcm: Kernel Connection Multiplexor module")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230912022753.33327-1-kuniyu@amazon.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:00:02 +02:00
arch ARM: dts: BCM5301X: Extend RAM to full 256MB for Linksys EA6500 V2 2023-09-23 11:00:01 +02:00
block block/partition: fix signedness issue for Amiga partitions 2023-07-27 08:37:29 +02:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-22 14:11:22 +02:00
crypto X.509: if signature is unsupported skip validation 2023-09-23 10:59:55 +02:00
Documentation Documentation/sysctl: document page_lock_unfairness 2023-08-30 16:27:27 +02:00
drivers ixgbe: fix timestamp configuration code 2023-09-23 11:00:02 +02:00
fs btrfs: use the correct superblock to compare fsid in btrfs_validate_super 2023-09-23 11:00:00 +02:00
include usb: typec: bus: verify partner exists in typec_altmode_attention 2023-09-23 11:00:01 +02:00
init x86/mm: Initialize text poking earlier 2023-08-08 19:56:36 +02:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2022-12-08 11:23:06 +01:00
kernel tracing: Fix race issue between cpu buffer write and swap 2023-09-23 10:59:52 +02:00
lib idr: fix param name in idr_alloc_cyclic() doc 2023-09-23 10:59:59 +02:00
LICENSES LICENSES: Rename other to deprecated 2019-05-03 06:34:32 -06:00
mm tmpfs: verify {g,u}id mount options correctly 2023-09-23 10:59:40 +02:00
net kcm: Fix error handling for SOCK_DGRAM in kcm_sendmsg(). 2023-09-23 11:00:02 +02:00
samples samples/bpf: Fix buffer overflow in tcp_basertt 2023-07-27 08:37:07 +02:00
scripts kconfig: fix possible buffer overflow 2023-09-23 10:59:57 +02:00
security smackfs: Prevent underflow in smk_set_cipso() 2023-09-23 10:59:46 +02:00
sound ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl 2023-09-23 10:59:54 +02:00
tools perf tools: Handle old data in PERF_RECORD_ATTR 2023-09-23 11:00:00 +02:00
usr initramfs: restore default compression behavior 2020-04-08 09:08:38 +02:00
virt KVM: Destroy target device if coalesced MMIO unregistration fails 2023-03-11 16:44:01 +01:00
.clang-format clang-format: Update with the latest for_each macro list 2019-08-31 10:00:51 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes
.gitignore Modules updates for v5.4 2019-09-22 10:34:46 -07:00
.mailmap ARM: SoC fixes 2019-11-10 13:41:59 -08:00
COPYING
CREDITS MAINTAINERS: Remove Simon as Renesas SoC Co-Maintainer 2019-10-10 08:12:51 -07:00
Kbuild kbuild: do not descend to ./Kbuild when cleaning 2019-08-21 21:03:58 +09:00
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst 2019-06-14 14:21:21 -06:00
MAINTAINERS iio: stx104: Move to addac subdirectory 2023-08-30 16:27:12 +02:00
Makefile Linux 5.4.256 2023-09-02 09:19:19 +02:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

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.