[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] xen/gnttab: fix gnttab_acquire_resource()
- To: Juergen Gross <jgross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Fri, 9 Sep 2022 10:46:07 +0000
- Accept-language: en-GB, en-US
- 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=DYrE1nb6fk5jHVLSg2xhtonnA9yBZYcqfJ8yFKNw9Ek=; b=Vxp7+Wsp2PsnkbTSt4YFcVQ93zqcoZKRSCtDQbJEx/XEn2KPx4mVF0kgV/wWLxnyZXT6RqfJCCnBU4cwKa6FsRZldcdGBe5B3Yl5Xt/cGEoaiIVvNVbrzWnVuyyOw+5lKUGiX6YiRNXGVbES9zQoqsVvGG2ai2vMef97yUFtWGfgcfKyy7/4DocQGTrwXFVN972zpSyqov0PqUgZE3RZzrjEWw5ad+1/eBL+o0cp+EmVBwtY9B2OQKJdIhcpI8ijIP0HiETs/ODOCD3SZsemZgP0wtnttHP3PG9mkPJ+HsoJI42yFOETshut2e5F0jUEQvoL0F9Z8uinVJyrlWXQ8w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJCM/kIYBQkQDbgyUalGDwANuElqaQvPOq00RXUeS0VlkDcgLuCfL1Y9y0ll1uBQJb9B83aWL6csXP4ACx3aEp61hwAXwhFNXYAQxe5AIevBgqzTxpudo11c5fv8iT2td/yaXCD/1Y2WgcIAbYSIinHf5+ZSPJe0NOz/Rgl/GRCmQQBdxOkrldzMRhHzeb1c/UysjNo3zCx//3X/pr6XnacRfxxBekbMWIc+Da2veEYZYZaYIKRZEQJvRMgDHPjZZe6lwBXb6tchMMzutVFwUAk40nsdvQntX54VAneS6c6rIuf2TDPH+N7IU/qliQWK0/psjIpT9mLLjETseTopwQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "Henry.Wang@xxxxxxx" <Henry.Wang@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Fri, 09 Sep 2022 10:46:17 +0000
- Ironport-data: A9a23:tdSCgq2NPASeR9hTW/bDix16xQzdPnBdZeh5Cdk8DyJ0RKdqp4UqVsiFrcC7hKRYaaMhCUtREvUMlFY3nif4BQ2kcNDFGsSonBV56PUIyOpaiRZF/w5qMoi8mrW/OcrKMANG6T6voiBBVaVMI/Jdi8sqsVoZdRYXi3TWQ/lyPxTTL0Zgwis53Ai24S/iucgzRmCBzS++g/F8PPYJ8o+6YR/qMHBbKleSOxlNATleXwvvFW5yzF6bJNi05YKGj0ZRS+9Uxxzy3Z7oQgX90s6u0yn4Na7uDn8kJSnu1bbiTKAWbagoSLSgFL7yyUMFgIj6wSuBDmJ9kplUJ50aFTUABfKuma6u5MqEP+4eslrZ7yMYpOx7znNEvAHZ44ZAGcXpasdulD0/MUS4NOufdKX0raxiRrgLrpHfZIfORoIqiz1T/WfpapQn+57mnWA1xhxZayG52JqaYcrymTQfcSzIwnF5O+MymSWxjUm/77XLaKREX4hiwxPPxyBGnJT1Z+IBbskA62kEr6q72cBb4wZkqoUnL1c72eGBCOdAk076b9xzJcsvIjbZpNPn18WOdjltu8SsEtCeyigLdkLNrzLJ4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jQCE2wJFS0kiQDZI+RO5M4pfDKIwix7Egb2LqCV+LKPy0ji3J4wgBc85+jK/O23mq+5b5BTp0WwhaAQl2aymNsbRG6j+8Ggbhz75ZsbF4Y0lgAFV1EoHDdXyEwRtEItS1cAfKAALSqwjjVktn/zb6ypXT+kMzv+DeI1ZS6ddZU6nspLqqIWOMzOpdrAmpX9vEB6+jhAtWRYg2krQK0l6JxpoQdP/ooycuf/eY924SEXTrb5x5OFBWPacD0/4bIiOu4TcyAKDCBTE4VgiQojX4fOPdIl4oqpMGKrF9b1VJz6B8XESpT/2oe5fa4vYlkmmqY+beTVC0LoIX4euubv6Q8SioQyX2z3KIAUQTYFYaZ9XTVR8XzeDottXObbp/E7Yku0JwVh1xal98LgtrHL4D8C4nMQyV3VtDtpl2JwRjW9wWI7PCRWahF65O4IIQb6O65n+ociMwL6ngzD8Xri8NJakGQREI4HkuuG4P2Xdat1FhN/xPhrigBHmFlg2NJsiLsNjzgzQL9U8SVx318aon6jmyhPh3vhl8ltstQw26jdl5FcMDG4yuj09aT++IuGkFW1VlQ559nwLOjgFnIkKq4VPghwAc4ff9yohybASWAQfsuTMTNdl8VL0xZYjmQx4fuURq5d4RF31+1kyu3RylBufTiuMZDlI4WaGt3FK+RL0cYcG/agdnAUCpun5ffWJL+A9qIQgMEXgn6VDY8r+tweGwU8DwChD5RKFZtmJodlWlDxXy6XVTiMED+mwBYdDVj7UZTWOFOtdBeQ8Us/m5yT/wUwbEwDm9X3xWPWphL173mnNsPWpJoC09JWrGuLfpFI1MARl3z2/FjZf7JBk27w7vOOnmB6l3x3GD/R2oZI3kpyUtBenBwyqjN+wMj9gHLM+hTVqrcUi/ES8HlqpZhdO8EocFE0NR3+3z
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYxDZS8Zh+WxIH60KiKJYdabVOnK3W6k6A
- Thread-topic: [PATCH v2] xen/gnttab: fix gnttab_acquire_resource()
On 09/09/2022 11:24, Juergen Gross wrote:
> Commit 9dc46386d89d ("gnttab: work around "may be used uninitialized"
> warning") was wrong, as vaddrs can legitimately be NULL in case
> XENMEM_resource_grant_table_id_status was specified for a grant table
> v1. This would result in crashes in debug builds due to
> ASSERT_UNREACHABLE() triggering.
>
> Check vaddrs only to be NULL in the rc == 0 case.
>
> Fixes: 9dc46386d89d ("gnttab: work around "may be used uninitialized"
> warning")
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>
> ---
> Might be considered for backporting
Definitely for backport.
Given that we do actually have a unit(ish) test capable of triggering
this, I would request that tools/tests/resource/test-resource.c gets
extended in the same commit, so we keep our testing in sync with our
bugfixes.
I've just got all the tests working in XenRT, and my comment about
OSSTest fixes for 4.17 on the community call was first and foremost
about wiring up these tests too. They're trivial run (even before the
work to give them a consistent interface - probably 4.18 now), so
there's no excuse for them not to run.
In this case, we create the VMs strictly with gnttab v1, so the size()
and map() calls should fail with -ENODEV (or possibly 0 for size). and
not trigger any assertions in Xen.
~Andrew
|