[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220523211700.GA236401@roeck-us.net>
Date: Mon, 23 May 2022 14:17:00 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Wang Kefeng <wangkefeng.wang@...wei.com>
Cc: Russell King <linux@...linux.org.uk>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ARM: 9192/1: amba: fix memory leak in
amba_device_try_add()
On Mon, Apr 18, 2022 at 07:07:14AM +0100, Wang Kefeng wrote:
> If amba_device_try_add() return error code (not EPROBE_DEFER),
> memory leak occurred when amba device fails to read periphid.
>
This patch results in a refcount underflow.
NET: Registered PF_NETLINK/PF_ROUTE protocol family
DMA: preallocated 256 KiB pool for atomic coherent allocations
platform vga: Fixing up cyclic dependency with bridge
OF: amba_device_add() failed (-19) for /amba/smc@...00000
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at lib/refcount.c:28 of_platform_bus_create+0x33c/0x3dc
refcount_t: underflow; use-after-free.
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 5.18.0-next-20220523 #1
Hardware name: ARM-Versatile (Device Tree Support)
unwind_backtrace from show_stack+0x10/0x14
show_stack from dump_stack_lvl+0x38/0x5c
dump_stack_lvl from __warn+0xc8/0x1d4
__warn from warn_slowpath_fmt+0x90/0xc8
warn_slowpath_fmt from of_platform_bus_create+0x33c/0x3dc
of_platform_bus_create from of_platform_bus_create+0x1ec/0x3dc
of_platform_bus_create from of_platform_populate+0x68/0xd8
of_platform_populate from customize_machine+0x1c/0x30
customize_machine from do_one_initcall+0x8c/0x2fc
do_one_initcall from kernel_init_freeable+0x190/0x220
kernel_init_freeable from kernel_init+0x10/0x108
kernel_init from ret_from_fork+0x14/0x3c
Guenter
---
# bad: [cc63e8e92cb872081f249ea16e6c460642f3e4fb] Add linux-next specific files for 20220523
# good: [4b0986a3613c92f4ec1bdc7f60ec66fea135991f] Linux 5.18
git bisect start 'HEAD' 'v5.18'
# bad: [a812cac8ff60a3f57d59225eaf668f574fd36a65] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
git bisect bad a812cac8ff60a3f57d59225eaf668f574fd36a65
# bad: [ad67b5f981704e575b24e3b650653bae607980dc] Merge branch 'for-next' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git
git bisect bad ad67b5f981704e575b24e3b650653bae607980dc
# bad: [793dd6392ef951ae61473acfc7e7016ea22c40f4] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
git bisect bad 793dd6392ef951ae61473acfc7e7016ea22c40f4
# good: [00ad84f582be91dd03132c133917cc6b62d754e2] Merge branch 'arm/dt' into for-next
git bisect good 00ad84f582be91dd03132c133917cc6b62d754e2
# bad: [5c4a49fbe99c7c9b814d677ac99e3efcc43d019a] Merge branch 'for-next/core' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
git bisect bad 5c4a49fbe99c7c9b814d677ac99e3efcc43d019a
# good: [33cd6948f953ab47ffa493bac6c0f34feb191e0d] Merge branch 'clang-format' of https://github.com/ojeda/linux.git
git bisect good 33cd6948f953ab47ffa493bac6c0f34feb191e0d
# good: [d6fc5db0f82828c74742319cb6c988c4a8aac535] Merge branch 'for-next/kselftest' into for-next/core
git bisect good d6fc5db0f82828c74742319cb6c988c4a8aac535
# good: [d7015e50a9ed180dcc3947635bb2b5711c37f48b] perf intel-pt: Add support for emulated ptwrite
git bisect good d7015e50a9ed180dcc3947635bb2b5711c37f48b
# good: [5b86b659fa4b3dd45acbdce13f2e94f882a3d125] Merge branch 'for-next' of git://git.infradead.org/users/hch/dma-mapping.git
git bisect good 5b86b659fa4b3dd45acbdce13f2e94f882a3d125
# good: [945980a9ba0744038659769e9f04e83e8f6b494b] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
git bisect good 945980a9ba0744038659769e9f04e83e8f6b494b
# bad: [b6f21d14f1ac1261579b691673a0c823275cbaf8] ARM: 9204/2: module: Add all unwind tables when load module
git bisect bad b6f21d14f1ac1261579b691673a0c823275cbaf8
# bad: [c4f486f1e7b34b27ec578494a236061b337d50ae] ARM: 9198/1: spectre-bhb: simplify BPIALL vector macro
git bisect bad c4f486f1e7b34b27ec578494a236061b337d50ae
# bad: [7719a68b2fa404fa8af6b0b7119a38c406c74858] ARM: 9192/1: amba: fix memory leak in amba_device_try_add()
git bisect bad 7719a68b2fa404fa8af6b0b7119a38c406c74858
# good: [1f44de0f5e309e8699b569b49a8e89ef4e7527c7] ARM: 9193/1: amba: Add amba_read_periphid() helper
git bisect good 1f44de0f5e309e8699b569b49a8e89ef4e7527c7
# first bad commit: [7719a68b2fa404fa8af6b0b7119a38c406c74858] ARM: 9192/1: amba: fix memory leak in amba_device_try_add()
Powered by blists - more mailing lists