From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/msi: Validate the guest-identified PCI devices in pci_prepare_msix() Date: Wed, 22 Jan 2014 10:28:22 +0000 Message-ID: <52DF9D46.7030904@citrix.com> References: <52DF0F6A.4040309@citrix.com> <1390350251-22323-1-git-send-email-andrew.cooper3@citrix.com> <20140122043128.GA9931@konrad-lan.dumpdata.com> <52DFA2200200007800115B70@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52DFA2200200007800115B70@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , Xen-devel List-Id: xen-devel@lists.xenproject.org On 22/01/14 09:49, Jan Beulich wrote: >>>> On 22.01.14 at 05:31, Konrad Rzeszutek Wilk wrote: >> See attached (and relevant part inlined). >> ... >> (XEN) [2014-01-22 12:27:07] Xen call trace: >> (XEN) [2014-01-22 12:27:07] [] msix_capability_init+0x1dc/0x603 >> (XEN) [2014-01-22 12:27:07] [] pci_enable_msi+0x1be/0x4d7 >> (XEN) [2014-01-22 12:27:07] [] map_domain_pirq+0x222/0x5ad >> (XEN) [2014-01-22 12:27:07] [] physdev_map_pirq+0x507/0x5d1 >> (XEN) [2014-01-22 12:27:07] [] do_physdev_op+0x646/0x119e >> (XEN) [2014-01-22 12:27:07] [] syscall_enter+0xeb/0x145 >> (XEN) [2014-01-22 12:27:07] >> (XEN) [2014-01-22 12:27:07] Pagetable walk from 0000000000000004: > Considering the similarity, this is surely another incarnation of > the same issue. Which gets me to ask first of all - is the device > being acted upon an MSI-X capable one? If not, why is the call > being made? If so (and Xen thinks differently) that's what > needs fixing. > > On that basis I'm also going to ignore your patch for the first > problem, Andrew: It's either incomplete or unnecessary or > fixing the wrong thing. > > Jan > I am going to go with incomplete - it is certainly not unnecessary. The PCI device parameters to pci_prepare_msix() are completely guest controlled; There is no validation of the SBDF at all. ~Andrew