The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)
Перейти к файлу
Christophe JAILLET 72c4f4200f fsi: Aspeed: Fix a potential double free
[ Upstream commit 83ba7e895d ]

A struct device can never be devm_alloc()'ed.
Here, it is embedded in "struct fsi_master", and "struct fsi_master" is
embedded in "struct fsi_master_aspeed".

Since "struct device" is embedded, the data structure embedding it must be
released with the release function, as is already done here.

So use kzalloc() instead of devm_kzalloc() when allocating "aspeed" and
update all error handling branches accordingly.

This prevent a potential double free().

This also fix another issue if opb_readl() fails. Instead of a direct
return, it now jumps in the error handling path.

Fixes: 606397d67f ("fsi: Add ast2600 master driver")
Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/2c123f8b0a40dc1a061fae982169fe030b4f47e6.1641765339.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:23:44 +02:00
Documentation vsprintf: Fix %pK with kptr_restrict == 0 2022-04-08 14:23:18 +02:00
LICENSES
arch powerpc/pseries: Fix use after free in remove_phb_dynamic() 2022-04-08 14:23:42 +02:00
block block: don't delete queue kobject before its children 2022-04-08 14:23:07 +02:00
certs
crypto crypto: authenc - Fix sleep in atomic context in decrypt_tail 2022-04-08 14:23:05 +02:00
drivers fsi: Aspeed: Fix a potential double free 2022-04-08 14:23:44 +02:00
fs ext2: correct max file size computing 2022-04-08 14:23:35 +02:00
include netfilter: conntrack: Add and use nf_ct_set_auto_assign_helper_warned() 2022-04-08 14:23:42 +02:00
init
ipc ipc/sem: do not sleep with a spin lock held 2022-02-08 18:34:03 +01:00
kernel kernel/resource: fix kfree() of bootmem memory again 2022-04-08 14:23:43 +02:00
lib vsprintf: Fix %pK with kptr_restrict == 0 2022-04-08 14:23:18 +02:00
mm mm/kmemleak: reset tag when compare object pointer 2022-04-08 14:22:56 +02:00
net tipc: fix the timer expires after interval 100ms 2022-04-08 14:23:43 +02:00
samples samples/bpf, xdpsock: Fix race when running for fix duration of time 2022-04-08 14:23:40 +02:00
scripts scripts/dtc: Call pkg-config POSIXly correct 2022-04-08 14:23:29 +02:00
security TOMOYO: fix __setup handlers return values 2022-04-08 14:23:35 +02:00
sound ASoC: amd: Fix reference to PCM buffer address 2022-04-08 14:23:22 +02:00
tools selftests/bpf/test_lirc_mode2.sh: Exit with proper code 2022-04-08 14:23:42 +02:00
usr
virt KVM: Fix lockdep false negative during host resume 2022-03-16 14:23:40 +01:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: adjust file entry for of_net.c after movement 2022-03-08 19:12:53 +01:00
Makefile Linux 5.15.32 2022-03-28 09:58:46 +02: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.