Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Luca Coelho <luca@coelho.fi>
Cc: linux-wireless@vger.kernel.org, Luca Coelho <luciano.coelho@intel.com>
Subject: Re: [PATCH 03/11] nl80211: copy the length of dst of src in nl80211_notify_radar_detection()
Date: Sat, 23 Mar 2019 13:34:31 +0100	[thread overview]
Message-ID: <35f813d89f2d0eed572fe9ceb6530ab42d081aa2.camel@sipsolutions.net> (raw)
In-Reply-To: <20190315153907.16192-4-luca@coelho.fi> (sfid-20190315_163933_061932_F931FD25)

On Fri, 2019-03-15 at 17:38 +0200, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
> 
> It is generally safer to copy the length of the destination instead of
> the length of the source, because if the sizes don't match, it's
> usually better to leak some data from the source than to write data
> out of bounds in the destination.
> 
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>  net/wireless/nl80211.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 25a9e3b5c154..239be0e2f9e1 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -8061,7 +8061,7 @@ static int nl80211_notify_radar_detection(struct sk_buff *skb,
>  
>  	cfg80211_sched_dfs_chan_update(rdev);
>  
> -	memcpy(&rdev->radar_chandef, &chandef, sizeof(chandef));
> +	memcpy(&rdev->radar_chandef, &chandef, sizeof(rdev->radar_chandef));

I think we're better off doing a struct assignment here.

johannes


  reply	other threads:[~2019-03-23 12:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15 15:38 [PATCH 00/11] cfg80211/mac80211 patches from our internal tree 2019-03-15 Luca Coelho
2019-03-15 15:38 ` [PATCH 01/11] mac80211: Increase MAX_MSG_LEN Luca Coelho
2019-03-15 15:38 ` [PATCH 02/11] nl80211: increase NL80211_MAX_SUPP_REG_RULES Luca Coelho
2019-03-15 15:38 ` [PATCH 03/11] nl80211: copy the length of dst of src in nl80211_notify_radar_detection() Luca Coelho
2019-03-23 12:34   ` Johannes Berg [this message]
2019-04-17  6:34     ` [PATCH v2 03/11] nl80211: do a struct assignment to radar_chandef instead of memcpy() Luca Coelho
2019-03-15 15:39 ` [PATCH 04/11] cfg80211: Handle WMM rules in regulatory domain intersection Luca Coelho
2019-03-15 15:39 ` [PATCH 05/11] mac80211_hwsim: set p2p device interface support indication Luca Coelho
2019-03-18 10:56   ` Arend Van Spriel
2019-03-15 15:39 ` [PATCH 06/11] cfg80211: don't skip multi-bssid index element Luca Coelho
2019-03-26  4:27   ` [cfg80211] 83db2c9ebd: hwsim.scan_multi_bssid_check_ie.fail kernel test robot
2019-03-15 15:39 ` [PATCH 07/11] cfg80211: support non-inheritance element Luca Coelho
2019-03-15 15:39 ` [PATCH 08/11] mac80211: " Luca Coelho
2019-03-15 15:39 ` [PATCH 09/11] cfg80211: support profile split between elements Luca Coelho
2019-03-19  9:06   ` Dan Carpenter
2019-03-15 15:39 ` [PATCH 10/11] mac80211: " Luca Coelho
2019-03-15 15:39 ` [PATCH 11/11] ieee80211: update HE IEs to D4.0 spec Luca Coelho

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=35f813d89f2d0eed572fe9ceb6530ab42d081aa2.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luca@coelho.fi \
    --cc=luciano.coelho@intel.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