linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mpe@ellerman.id.au
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	kvalo@codeaurora.org, linux-kernel@vger.kernel.org,
	security@kernel.org, ivansprundel@ioactive.com
Subject: Re: [PATCH 2/2] airo: Add missing CAP_NET_ADMIN check in AIROOLDIOCTL/SIOCDEVPRIVATE
Date: Thu, 23 Jan 2020 11:03:59 +0100 (CET)	[thread overview]
Message-ID: <20200123.110359.298672160291065670.davem@davemloft.net> (raw)
In-Reply-To: <20200122040728.8437-2-mpe@ellerman.id.au>

From: Michael Ellerman <mpe@ellerman.id.au>
Date: Wed, 22 Jan 2020 15:07:28 +1100

> The driver for Cisco Aironet 4500 and 4800 series cards (airo.c),
> implements AIROOLDIOCTL/SIOCDEVPRIVATE in airo_ioctl().
> 
> The ioctl handler copies an aironet_ioctl struct from userspace, which
> includes a command. Some of the commands are handled in readrids(),
> where the user controlled command is converted into a driver-internal
> value called "ridcode".
> 
> There are two command values, AIROGWEPKTMP and AIROGWEPKNV, which
> correspond to ridcode values of RID_WEP_TEMP and RID_WEP_PERM
> respectively. These commands both have checks that the user has
> CAP_NET_ADMIN, with the comment that "Only super-user can read WEP
> keys", otherwise they return -EPERM.
> 
> However there is another command value, AIRORRID, that lets the user
> specify the ridcode value directly, with no other checks. This means
> the user can bypass the CAP_NET_ADMIN check on AIROGWEPKTMP and
> AIROGWEPKNV.
> 
> Fix it by moving the CAP_NET_ADMIN check out of the command handling
> and instead do it later based on the ridcode. That way regardless of
> whether the ridcode is set via AIROGWEPKTMP or AIROGWEPKNV, or passed
> in using AIRORID, we always do the CAP_NET_ADMIN check.
> 
> Found by Ilja by code inspection, not tested as I don't have the
> required hardware.
> 
> Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied and queued up for -stable.

  reply	other threads:[~2020-01-23 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22  4:07 [PATCH 1/2] airo: Fix possible info leak in AIROOLDIOCTL/SIOCDEVPRIVATE Michael Ellerman
2020-01-22  4:07 ` [PATCH 2/2] airo: Add missing CAP_NET_ADMIN check " Michael Ellerman
2020-01-23 10:03   ` David Miller [this message]
2020-01-23 10:03 ` [PATCH 1/2] airo: Fix possible info leak " David Miller

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=20200123.110359.298672160291065670.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ivansprundel@ioactive.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=security@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).