From: David Miller <davem@davemloft.net>
To: nhorman@tuxdriver.com
Cc: netdev@vger.kernel.org, klassert@mathematik.tu-chemnitz.de
Subject: Re: [PATCH] 3c59x: mask LAST_FRAG bit from length field in ring
Date: Mon, 29 Feb 2016 17:04:00 -0500 (EST) [thread overview]
Message-ID: <20160229.170400.1569899372406597708.davem@davemloft.net> (raw)
In-Reply-To: <1456423370-22797-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Thu, 25 Feb 2016 13:02:50 -0500
> Recently, I fixed a bug in 3c59x:
>
> commit 6e144419e4da11a9a4977c8d899d7247d94ca338
> Author: Neil Horman <nhorman@tuxdriver.com>
> Date: Wed Jan 13 12:43:54 2016 -0500
>
> 3c59x: fix another page map/single unmap imbalance
>
> Which correctly rebalanced dma mapping and unmapping types. Unfortunately it
> introduced a new bug which causes oopses on older systems.
>
> When mapping dma regions, the last entry for a packet in the 3c59x tx ring
> encodes a LAST_FRAG bit, which is encoded as the high order bit of the buffers
> length field. When it is unmapped the LAST_FRAG bit is cleared prior to being
> passed to the unmap function. Unfortunately the commit above fails to do that
> masking. It was missed in testing because the system on which I tested it had
> an intel iommu, the driver for which ignores the size field, using only the DMA
> address as the token to identify the mapping to be released. However, on older
> systems that rely on swiotlb (or other dma drivers that key off that length
> field), not masking off that LAST_FRAG high order bit results in parsing a huge
> size to be release, leading to all sorts of odd corruptions and the like.
>
> Fix is easy, just mask the length with 0xFFF. It should really be
> &(LAST_FRAG-1), but 0xFFF is the style of the file, and I'd like to make this
> fix minimal and correct before making it prettier.
>
> Appies to the net tree cleanly. All testing on both iommu and swiommu based
> systems produce good results
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2016-02-29 22:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 18:02 [PATCH] 3c59x: mask LAST_FRAG bit from length field in ring Neil Horman
2016-02-29 22:04 ` 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=20160229.170400.1569899372406597708.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=klassert@mathematik.tu-chemnitz.de \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).