kernel_samsung_a53x/arch/s390/include/asm
Claudio Imbrenda b332d90ade s390/uv: Panic for set and remove shared access UVC errors
[ Upstream commit cff59d8631e1409ffdd22d9d717e15810181b32c ]

The return value uv_set_shared() and uv_remove_shared() (which are
wrappers around the share() function) is not always checked. The system
integrity of a protected guest depends on the Share and Unshare UVCs
being successful. This means that any caller that fails to check the
return value will compromise the security of the protected guest.

No code path that would lead to such violation of the security
guarantees is currently exercised, since all the areas that are shared
never get unshared during the lifetime of the system. This might
change and become an issue in the future.

The Share and Unshare UVCs can only fail in case of hypervisor
misbehaviour (either a bug or malicious behaviour). In such cases there
is no reasonable way forward, and the system needs to panic.

This patch replaces the return at the end of the share() function with
a panic, to guarantee system integrity.

Fixes: 5abb9351dfd9 ("s390/uv: introduce guest side ultravisor code")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Link: https://lore.kernel.org/r/20240801112548.85303-1-imbrenda@linux.ibm.com
Message-ID: <20240801112548.85303-1-imbrenda@linux.ibm.com>
[frankja@linux.ibm.com: Fixed up patch subject]
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:20:43 +01:00
..
fpu s390/vx: fix save/restore of fpu kernel context 2024-11-18 12:11:58 +01:00
trace Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vdso Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
airq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alternative-asm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alternative.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
appldata.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
archrandom.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
asm-const.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
asm-prototypes.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atomic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atomic_ops.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
barrier.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bitops.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
boot_data.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bugs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cache.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccwdev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccwgroup.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
checksum.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
chpid.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
chsc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clocksource.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cmb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cmpxchg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
compat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpacf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpcmd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu_mcf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu_mf-insn.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu_mf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpufeature.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cputime.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crw.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
css_chars.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ctl_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
current.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
delay.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
diag.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dis.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dma.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwarf.h s390/vdso: Add CFI for RA register to asm macro vdso_func 2024-11-19 11:32:42 +01:00
eadm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ebcdic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
elf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exec.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
extable.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
extmem.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
facility.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fcx.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ftrace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
futex.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gmap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hardirq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hugetlb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hw_irq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
idals.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
idle.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
io.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irqflags.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
isc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
itcw.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jump_label.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kasan.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kbuild Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdebug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kexec.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kprobes.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kvm_host.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kvm_para.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
linkage.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
livepatch.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lowcore.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mem_detect.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mem_encrypt.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmu_context.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmzone.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
module.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nmi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nospec-branch.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nospec-insn.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
numa.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
os_info.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
page-states.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
page.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci_clp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci_debug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci_dma.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci_insn.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci_io.h s390/pci: fix max size calculation in zpci_memcpy_toio() 2024-11-18 12:12:50 +01:00
percpu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
perf_event.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pgalloc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pgtable.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pkey.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pnet.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
preempt.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
processor.h s390: Mark psw in __load_psw_mask() as __unitialized 2024-11-19 14:19:44 +01:00
ptdump.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ptrace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
purgatory.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qdio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
runtime_instr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
schid.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sclp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scsw.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seccomp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sections.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
serial.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
set_memory.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
setup.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
shmparam.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
signal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sigp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sparsemem.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
spinlock.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
spinlock_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stacktrace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
string.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
switch_to.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
syscall.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
syscall_wrapper.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysinfo.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
termios.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
thread_info.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
timex.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tlb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tlbflush.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
topology.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uaccess.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unistd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unwind.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uprobes.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
user.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uv.h s390/uv: Panic for set and remove shared access UVC errors 2024-11-23 23:20:43 +01:00
vdso.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vga.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vmalloc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vmlinux.lds.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vtime.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vtimer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vx-insn.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xor.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00