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

Re: [PATCH][4.15] x86/shadow: replace bogus return path in shadow_get_page_from_l1e()


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 26 Feb 2021 15:21:43 +0000
  • 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-SenderADCheck; bh=/iZkzWXubcciC54G3U/GV6lU27YWtOlUMpJqcCJP3nU=; b=LXA8H8X3EI6KJEGhCHdA4T3fJaPNpd8V0v6+x5SXcTJWudV5KEQVi8Rm9zkrW69EerkVTXg9/+v66GscXK94pTAPsyzGVp9dOisYV2ywhuDJfDjDMaSO6vu91t6nyC5sCIz0hnSJovZ36MeWj96JXXYjbU3pTy/bAm85qDzumYUG+trnPxFAmAVbkWEPrutvrra8yZksleJtiw/5ZjRvC0DDpjojD2xCY82hFF1Q+lCf7PTj6mYijCNMibObFrl3nIxftIFgvj16cLL18PATqb40yyxYJCTpEf6nyXFQjX1AzibHRPcXCZ/GyjHHREJVZAgctPWYQ60VWB247WwkEQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q89+pG9mpgPrq1fRhDBwXWdxBa7P0iyfp+vVoCVpKgIkIgNB2SbSDQPWEtZU9/Vz0sSwFEfz8vS+rVj9GK0mHBzPKUUMEnrRKmqKXFk4q2mE6z0JXkLetJcw8UkR62Pjjak42/B5uNYXdQcFTt5zmrmAetC4J1/GIAoYpuONti5O0shucy0ONSOcWbnxIVb3qVyaLIiw2yNiF6q++ONUg/mT0xjC7EPXMLF0fBmpY+tXFGksrDDPmMCXYm3BDV0hGPaaRI0dLdOE0HWi+yZrfKanuPMmdfSoApfJeDiMMVeNr8QE5flAuazE++z2+H32rkObglCI6yfbpSckeOQ2KA==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Tim Deegan <tim@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Wei Liu" <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Fri, 26 Feb 2021 15:22:12 +0000
  • Ironport-sdr: K/cACOhBasEEdJMhaZj4BlKAsgJKncI0787NmpSm6EWGAbhiwPYx69eMevOxaVFvctfQR3h2gx RKsm/iBQ4LBC+DmN5Y043MwE9LLO6kMPds+YoUrMzllIzPV6M9rSEXkvJIc/cjEt7OiK8xojNA 1B6upNlf4NqJSGIFcwQ8nyIl6FztOmX/GdORBSCvYmMXhc+7rFoZLgZsdZcLBiPOIEE2XclOj1 bHKV/iLf/sF8rlruli4saqNGeMe4d4+XUQRRUhdgWgxl0Nkgn4WsWb2HCtDmCksEdqntiNSian PpI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26/02/2021 15:08, Jan Beulich wrote:
> Prior to be640b1800bb ("x86: make get_page_from_l1e() return a proper
> error code") a positive return value did indicate an error. Said commit
> failed to adjust this return path, but luckily the only caller has
> always been inside a shadow_mode_refcounts() conditional.
>
> Subsequent changes caused 1 to end up at the default (error) label in
> the caller's switch() again, but the returning of 1 (== _PAGE_PRESENT)
> is still rather confusing here, and a latent risk.
>
> Convert to an ASSERT() instead, just in case any new caller would
> appear.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Yikes, and only 9 years to notice.

Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>



 


Rackspace

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