[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v2 1/2] VT-d: avoid NULL deref on domain_context_mapping_one() error paths
- To: "Beulich, Jan" <JBeulich@xxxxxxxx>, Pau Monné, Roger <roger.pau@xxxxxxxxxx>
- From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
- Date: Fri, 8 Apr 2022 04:02:41 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=phGxcuf1slm3xC0SW6r11Hueh97a2kYsmSxyYMVtcsw=; b=beX/Nx1+BUs6gm+3jQ76pZYRiO+ldtPDklhp5uJpa8zT2DqUvE1+eLi6S+UeyStemvDz9nhyvDvMa5qvh8/W4SHOXaylPp5Jk26TrFTUCSxC9WCLnJRRK5OgR2Py6OykNw+7zC+j8U0WxhwQxHrhmx06uOrou87AolqSnTXM4vUEPVIiawa4S8O85fkvfDb+nR2g5cgfLaMkbW/bAYRUxs2Bx+6BkbCl69STvGOaQX63DbQq6+6MK2xks/jfVlGTbnqvOMDX4WM+k7QZhZEkzEOTMTvuCE9mFbYh3g9Kcs/wg7gUMILgX2orEwJQSov78H9UloKtPHjNN6wdsqoCog==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ljicBIL4VZZDGWdEaeFOEPyfJwWRbVJUyl8hACmcBASM+i8OwXureU0x12pblQuoa6Nr8HZIPv7PCX9bQTVK/qWcQ2gpaACwE/DwtBnBKokB/4tVsUYSVSovb3pA92tw1Wsa6CUydMLhpAnrOUCnoXTdT4a63fjTgbqrfz8l7qz4emrN9FFgJQVm2cL8rQ+Ow86RMkmla6Z3omtpx2FwqyRBiR0kcLGk2+WvQZ3WXvKu3CqXHMdIFELWGtiUAwHL4EzoSy/8mf1oHjbfmAW+D2BED3MSWvddHYNF/jASjsLKcR+OoTte8mUPT70zz7s+VGS8Va7u/62plC+THjQDiA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Cooper, Andrew" <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
- Delivery-date: Fri, 08 Apr 2022 04:03:00 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYSkZPFo7HWMZ/FU2EAP8xR7sG9KzkEVSAgAACUACAAVKe4A==
- Thread-topic: [PATCH v2 1/2] VT-d: avoid NULL deref on domain_context_mapping_one() error paths
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Thursday, April 7, 2022 3:50 PM
>
> On 07.04.2022 09:41, Roger Pau Monné wrote:
> > On Thu, Apr 07, 2022 at 08:11:06AM +0200, Jan Beulich wrote:
> >> First there's a printk() which actually wrongly uses pdev in the first
> >> place: We want to log the coordinates of the (perhaps fake) device
> >> acted upon, which may not be pdev.
> >>
> >> Then it was quite pointless for eb19326a328d ("VT-d: prepare for per-
> >> device quarantine page tables (part I)") to add a domid_t parameter to
> >> domain_context_unmap_one(): It's only used to pass back here via
> >> me_wifi_quirk() -> map_me_phantom_function(). Drop the parameter
> again.
> >>
> >> Finally there's the invocation of domain_context_mapping_one(), which
> >> needs to be passed the correct domain ID. Avoid taking that path when
> >> pdev is NULL and the quarantine state is what would need restoring to.
> >> This means we can't security-support PCI devices with RMRRs (if such
> >> exist in practice) any longer.
> >
> > The sentence:
> >
> > "This means we can't security-support PCI devices with RMRRs"
> >
> > Seems too broad and could lead to confusion. So I would maybe use:
> > "legacy PCI devices" or "non PCI Express devices".
>
> Right. I did actually forget to either drop or edit that sentence. I've
> now extended this to
>
> "This means we can't security-support non-PCI-Express devices with RMRRs
> (if such exist in practice) any longer; note that as of trhe 1st of the
> two commits referenced below assigning them to DomU-s is unsupported
> anyway."
>
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
|