Re: [bug report] mctp: Add route input to socket tests

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

 



Hi Dan,

> The patch 8892c0490779: "mctp: Add route input to socket tests" from
> Oct 3, 2021, leads to the following Smatch static checker warning:
> 
>         net/mctp/test/route-test.c:357 mctp_test_route_input_sk()
>         error: dereferencing freed memory 'skb'

[...]

>     351 
>     352         if (params->deliver) {
>     353                 KUNIT_EXPECT_EQ(test, rc, 0);
>     354 
>     355                 skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
>     356                 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, skb2);
> --> 357                 KUNIT_EXPECT_EQ(test, skb->len, 1);
>                                               ^^^
> Use after free.

Yep, that should be skb2.

Thanks for the report! I'll send a fix soon.

Cheers,


Jeremy




[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