WSL2-Linux-Kernel/include
Frank Rowand 282f0c63cf of: overlay: rework overlay apply and remove kfree()s
[ Upstream commit 067c098766 ]

Fix various kfree() issues related to of_overlay_apply().
  - Double kfree() of fdt and tree when init_overlay_changeset()
    returns an error.
  - free_overlay_changeset() free the root of the unflattened
    overlay (variable tree) instead of the memory that contains
    the unflattened overlay.
  - For the case of a failure during applying an overlay, move kfree()
    of new_fdt and overlay_mem into free_overlay_changeset(), which
    is called by the function that allocated them.
  - For the case of removing an overlay, the kfree() of new_fdt and
    overlay_mem remains in free_overlay_changeset().
  - Check return value of of_fdt_unflatten_tree() for error instead
    of checking the returned value of overlay_root.
  - When storing pointers to allocated objects in ovcs, do so as
    near to the allocation as possible instead of in deeply layered
    function.

More clearly document policy related to lifetime of pointers into
overlay memory.

Double kfree()
Reported-by: Slawomir Stepien <slawomir.stepien@nokia.com>

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220420222505.928492-3-frowand.list@gmail.com
Stable-dep-of: 39affd1fdf ("of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-21 15:59:12 +02:00
..
acpi ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-11-10 18:15:34 +01:00
asm-generic asm-generic/io.h: suppress endianness warnings for readq() and writeq() 2023-05-11 23:00:15 +09:00
clocksource
crypto crypto: api - Add scaffolding to change completion function signature 2023-05-17 11:50:20 +02:00
drm drm/bridge: Fix returned array size name for atomic_get_input_bus_fmts kdoc 2023-03-22 13:31:26 +01:00
dt-bindings clk: imx8mn: rename vpu_pll to m7_alt_pll 2022-12-31 13:14:12 +01:00
keys
kunit
kvm
linux of: overlay: rework overlay apply and remove kfree()s 2023-06-21 15:59:12 +02:00
math-emu
media media: dvb-core: Fix use-after-free due to race at dvb_register_device() 2023-06-09 10:32:24 +02:00
memory
misc
net net: sched: move rtm_tca_policy declaration to include file 2023-06-14 11:13:03 +02:00
pcmcia
ras Revert "mm/memory-failure.c: fix race with changing page compound again" 2022-07-12 16:35:17 +02:00
rdma
scsi scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress 2023-02-09 11:26:39 +01:00
soc ARM: at91: pm: avoid soft resetting AC DLL 2022-11-26 09:24:34 +01:00
sound ASoC: soc-pcm: Fix DPCM lockdep warning due to nested stream locks 2023-05-17 11:50:26 +02:00
target scsi: target: Fix multiple LUN_RESET handling 2023-05-11 23:00:26 +09:00
trace SUNRPC: Remove svc_rqst::rq_xprt_hlen 2023-05-24 17:36:50 +01:00
uapi ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2023-06-05 09:21:26 +02:00
vdso
video video: of_display_timing.h: include errno.h 2022-07-12 16:35:10 +02:00
xen ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-11 23:00:22 +09:00