vfio-ccw: Don't assume there are more ccws after a TIC
A message that is not in the archive (sent off-list or not yet received): 20190121185851.49c7dda5@oc2783563651
Cornelia Huck
AppliedQuoted 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.
Signed-off-by Farhan Ali <[email protected]>--- drivers/s390/cio/vfio_ccw_cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/s390/cio/vfio_ccw_cp.c +0
-0
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.