Skip to contentSkip to conversation

vfio-ccw: Don't assume there are more ccws after a TIC

RFC Cornelia Huck 1 participant 1 message Jan 22, 2019 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20190121185851.49c7dda5@oc2783563651

Cornelia Huck

author Applied
#1 lore raw
Quoted 14 lines · On Mon, 21 Jan 2019 09:54:08 -0500 Farhan Ali <[email protected]> wrote:

When trying to calculate the length of a ccw chain, we assume there are ccws after a TIC. This can lead to overcounting and copying garbage data from guest memory.

---
 drivers/s390/cio/vfio_ccw_cp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/cio/vfio_ccw_cp.c +0 -0
index 17a1ee3..a820a21 100644

drivers/s390/cio/vfio_ccw_cp.c static int ccwchain_calc_length(u64 iova, struct channel_program *cp) · line 398

Quoted 8 lines
drivers/s390/cio/vfio_ccw_cp.c +1 -1
@@ -392,7 +392,7 @@ static int ccwchain_calc_length(u64 iova, struct channel_program *cp)
 			return -EOPNOTSUPP;
 		}
 
-		if ((!ccw_is_chain(ccw)) && (!ccw_is_tic(ccw)))
+		if (!ccw_is_chain(ccw))
 			break;
 
 		ccw++;

Thanks, applied.