From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harini Katakam Subject: Re: [PATCH 1/3] net: macb: fix random memory corruption on RX with 64-bit DMA Date: Mon, 3 Dec 2018 10:14:04 +0530 Message-ID: References: <20181130182137.27974-1-anssi.hannula@bitwise.fi> <20181130182137.27974-2-anssi.hannula@bitwise.fi> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Nicolas Ferre , David Miller , netdev@vger.kernel.org, Harini Katakam , Michal Simek To: anssi.hannula@bitwise.fi Return-path: Received: from mail-ot1-f65.google.com ([209.85.210.65]:38246 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbeLCEoT (ORCPT ); Sun, 2 Dec 2018 23:44:19 -0500 Received: by mail-ot1-f65.google.com with SMTP id e12so10421080otl.5 for ; Sun, 02 Dec 2018 20:44:15 -0800 (PST) In-Reply-To: <20181130182137.27974-2-anssi.hannula@bitwise.fi> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Nov 30, 2018 at 11:53 PM Anssi Hannula wrote: > > 64-bit DMA addresses are split in upper and lower halves that are > written in separate fields on GEM. For RX, bit 0 of the address is used > as the ownership bit (RX_USED). When the RX_USED bit is unset the > controller is allowed to write data to the buffer. > > The driver does not guarantee that the controller already sees the upper > half when the RX_USED bit is cleared, possibly resulting in the > controller writing an incoming frame to an address with an incorrect > upper half and therefore possibly corrupting unrelated system memory. > > Fix that by adding the necessary DMA memory barrier between the writes. > > This corruption was observed on a ZynqMP based system. > > Signed-off-by: Anssi Hannula > Fixes: fff8019a08b6 ("net: macb: Add 64 bit addressing support for GEM") > Cc: Nicolas Ferre > Cc: Harini Katakam > Cc: Michal Simek Acked-by: Harini Katakam Regards, Harini