lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131126174806.GA14789@srcf.ucam.org>
Date:	Tue, 26 Nov 2013 17:48:06 +0000
From:	Matthew Garrett <mjg59@...f.ucam.org>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Khalid Aziz <khalid.aziz@...cle.com>, Chang Liu <cl91tp@...il.com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	Lan Tianyu <tianyu.lan@...el.com>,
	Konstantin Khlebnikov <khlebnikov@...nvz.org>,
	Alan Cox <gnomes@...rguk.ukuu.org.uk>,
	Takao Indoh <indou.takao@...fujitsu.com>,
	Jility <jility09@...il.com>, Florian Otti <f.otti@....at>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH] PCI: add a quirk for keeping Bus Master bit on shutdown

On Tue, Nov 26, 2013 at 10:35:26AM -0700, Bjorn Helgaas wrote:
> On Tue, Nov 26, 2013 at 9:40 AM, Khalid Aziz <khalid.aziz@...cle.com> wrote:
> > Disabling Bus Master bit is effectively a brute force and not an elegant way
> > to stop unwanted DMA. It can have side effects as Alan and others pointed
> > out in the original discussion, and we are now seeing one with Lynx Point on
> > Acer.
> 
> I'm getting more queasy all the time about disabling Bus Master.  I
> don't think RHEL does it, and that's probably where most kexec use is.
>  So I doubt we really have much experience with it yet.

Does Windows disable the BM bit on shutdown? If not, it's likely that 
there are platforms where the SMM code assumes it's still enabled. We 
also know that there are devices that hang if BM is disabled while their 
DMA engines are still running.

Unless we verify that Windows does this, I think there's no way we can 
guarantee that firmware won't make assumptions about the state of PCI. 
The easiest compromise would probably be to set a flag that disables 
busmastering purely when we're performing a kexec.

> > Eric had pointed out in original discussion -
> > <http://marc.info/?l=linux-pci&m=133901193430829&w=2> that this code change
> > moves failure from a random point in the kexec'd kernel to a predictable
> > point on shutdown path where it becomes lot easier to debug than a random
> > memory overwrite.
> 
> That is probably true in some cases, but not this one.  I have no idea
> how to debug this poweroff hang.  Poweroff is a path *everybody* uses,
> so it's much more important to have that work reliably than it is to
> have kexec work.

If it's hanging after we've performed the io writes that trap us into 
SMM, there's no meaningful way for us to debug it. We're violating 
assumptions that the firmware is making, and the only way to fix that is 
to cease violating those assumptions.

-- 
Matthew Garrett | mjg59@...f.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ