lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Oct 2021 20:59:47 +0100
From:   Mark Brown <broonie@...nel.org>
To:     linux-kernel@...r.kernel.org,
        Yang Yingliang <yangyingliang@...wei.com>
Cc:     Mark Brown <broonie@...nel.org>, gregkh@...uxfoundation.org,
        rafael@...nel.org
Subject: Re: [PATCH v2] regmap: Fix possible double-free in regcache_rbtree_exit()

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ