[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15a1abe5-2b04-4f67-810d-9a9ab9e2dd6f@meta.com>
Date: Thu, 20 Nov 2025 08:50:38 -0500
From: Chris Mason <clm@...a.com>
To: David Laight <david.laight.linux@...il.com>, bot+bpf-ci@...nel.org
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org, dsahern@...nel.org,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, ast@...nel.org, andrii@...nel.org,
daniel@...earbox.net, martin.lau@...nel.org, eddyz87@...il.com,
yonghong.song@...ux.dev, ihor.solodrai@...ux.dev
Subject: Re: [PATCH 09/44] ipv6: __ip6_append_data() don't abuse max_t() casts
On 11/20/25 6:16 AM, David Laight wrote:
> On Thu, 20 Nov 2025 00:32:34 +0000 (UTC)
> bot+bpf-ci@...nel.org wrote:
>
>>> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
>>> index f904739e9..6fecf2f2c 100644
>>> --- a/net/ipv6/ip6_output.c
>>> +++ b/net/ipv6/ip6_output.c
>>> @@ -1440,7 +1440,7 @@ static int __ip6_append_data(struct sock *sk,
>>> struct sk_buff *skb, *skb_prev = NULL;
>>> struct inet_cork *cork = &cork_full->base;
>>> struct flowi6 *fl6 = &cork_full->fl.u.ip6;
>>> - unsigned int maxfraglen, fragheaderlen, mtu, orig_mtu, pmtu;
>>> + unsigned int maxfraglen, fragheaderlen, mtu, orig_mtu;
>>
>> [ ... ]
>>
>>> @@ -1504,9 +1504,10 @@ static int __ip6_append_data(struct sock *sk,
>>> maxnonfragsize = mtu;
>>>
>>> if (cork->length + length > maxnonfragsize - headersize) {
>>> + int pmtu;
>>> emsgsize:
>>> - pmtu = max_t(int, mtu - headersize + sizeof(struct ipv6hdr), 0);
>>> - ipv6_local_error(sk, EMSGSIZE, fl6, pmtu);
>>> + pmtu = mtu - headersize + (int)sizeof(struct ipv6hdr);
>>> + ipv6_local_error(sk, EMSGSIZE, fl6, max(pmtu, 0));
>>> return -EMSGSIZE;
>>> }
>>
>> Can the variable pmtu be used uninitialized here?
>
> If your AI bot doesn't understand code don't run it.
I ran this locally three more times and this false positive didn't
reproduce, but I'll see if the CI has enough logs to figure out where it
got confused.
Regardless, I'm doing periodic checks for patterns of false positives
and fine tuning the prompts.
-chris
Powered by blists - more mailing lists