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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 6 Jan 2022 20:05:15 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Fabio Estevam <festevam@...il.com>
Cc:     Matthias Schiffer <matthias.schiffer@...tq-group.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] regmap: debugfs: Free debugfs_name buffer after usage

On Thu, Jan 06, 2022 at 04:27:32PM -0300, Fabio Estevam wrote:
> On Thu, Jan 6, 2022 at 3:33 PM Mark Brown <broonie@...nel.org> wrote:

> > OK, but what's the logic here?  The name is getting thrown away here but

> I did more debugging and this is what I found:
> The 'debugfs: Directory 'dummy-iomuxc-gpr@...0000' with parent
> 'regmap' already present!' message
> happens since commit cffa4b2122f5 ("regmap: debugfs: Fix a memory leak
> when calling regmap_attach_dev").

Sure, but that just means that the bug with not cleaning up the
directory predates that.  

> # mount -t debugfs none /sys/kernel/debug/
> # cat /sys/kernel/debug/regmap/dummy-iomuxc-gpr@...0000/registers
> 00: 00000000
> 04: 48611005

What happens if the underlying regmap gets freed for some reason?  It
now only remembers the new name, not this old one, so it'll only know to
clean up the old name.

> As shown above, I don't see the '
> /sys/kernel/debug/regmap/20e0000.pinctrl-gpr' directory being created,
> so there is nothing to clean.

Creating that file is the behaviour you are demanding...

> Where exactly would you like me to call regmap_debugfs_exit()?

Before we try to reinitialise debugfs for the new name seems like the
obvious place.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ