Re: Several kmemleak reports + "refcount_t: underflow; use-after-free" at boot when OF_UNITTEST + OF_OVERLAY is set (Kernel v6.6-rc6, PowerMac G5 11,2)

2023-10-31 Thread Erhard Furtner
On Mon, 30 Oct 2023 11:26:48 -0500
Rob Herring  wrote:

> The test tells you to expect a use-after-free...
> 
> > ---[ end trace <> ]--- ### dt-test ### pass 
> > of_unittest_lifecycle():3209
> > [ cut here ]
> > refcount_t: underflow; use-after-free.  
> 
> Then you get a use-after-free. Looks like it is working as designed.
> 
> I believe it's the same with kmemleak.
> 
> Note that running DT unittests also taints the kernel. That's because
> they are not meant to be run on a production system.
> 
> Rob

My bad, did not realize this is actually intended behaviour... Sorry for the 
noise!

Regards,
Erhard


Re: Several kmemleak reports + "refcount_t: underflow; use-after-free" at boot when OF_UNITTEST + OF_OVERLAY is set (Kernel v6.6-rc6, PowerMac G5 11,2)

2023-10-30 Thread Rob Herring
On Wed, Oct 18, 2023 at 4:38 PM Erhard Furtner  wrote:
>
> Greetings!
>
> Getting this at every boot on my G5 with kernel v6.6-rc6 with OF_UNITTEST and 
> OF_OVERLAY selected:
>
> [...]
> ### dt-test ### EXPECT \ : OF: ERROR: of_node_release() detected bad
> of_node_put() on /testcase-data/refcount-node ### dt-test ### pass
> of_unittest_lifecycle():3189 OF: ERROR: of_node_release() detected bad
> of_node_put() on /testcase-data/refcount-node ### dt-test ### EXPECT / : OF:
> ERROR: of_node_release() detected bad of_node_put() on
> /testcase-data/refcount-node ### dt-test ### EXPECT \ : [ cut here
> ] ### dt-test ### EXPECT \ : WARNING: <> ### dt-test ###
> EXPECT \ : refcount_t: underflow; use-after-free. ### dt-test ### EXPECT \ :

The test tells you to expect a use-after-free...

> ---[ end trace <> ]--- ### dt-test ### pass of_unittest_lifecycle():3209
> [ cut here ]
> refcount_t: underflow; use-after-free.

Then you get a use-after-free. Looks like it is working as designed.

I believe it's the same with kmemleak.

Note that running DT unittests also taints the kernel. That's because
they are not meant to be run on a production system.

Rob