lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] regmap: Fix possible double-free in regcache_rbtree_exit()
Date
On Tue, 12 Oct 2021 10:37:35 +0800, Yang Yingliang wrote:
> In regcache_rbtree_insert_to_block(), when 'present' realloc failed,
> the 'blk' which is supposed to assign to 'rbnode->block' will be freed,
> so 'rbnode->block' points a freed memory, in the error handling path of
> regcache_rbtree_init(), 'rbnode->block' will be freed again in
> regcache_rbtree_exit(), KASAN will report double-free as follows:
>
> BUG: KASAN: double-free or invalid-free in kfree+0xce/0x390
> Call Trace:
> slab_free_freelist_hook+0x10d/0x240
> kfree+0xce/0x390
> regcache_rbtree_exit+0x15d/0x1a0
> regcache_rbtree_init+0x224/0x2c0
> regcache_init+0x88d/0x1310
> __regmap_init+0x3151/0x4a80
> __devm_regmap_init+0x7d/0x100
> madera_spi_probe+0x10f/0x333 [madera_spi]
> spi_probe+0x183/0x210
> really_probe+0x285/0xc30
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: Fix possible double-free in regcache_rbtree_exit()
commit: 55e6d8037805b3400096d621091dfbf713f97e83

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

\
 
 \ /
  Last update: 2021-10-13 22:01    [W:0.034 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site