|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [[PATCH v3]] xen/guest_access: Harden *copy_to_guest_offset() to prevent const dest operand
On 23/04/2020 09:16, Jan Beulich wrote: On 23.04.2020 10:10, Julien Grall wrote:Hi, On 23/04/2020 08:38, Jan Beulich wrote:On 17.04.2020 19:16, Julien Grall wrote:On 16/04/2020 13:19, Jan Beulich wrote:On 16.04.2020 13:24, Julien Grall wrote:From: Julien Grall <jgrall@xxxxxxxxxx> At the moment, *copy_to_guest_offset() will allow the hypervisor to copy data to guest handle marked const. Thankfully, no users of the helper will do that. Rather than hoping this can be caught during review, harden copy_to_guest_offset() so the build will fail if such users are introduced. There is no easy way to check whether a const is NULL in C99. The approach used is to introduce an unused variable that is non-const and assign the handle. If the handle were const, this would fail at build because without an explicit cast, it is not possible to assign a const variable to a non-const variable. Suggested-by: Jan Beulich <jbeulich@xxxxxxxx> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> with one further remark: This is the general rule that we haven't followed on Arm so far. In any case this is followed by: "Before a maintainer checks in their own patch with another community member's R-b but no co-maintainer Ack, it is especially important to give their co-maintainer opportunity to give feedback, perhaps declaring their intention to check it in without their co-maintainers ack a day before doing so." So let's give a couple of days for Stefano to object. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |