Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com,
	cjhuang@codeaurora.org
Subject: Re: [PATCH mac80211] cfg80211: check nla_parse_nested return code in nl80211_set_sar_specs
Date: Mon, 22 Nov 2021 09:18:10 +0100	[thread overview]
Message-ID: <a54298c0b747ba562caa47f271f058b9831810ee.camel@sipsolutions.net> (raw)
In-Reply-To: <3b6fee130e2d264242463cff063bcfb6d6f5da83.1637494779.git.lorenzo@kernel.org>

On Sun, 2021-11-21 at 12:41 +0100, Lorenzo Bianconi wrote:
> Check error code returned by nla_parse_nested in nl80211_set_sar_specs
> routine before parsing SAR sub-specs.
> 

I don't think we need to. The policy already states it:

        [NL80211_ATTR_SAR_SPEC] = NLA_POLICY_NESTED(sar_policy),


Since we always parse the top-level already in the generic netlink code,
it will recurse down here by way of that policy link, and then it will
already be validated as much as nla_parse_nested() can do again - so we
only do it again here to actually get access to the pointers.

johannes

  reply	other threads:[~2021-11-22  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21 11:41 [PATCH mac80211] cfg80211: check nla_parse_nested return code in nl80211_set_sar_specs Lorenzo Bianconi
2021-11-22  8:18 ` Johannes Berg [this message]
2021-11-22 10:58   ` Lorenzo Bianconi

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=a54298c0b747ba562caa47f271f058b9831810ee.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=cjhuang@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@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