From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Wenwen Wang <wang6495@umn.edu>
Cc: Kangjie Lu <kjlu@umn.edu>,
Andreas Noever <andreas.noever@gmail.com>,
Michael Jamet <michael.jamet@intel.com>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] thunderbolt: fix a missing-check bug
Date: Mon, 22 Oct 2018 11:06:09 +0300 [thread overview]
Message-ID: <20181022080609.GN2302@lahna.fi.intel.com> (raw)
In-Reply-To: <1540066556-18088-1-git-send-email-wang6495@umn.edu>
On Sat, Oct 20, 2018 at 03:15:56PM -0500, Wenwen Wang wrote:
> In tb_ring_poll(), the flag of the frame, i.e.,
> 'ring->descriptors[ring->tail].flags', is checked to see whether the frame
> is completed. If yes, the frame including the flag will be read from the
> ring and returned to the caller. The problem here is that the flag is
> actually in a DMA region, which is allocated through dma_alloc_coherent()
> in tb_ring_alloc(). Given that the device can also access this DMA region,
> it is possible that a malicious device controlled by an attacker can modify
> the flag between the check and the copy. By doing so, the attacker can
> bypass the check and supply uncompleted frame, which can cause undefined
> behavior of the kernel and introduce potential security risk.
>
> This patch firstly copies the flag into a local variable 'desc_flags' and
> then performs the check and copy using 'desc_flags'. Through this way, the
> above issue can be avoided.
Same here :)
next prev parent reply other threads:[~2018-10-22 8:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-20 20:15 [PATCH] thunderbolt: fix a missing-check bug Wenwen Wang
2018-10-22 8:06 ` Mika Westerberg [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-10-20 19:47 Wenwen Wang
2018-10-22 8:05 ` Mika Westerberg
2018-10-20 18:38 Wenwen Wang
2018-10-22 8:05 ` Mika Westerberg
2018-10-20 17:55 [PATCH] thunderbolt: Fix " Wenwen Wang
2018-10-22 8:04 ` Mika Westerberg
2018-10-22 13:02 ` Wenwen Wang
2018-10-17 14:00 Wenwen Wang
2018-10-18 9:13 ` Mika Westerberg
2018-10-19 21:25 ` Wenwen Wang
2018-10-20 18:47 ` Yehezkel Bernat
2018-10-22 7:58 ` Mika Westerberg
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=20181022080609.GN2302@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.jamet@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).