]> git.ipfire.org Git - thirdparty/linux.git/commit
s390/vfio_ccw: Calculate idal length based on idaw type
authorEric Farman <farman@linux.ibm.com>
Tue, 28 Jul 2026 03:30:17 +0000 (05:30 +0200)
committerChristian Borntraeger <borntraeger@linux.ibm.com>
Thu, 30 Jul 2026 17:50:19 +0000 (19:50 +0200)
commit4f6fdc6e1a7fbfa36b945af33c65a417948feac0
treee589f63bf892fd9b3bf343816a7c7c58ed7b75c5
parent565bef268d75bf7df665bce6923a88cd0eb74592
s390/vfio_ccw: Calculate idal length based on idaw type

Sashiko pointed out that get_guest_idal() unconditionally calculates
the length of the IDAL presuming everything is a Format-2 IDAW.

The output of vfio-ccw is always Format-2, but the input can be either
Format-1 (31-bit addresses) or Format-2 (64-bit addresses). As a result,
the size of the guest IDAL may be incorrect and should be trimmed down.

Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/r/20260720203400.7328E1F000E9@smtp.kernel.org/
Fixes: 1b676fe3d9d3 ("vfio/ccw: handle a guest Format-1 IDAL")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
drivers/s390/cio/vfio_ccw_cp.c