From: David Miller <davem@davemloft.net>
To: wang6495@umn.edu
Cc: kjlu@umn.edu, jpr@f6fbb.org, linux-hams@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] yam: fix a missing-check bug
Date: Fri, 05 Oct 2018 11:55:21 -0700 (PDT) [thread overview]
Message-ID: <20181005.115521.804633180942667200.davem@davemloft.net> (raw)
In-Reply-To: <1538755176-22355-1-git-send-email-wang6495@umn.edu>
From: Wenwen Wang <wang6495@umn.edu>
Date: Fri, 5 Oct 2018 10:59:36 -0500
> In yam_ioctl(), the concrete ioctl command is firstly copied from the
> user-space buffer 'ifr->ifr_data' to 'ioctl_cmd' and checked through the
> following switch statement. If the command is not as expected, an error
> code EINVAL is returned. In the following execution the buffer
> 'ifr->ifr_data' is copied again in the cases of the switch statement to
> specific data structures according to what kind of ioctl command is
> requested. However, after the second copy, no re-check is enforced on the
> newly-copied command. Given that the buffer 'ifr->ifr_data' is in the user
> space, a malicious user can race to change the command between the two
> copies. This way, the attacker can inject inconsistent data and cause
> undefined behavior.
>
> This patch adds a re-check in each case of the switch statement if there is
> a second copy in that case, to re-check whether the command obtained in the
> second copy is the same as the one in the first copy. If not, an error code
> EINVAL will be returned.
>
> Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Applied, thanks.
prev parent reply other threads:[~2018-10-05 18:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 15:59 [PATCH] yam: fix a missing-check bug Wenwen Wang
2018-10-05 18:55 ` David Miller [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=20181005.115521.804633180942667200.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jpr@f6fbb.org \
--cc=kjlu@umn.edu \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wang6495@umn.edu \
/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