Re: [bug report] net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

I think for now I would like to just remove that line, and then I will try to
come up with a better test.

Not sure about how to add it to KASan test dir? Would that just be a reference
to this test to avoid bug reporting?

BR
Steen

On Sat, 2023-03-25 at 10:35 +0300, Dan Carpenter wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> Hello Steen Hegelund,
> 
> The patch c956b9b318d9: "net: microchip: sparx5: Adding KUNIT tests
> of key/action values in VCAP API" from Nov 9, 2022, leads to the
> following Smatch static checker warning:
> 
>         drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:1416
> vcap_api_encode_rule_test()
>         warn: 'rule' was already freed.
> 
> drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c
>     1406
>     1407         /* Check that the rule has been added */
>     1408         ret = list_empty(&is2_admin.rules);
>     1409         KUNIT_EXPECT_EQ(test, false, ret);
>     1410         KUNIT_EXPECT_EQ(test, 0, ret);
>     1411         vcap_free_rule(rule);
>     1412
>     1413         /* Check that the rule has been freed: tricky to access since
> this
>     1414          * memory should not be accessible anymore
>     1415          */
> --> 1416         KUNIT_EXPECT_PTR_NE(test, NULL, rule);
> 
> Obviously the comments say that this is already free so it's going to be
> "tricky".  :P  What's happening here?  This is to test that KASan will
> crash properly?  Could we put that in the normal KASan tset directory so
> that we can ignore those deliberate crashing bugs?
> 
>     1417         ret = list_empty(&rule->keyfields);
>     1418         KUNIT_EXPECT_EQ(test, true, ret);
>     1419         ret = list_empty(&rule->actionfields);
>     1420         KUNIT_EXPECT_EQ(test, true, ret);
>     1421 }
> 
> regards,
> dan carpenter





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux