[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/2] VT-d: avoid infinite recursion on domain_context_mapping_one() error path
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 7 Apr 2022 09:51:30 +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=v2Kpg8y5RPcHqkiCNsY2dXAlF1DobT7TsFHypAPVAbM=; b=h+WWsf1RpIoro6nGPgT7A568UJ8gLZQn6uE/jc7iwRKYAwaZ+S65wO51zy6ECI9OX9idzWLbIEpsbW6V0OdB8UzKPVd79j8nRXDJuEDWGa3aISvcSMxSl9VzXawEwdEmXYsMXwzbKv4tJX5RewWA6zITjRFKMzmfkjv929BzWuJrX2a3y/RVdlUgnrrsoxtpZ8ryyZz3s2BQOkuTJQY8ISwwQLdYA6u0R0nhgP3tPb1huSItCvHrhN49rLa2WwBaL4zPqAsFa9V8JKqYxYWrTCBphuAr5GELzxytNQh+k/AYT66JkpK4cnu3TWxuviubBVRwNZLIp8j2CaRS1PcRCA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g65vN52xpCMMJKvKPHEoVC58q8HiPYH3IrH6dAm/pCjN0XYkQ+2pc4fbRRgsg3GqNZBHm0uW11UmfsX1iYszwcDCX+LFl45q8jK+sOLwwTPp/8TwG1qTFgxlmf+lCJOS5qdpjJbBKB9VCV+4a7YuWvjX4ABYKcbV7Z4Fqr7QacuVGwED0phZQH94QikYL2zsrXlYx55ET8VpzSRDO62Hq02vQlnQf0ffi+yLCSS/92oyCUfXmVahlCctzxve3dziohuJx/84PPxZVZOxzst+KLVSdEjLN1MvScMH/ekS05jKnBS8jT36cGqOmYkAg7D9ohbCtp/+Cjdo3VsyUdJOKg==
- Authentication-results: esa5.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:51:49 +0000
- Ironport-data: A9a23:m9fQM66EjgUDZieBmhoUzAxRtBTHchMFZxGqfqrLsTDasY5as4F+v jdMWG/TPPuKMDCheookaY2xpE4Bv8OBzdA3SAU+pHxmHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw0XqPp8Zj2tQy2YThXFvU0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurTrFQd3GLLNt905eCMIMAdBIoBU2brYdC3XXcy7lyUqclPpyvRqSko3IZcZ6qB8BmQmG f4wcW5XKErZ3qTvnez9GrIEascLdaEHOKsFvX5t13fBBOsOSpHfWaTao9Rf2V/cg+gQQqiDO ptCM1KDajzyeQBpYVw0BKgCker3n2bcfT5C81ea8P9fD2/7k1UqjemF3MDuUt+HW8RT2FqZr 2Tu/mLlDxVcP9uaoRKd+2+orv/Cm2X8Qo16PL+y++NugVaT7ncOExBQXly+ydGph0j7V99BJ kg8/is1sbN05EGtVsP6XRCzvDiDpBF0ZjZLO7RkskfXkPOSulvHQDhfJt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NPKWsqd 60dpiAr4s+PfP+XZgNdNvpfvHHeFAlYSi8eV56cm6XXJ3uBRr22urKCfMOlaaXRKA=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Apr 07, 2022 at 08:11:45AM +0200, Jan Beulich wrote:
> Despite the comment there infinite recursion was still possible, by
> flip-flopping between two domains. This is because prev_dom is derived
> from the DID found in the context entry, which was already updated by
> the time error recovery is invoked. Simply introduce yet another mode
> flag to prevent rolling back an in-progress roll-back of a prior
> mapping attempt.
>
> Also drop the existing recursion prevention for having been dead anyway:
> Earlier in the function we already bail when prev_dom == domain.
I wonder whether it would be cleaner to stash the previous context
entry if present and try to (re)set that one instead of recurring into
ourselves.
> Fixes: 8f41e481b485 ("VT-d: re-assign devices directly")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Thanks, Roger.
|