From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Johannes Berg <johannes@sipsolutions.net>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH][next] wireless: wext-spy: Fix out-of-bounds warning
Date: Thu, 22 Apr 2021 15:03:17 -0500 [thread overview]
Message-ID: <07fc2c3a-ffba-8dad-1ddf-d4da7482c65a@embeddedor.com> (raw)
In-Reply-To: <317099c78edb9fdde3db3f1e7c9a4f77529b281a.camel@sipsolutions.net>
On 4/22/21 02:04, Johannes Berg wrote:
> On Wed, 2021-04-21 at 18:43 -0500, Gustavo A. R. Silva wrote:
>>
>> /* Just do it */
>> - memcpy(&(spydata->spy_thr_low), &(threshold->low),
>> - 2 * sizeof(struct iw_quality));
>> + memcpy(&spydata->spy_thr_low, &threshold->low, sizeof(threshold->low));
>> + memcpy(&spydata->spy_thr_high, &threshold->high, sizeof(threshold->high));
>>
>
> It would've been really simple to stick to 80 columns here (and
> everywhere in the patch), please do that.
>
> Also, why not just use struct assigments?
>
> spydata->spy_thr_low = threshold->low;
>
> etc.
> Done: https://lore.kernel.org/lkml/20210422200032.GA168995@embeddedor/
> Seems far simpler (and shorter lines).
Done:
https://lore.kernel.org/lkml/20210422200032.GA168995@embeddedor/
Thanks for the feedback.
--
Gustavo
prev parent reply other threads:[~2021-04-22 20:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 23:43 [PATCH][next] wireless: wext-spy: Fix out-of-bounds warning Gustavo A. R. Silva
2021-04-22 0:22 ` Kees Cook
2021-04-22 7:04 ` Johannes Berg
2021-04-22 20:03 ` Gustavo A. R. Silva [this message]
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=07fc2c3a-ffba-8dad-1ddf-d4da7482c65a@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=davem@davemloft.net \
--cc=gustavoars@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).