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

Re: [PATCH 54/65] x86/stack: Annotate fnptr targets


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 29 Nov 2021 15:41:35 +0100
  • 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=hLldLxqzanr/1+fXhyaA+tKXGIzZtY4THjrEVyz4E8A=; b=a7aYRAqJnjwJX30yPSjiJf2YoCbHxqc9PDvLu3YndVJepS4+24WO4VASySnDXlSwyhFYar11hRXGMM6kvezt12w9g3vU3rLnkR3pT7YckgNgyXPMHlr7mf4vfg/NkcBNkFJuiiYoTCX99mlvm9vDhxpUm3SghWAQrH48KarvpVXiQn4i55Vvp/ZEFQ3B89V8kg/rlw6oHisVCkOSohEif95amleYjQesXVeaKffBBkC1+KeK5Gh3S/Qce282kTbEMYijCu8qL0f8ZNIRbwOKRShf04MINs43yloIxf3vEKbpRWN1tnoVWfeagEXJ/Hxj26bMhcWBjfokr2Brd4EKhQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CZdrfTzo2DmFHoybMHTYegaDMicaLlsZfJOLXqsMhxedXlbEYOM6emtAWuC+nnO4rT7vM9HnQyRGTdqqfc3Vpf09mayL1L5+FGC2nWuPNipMq+BiBS1/1wRX9zeUnu8qh9JU3fSUdnKZjd8W2Cw/P6lFKJqiuLZRF2bgGdCFBysVwM3rLINmdzVlKXRREHEZkurgK7v5NRrptohL8TRSL1TgRko9PBV3QfLNuh4x1umCyjlHJgfBdgESa3bFiQTmJ/FE/5wH59wTYnkGUL42HJB6u1AlIXviOCjtqLQ3i6+hrFB2RN+eDO+KKmNnpo7tygQPEt5bDxcbC1gS3vCbiQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 29 Nov 2021 14:41:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.11.2021 13:34, Andrew Cooper wrote:
> --- a/xen/include/asm-x86/current.h
> +++ b/xen/include/asm-x86/current.h
> @@ -173,7 +173,6 @@ unsigned long get_stack_dump_bottom (unsigned long sp);
>  #define switch_stack_and_jump(fn, instr, constr)                        \
>      ({                                                                  \
>          unsigned int tmp;                                               \
> -        (void)((fn) == (void (*)(void))NULL);                           \
>          BUILD_BUG_ON(!ssaj_has_attr_noreturn(fn));                      \
>          __asm__ __volatile__ (                                          \
>              SHADOW_STACK_WORK                                           \
> @@ -198,6 +197,7 @@ unsigned long get_stack_dump_bottom (unsigned long sp);
>  
>  /* The constraint may only specify non-call-clobbered registers. */
>  #define reset_stack_and_jump_ind(fn)                                    \
> +    (void)((fn) == (void (*)(void))NULL);                               \
>      switch_stack_and_jump(fn, "INDIRECT_JMP %", "b")
>  

While the risk of use in a context really requiring it is low, I
still think we'd be better off wrapping the whole thing in ({ })
then.

Jan




 


Rackspace

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