[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC] x86: Fix XEN_DOMCTL_gdbsx_guestmemio crash


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 21 Apr 2022 11:26:27 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=9h7dSRiI6+gKM2CCwrigo35ZuUTH90ivrPDwKdYJ4Mo=; b=c2UH2LRkSdyb+DkMKY36eRExBlsy9JDXWNERKeAbQkwBAXi88DY4FRsvW70wpi/d2tnEiI9PkkM4wcnYKELWxg5TtrlV+LyYqRyCtSsqqqTz3nGdfB6WpmIjXEvnTej6aDgtb9wwzSOdf3/GRuL8axn8YUwwHBnE/xjTNBej/hBOvVhiuLFHXYRuLE0O3Qaxs7K5mecnuds5H7nEBSc9pGc2VYZVL7kjLZBR4yic1led5A6AZnEGvwglQnGMWw2qEzPMYRgSP5M06p27BPYml6751Viqq5txwgNn+aUDl4PHFO9xHPADUB1R2H+/Qk9J853hBMdTZF/392kgJfVllg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R0z45PE26hOgPY+bXEohMjuRL52+wMXs8CtiAC5CMcPFg3lyEldnx9rLPwTuHxK/Kc7PGyKrsxlVj4Q6z4rG7Cpu0OUNRUqJji8sJqghjFj45yLcItW8PsP6jqFkh5WU4xCc6jabEczaLxUxMIz4YM5HV8lx1AEeK2Y6JULwKllmExmuSk8WHDSoLO790iBnQXOll2+mnl298wJkS7IbU7H86i0M/64u2U8gC7M26Ml5gy7icaIJI1W09Ox8o6pBHKdWYQy5evoUslPCcHrR8juYdVZDGvYwKHngd0XXJhk9K7AsHHmJfPbL9GHxEmKbAB3I5JpgD5uyrOmzxCwQRQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 21 Apr 2022 09:26:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.04.2022 18:03, Juergen Gross wrote:
> On 20.04.22 17:56, Andrew Cooper wrote:
>> When CONFIG_GDBSX is compiled out, iommu_do_domctl() falls over a NULL
>> pointer.  It isn't really correct for processing of XEN_DOMCTL_gdbsx_* to 
>> fall
>> into the default case when compiled out.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> ---
>> CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>> CC: Wei Liu <wl@xxxxxxx>
>> CC: Julien Grall <julien@xxxxxxx>
>> CC: Juergen Gross <jgross@xxxxxxxx>
>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
>> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>>
>> RFC, because this has implications across the codebase.  The tl;dr is that
>> case FOO:'s shouldn't be compiled out; we still know what the subops are, 
>> even
>> when the functionality is compiled out.
>>
>> There are several ways to express this.  Alternatives would be:
>>
>>      case XEN_DOMCTL_gdbsx_guestmemio:
>>          if ( !IS_ENABLED(CONFIG_GDBSX) )
>>          {
>>              rc = -EOPNOTSUPP;
>>              break;
>>          }
>>          ...;
>>
>> but given my debugger series creating gdbsx.c, I was also considering:
>>
>>      case XEN_DOMCTL_gdbsx_guestmemio:
>>      case XEN_DOMCTL_gdbsx_pausevcpu:
>>      case XEN_DOMCTL_gdbsx_unpausevcpu:
>>      case XEN_DOMCTL_gdbsx_domstatus:
>>          rc = gdbsx_do_domctl(d, iop);
>>          break;
> 
> I'd go this route.

+1 if we already start enumerating sub-system domctl-s (as proposed
for the IOMMU ones as well).

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.