[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: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 7 Apr 2022 09:41:49 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=B5a0AwH1+6W0V6mgG4NE1u8Cpx6mBKVJKukjtzyKPCg=; b=lTGct5jippnUPw5labweW7cjVeEW24/qPB4VEjAouHaWwhEsBWiVdVb170Ad/nE2eHfA2TkEfh/BWS/3ycDP2EDcpYSr/H3vAOYy6ztzOYk321+MODtvkpaIPLB6GykFuO/UazFMBDvOYMJsSuRXEW4lKtyQ6F1ztiYcsaX+g5HJ1C3vs/yzU8DVWArtBlCa0uOXL9tCXZysNCJ0h3WmcUuzcM2UFnK2rfDzCk5fYrOriAR5hV0G6DBcuSDGsc3tJCMqYAFq/NZUONjGUilaQ05QY9NXhZlSeaLBjD3T08Yhf52mejFUvZPxnv8IBpISz7wzytPYQ9gZIQL9Nq7xrw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IsX7w0K3A2QeVbsOEypXFE0QCVStW5HlcOR8STEGJEqKKmcjSvcE4SfLPaHII/p62DmZ7f56Tx9M/MC1vg4dpWbtDv67ll9E0Vqk0GCh2XvlHKAxgE6Xm6vXEv8or9p+9SJAfyNi+gtXLkprJCT0Azdf7PZH/6OwDKBQWO4MfslSlPbI319m/bzWIw4pbxpvqNgbqeMxormdDz3yaQR411ZwHn6dPNgvLvm1QUNdDjiu74ZROIYgbd1ryD6qVsTOU7Ho1qV/acS264FohNYD4vd8obXECtRFyuYyEumQS0jhCuTadzVnAVJGY8rwDg1KSIeRWn2omOTBALJI+m7kBQ==
- Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
- Delivery-date: Thu, 07 Apr 2022 07:42:15 +0000
- Ironport-data: A9a23:DVWhN6PMqXHxKa/vrR2Jl8FynXyQoLVcMsEvi/4bfWQNrUor1TZWn zMWXmCBbK2NMGvzetB0YYTlp0xUvcWGmNZnHQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFcMpBsJ00o5wbZl2tEw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Z0 ugRvoadUBcQYajjiMteUUlCGTtzFPgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALNs7kMZlZonh95TrYEewnUdbIRKCiCdpwgmdp3ZgfQq+2i 8wxRDZEVB7pWzR1AE4NWY8Dn76qgUm4WmgNwL6SjfVuuDWCpOBr65DuPcTUfJqWRMxTtkeeu m/CuW/+B3kyLNWCzRKV/3TqgfXA9Qv5Uo8PELyz9tZxnUaegGcUDXU+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yENopTZFBYAWSbdj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1fop9an6hNDqWt5I z/Q9NVff91P4srhJlGdZQ8qPuMexzwqC33QRCvyHTcZeg60iH22tbKCItc3pDfRHVP9up0pK j8
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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".
>
> Fixes: 8f41e481b485 ("VT-d: re-assign devices directly")
> Fixes: 14dd241aad8a ("IOMMU/x86: use per-device page tables for quarantining")
> Coverity ID: 1503784
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Thanks, Roger.
|