OrangePi_CM5/arch/x86/xen
Kees Cook 1f730d4ae6 x86/entry: Work around Clang __bdos() bug
[ Upstream commit 3e1730842f142add55dc658929221521a9ea62b6 ]

Clang produces a false positive when building with CONFIG_FORTIFY_SOURCE=y
and CONFIG_UBSAN_BOUNDS=y when operating on an array with a dynamic
offset. Work around this by using a direct assignment of an empty
instance. Avoids this warning:

../include/linux/fortify-string.h:309:4: warning: call to __write_overflow_field declared with 'warn
ing' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wat
tribute-warning]
                        __write_overflow_field(p_size_field, size);
                        ^

which was isolated to the memset() call in xen_load_idt().

Note that this looks very much like another bug that was worked around:
https://github.com/ClangBuiltLinux/linux/issues/1592

Cc: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: xen-devel@lists.xenproject.org
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/lkml/41527d69-e8ab-3f86-ff37-6b298c01d5bc@oracle.com
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:25:45 +02:00
..
Kconfig x86/xen: remove 32-bit Xen PV guest support 2020-08-11 08:26:48 +02:00
Makefile x86/xen: Support objtool validation in xen-asm.S 2022-07-25 11:26:08 +02:00
apic.c xen: branch for v5.9-rc1b 2020-08-14 13:34:37 -07:00
debugfs.c x86: xen: no need to check return value of debugfs_create functions 2019-06-03 15:49:07 +02:00
debugfs.h
…
efi.c efi/libstub: Add definitions for console input and events 2020-05-20 19:09:20 +02:00
enlighten.c xen/x86: prevent PVH type from getting clobbered 2021-10-27 09:56:46 +02:00
enlighten_hvm.c x86/xen: Add xen_no_vector_callback option to test PCI INTX delivery 2021-01-27 11:55:01 +01:00
enlighten_pv.c x86/entry: Work around Clang __bdos() bug 2022-10-26 13:25:45 +02:00
enlighten_pvh.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
grant-table.c x86/xen: open code alloc_vm_area in arch_gnttab_valloc 2020-10-18 09:27:10 -07:00
irq.c x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
mmu.c x86/xen: Add SPDX identifier in arch/x86/xen files 2018-09-03 16:50:33 +02:00
mmu.h mm: update ptep_modify_prot_start/commit to take vm_area_struct as arg 2019-03-05 21:07:18 -08:00
mmu_hvm.c x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
mmu_pv.c xen: branch for v5.10-rc1 2020-10-14 10:34:45 -07:00
multicalls.c treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively 2019-04-09 14:19:06 +02:00
multicalls.h
…
p2m.c xen: fix setting of max_pfn in shared_info 2021-09-18 13:40:06 +02:00
pci-swiotlb-xen.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00
platform-pci-unplug.c xen/pvh: don't try to unplug emulated devices 2018-10-26 09:16:57 +02:00
pmu.c xen: fix is_xen_pmu() 2022-04-08 14:40:29 +02:00
pmu.h xen: fix is_xen_pmu() 2022-04-08 14:40:29 +02:00
setup.c x86/xen: Rename SYS* entry points 2022-07-25 11:26:44 +02:00
smp.c xen/events: only register debug interrupt for 2-level events 2020-10-23 05:41:25 -05:00
smp.h
…
smp_hvm.c xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32 2022-04-13 21:01:01 +02:00
smp_pv.c xen: fix is_xen_pmu() 2022-04-08 14:40:29 +02:00
spinlock.c x86/xen: don't unbind uninitialized lock_kicker_irq 2020-11-09 07:43:45 -06:00
suspend.c
…
suspend_hvm.c xen: Move xen_setup_callback_vector() definition to include/xen/hvm.h 2020-06-11 15:15:19 +02:00
suspend_pv.c locking/seqlock, headers: Untangle the spaghetti monster 2020-08-06 16:13:13 +02:00
time.c xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32 2022-04-13 21:01:01 +02:00
trace.c
…
vga.c
…
xen-asm.S objtool: Add entry UNRET validation 2022-07-25 11:26:45 +02:00
xen-head.S x86/xen: Fix initialisation in hypercall_page after rethunk 2022-07-25 11:26:52 +02:00
xen-ops.h x86/xen: Rename SYS* entry points 2022-07-25 11:26:44 +02:00