From patchwork Sun Jun 19 06:49:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 9186077 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7C58F608A9 for ; Sun, 19 Jun 2016 06:49:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AA7724B44 for ; Sun, 19 Jun 2016 06:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DFE227D16; Sun, 19 Jun 2016 06:49:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C93024B44 for ; Sun, 19 Jun 2016 06:49:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751593AbcFSGtN (ORCPT ); Sun, 19 Jun 2016 02:49:13 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:39119 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbcFSGtM (ORCPT ); Sun, 19 Jun 2016 02:49:12 -0400 Received: from localhost (74-93-104-98-Washington.hfc.comcastbusiness.net [74.93.104.98]) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 6B0B35B7974; Sat, 18 Jun 2016 23:49:11 -0700 (PDT) Date: Sat, 18 Jun 2016 23:49:08 -0700 (PDT) Message-Id: <20160618.234908.1671877676732375612.davem@davemloft.net> To: matorola@gmail.com Cc: mroos@linux.ee, sparclinux@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: 4.6-rc*: Kernel unaligned access at pci_bus_read_config_dword+0x64/0x80 From: David Miller In-Reply-To: <20160618.210421.1400395696678491125.davem@davemloft.net> References: <20160618.210421.1400395696678491125.davem@davemloft.net> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 18 Jun 2016 23:49:11 -0700 (PDT) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: David Miller Date: Sat, 18 Jun 2016 21:04:21 -0700 (PDT) > From: Anatoly Pugachev > Date: Thu, 16 Jun 2016 13:02:07 +0300 > >> bisected to git commit 63e3027 > > That's a merge commit that adds 100 different commits, and this happened > way back in March. > > Please find the exact dword access in: > > drivers/pci/pcie/portdrv_{core,pci,bus}.c > > that triggers this unaligned access so we can debug this further. Meanwhile I figured it out, this should fix the bug: --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/vc.c b/drivers/pci/vc.c index dfbab61..1fa3a32 100644 --- a/drivers/pci/vc.c +++ b/drivers/pci/vc.c @@ -221,9 +221,9 @@ static int pci_vc_do_save_buffer(struct pci_dev *dev, int pos, else pci_write_config_word(dev, pos + PCI_VC_PORT_CTRL, *(u16 *)buf); - buf += 2; + buf += 4; } - len += 2; + len += 4; /* * If we have any Low Priority VCs and a VC Arbitration Table Offset