[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d9071d27-ed4d-f789-af90-8477dec82d6b@gmail.com>
Date: Sun, 9 May 2021 17:38:04 -0600
From: David Ahern <dsahern@...il.com>
To: Florian Westphal <fw@...len.de>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] mptcp: avoid uninitialised errno usage
On 5/9/21 4:55 PM, Florian Westphal wrote:
> David Ahern <dsahern@...il.com> wrote:
>>> if (rtnl_talk(grth, &req.n, &answer) < 0) {
>>> fprintf(stderr, "Error talking to the kernel\n");
>>> + if (errno == 0)
>>> + errno = EOPNOTSUPP;
>>
>> you don't list the above string in the output in the commit log. Staring
>> at rtnl_talk and recvmsg and its failure paths, it seems unlikely that
>> path is causing the problem.
>
> Its not in my particular case, but if it would caller would still get random errno.
>
> The sketch I sent merely provides a relible errno whenever ret is less
> than 0. Right now it may or may not have been set.
>
Then let's find and fix those locations.
Unless I missed a code path, rtnl_talk and friends (e.g.,
__rtnl_talk_iov) all set errno before any < 0 return.
Powered by blists - more mailing lists