qemu-e2k/backends
Philippe Mathieu-Daudé eaf2bd2953 backends/cryptodev: Do not abort for invalid session ID
Instead of aborting when a session ID is invalid,
return VIRTIO_CRYPTO_INVSESS ("Invalid session id").

Reproduced using:

  $ cat << EOF | qemu-system-i386 -display none \
     -machine q35,accel=qtest -m 512M -nodefaults \
     -object cryptodev-backend-builtin,id=cryptodev0 \
     -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
     -qtest stdio
  outl 0xcf8 0x80000804
  outw 0xcfc 0x06
  outl 0xcf8 0x80000820
  outl 0xcfc 0xe0008000
  write 0x10800e 0x1 0x01
  write 0xe0008016 0x1 0x01
  write 0xe0008020 0x4 0x00801000
  write 0xe0008028 0x4 0x00c01000
  write 0xe000801c 0x1 0x01
  write 0x110000 0x1 0x05
  write 0x110001 0x1 0x04
  write 0x108002 0x1 0x11
  write 0x108008 0x1 0x48
  write 0x10800c 0x1 0x01
  write 0x108018 0x1 0x10
  write 0x10801c 0x1 0x02
  write 0x10c002 0x1 0x01
  write 0xe000b005 0x1 0x00
  EOF
  Assertion failed: (session_id < MAX_NUM_SESSIONS && builtin->sessions[session_id]),
  function cryptodev_builtin_close_session, file cryptodev-builtin.c, line 430.

Cc: qemu-stable@nongnu.org
Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2274
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20240409094757.9127-1-philmd@linaro.org>
2024-04-10 09:09:34 +02:00
..
tpm migration 1st pull for 9.0 2024-01-05 13:35:25 +00:00
confidential-guest-support.c
cryptodev-builtin.c backends/cryptodev: Do not abort for invalid session ID 2024-04-10 09:09:34 +02:00
cryptodev-hmp-cmds.c hmp: add cryptodev info command 2023-03-07 12:38:59 -05:00
cryptodev-lkcf.c cryptodev: Use CryptoDevBackendOpInfo for operation 2023-03-07 12:38:59 -05:00
cryptodev-vhost-user.c cryptodev-vhost-user: add asymmetric crypto support 2023-06-23 02:54:44 -04:00
cryptodev-vhost.c cryptodev: Introduce cryptodev.json 2023-03-07 12:38:59 -05:00
cryptodev.c backends/cryptodev: Do not ignore throttle/backends Errors 2024-01-19 12:28:59 +01:00
dbus-vmstate1.xml
dbus-vmstate.c backends: Constify VMState 2023-12-30 07:38:06 +11:00
hostmem-epc.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem-file.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem-memfd.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem-ram.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem.c oslib-posix: initialize backend memory objects in parallel 2024-02-06 08:15:22 +01:00
iommufd.c backends/iommufd: Fix missing ERRP_GUARD() for error_prepend() 2024-03-12 11:45:33 +01:00
Kconfig backends/iommufd: Introduce the iommufd object 2023-12-19 19:03:38 +01:00
meson.build configure, meson: rename targetos to host_os 2023-12-31 09:11:29 +01:00
rng-builtin.c
rng-egd.c
rng-random.c
rng.c error: Drop superfluous #include "qapi/qmp/qerror.h" 2023-02-23 13:56:14 +01:00
trace-events backends/iommufd: Introduce the iommufd object 2023-12-19 19:03:38 +01:00
trace.h
vhost-user.c backends/vhost-user: remove the ioeventfd check 2023-03-02 03:10:47 -05:00