From: Simon Horman <simon.horman@corigine.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Thierry Escande <thierry.escande@collabora.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nfx: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()
Date: Mon, 15 May 2023 13:40:41 +0200 [thread overview]
Message-ID: <ZGIaOYaSTDUqUrAB@corigine.com> (raw)
In-Reply-To: <4c163376-ce89-786d-3c76-4f10ae818e7a@linaro.org>
On Sun, May 14, 2023 at 11:15:40AM +0200, Krzysztof Kozlowski wrote:
> On 14/05/2023 10:29, Simon Horman wrote:
> > On Sat, May 13, 2023 at 01:51:12PM +0200, Krzysztof Kozlowski wrote:
> >> On 13/05/2023 13:49, Krzysztof Kozlowski wrote:
> >>> If sock->service_name is NULL, the local variable
> >>> service_name_tlv_length will not be assigned by nfc_llcp_build_tlv(),
> >>> later leading to using value frmo the stack. Smatch warning:
> >>>
> >>> net/nfc/llcp_commands.c:442 nfc_llcp_send_connect() error: uninitialized symbol 'service_name_tlv_length'.
> >>
> >> Eh, typo in subject prefix. V2 in shortly...
> >
> > Also, s/frmo/from/
> >
> > And please consider moving local variables towards reverse xmas tree -
> > longest line to shortest - order for networking code.
>
> They were not ordered in the first place, so you prefer me to re-shuffle
> all of them (a bit independent change)?
My slight preference is to move them towards being ordered.
Maybe that is not practical in this case.
As you point out, they are currently out of order.
And if you think re-shuffling can be done, without excess churn,
I think that would be fine.
Given the current state of the code, reverse xmas tree is much more of a
suggestion than a requirement form my side.
next prev parent reply other threads:[~2023-05-15 11:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-13 11:49 [PATCH] nfx: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect() Krzysztof Kozlowski
2023-05-13 11:51 ` Krzysztof Kozlowski
2023-05-14 8:29 ` Simon Horman
2023-05-14 9:15 ` Krzysztof Kozlowski
2023-05-15 11:40 ` Simon Horman [this message]
2023-05-14 8:35 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZGIaOYaSTDUqUrAB@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sameo@linux.intel.com \
--cc=thierry.escande@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).