Skip to contentSkip to conversation

vfio-ccw: bugfix

GIT PULL Cornelia Huck 2 participants 3 messages Nov 9, 2017 – Nov 10, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 978fa72e82e375764e6e31e7a721408c5186918f:

s390: remove named saved segment support (2017-11-08 09:47:54 +0100)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.git tags/vfio-ccw-20171109

for you to fetch changes up to 408358b50deaf59b07c82a7bff8c7e7cce031fae:

s390: vfio-ccw: Do not attempt to free no-op, test and tic cda. (2017-11-08 14:39:53 +0100)

----------------------------------------------------------------
A vfio-ccw bugfix: avoid freeing that which should not be freed.

----------------------------------------------------------------

Jason J. Herne (1):
s390: vfio-ccw: Do not attempt to free no-op, test and tic cda.

 drivers/s390/cio/vfio_ccw_cp.c | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
2.13.6
#1 lore raw

[PULL 1/1] s390: vfio-ccw: Do not attempt to free no-op, test and tic cda.

From: "Jason J. Herne" <[email protected]>

Because we do not make use of the cda (channel data address) for test, no-op ccws no address translation takes place. This means cda could contain a guest address which we do not want to attempt to free. Let's check the command type and skip cda free when it is not needed.

For a TIC ccw, ccw->cda points to either a ccw in an existing chain or it points to a whole new allocated chain. In either case the data will be freed when the owning chain is freed.

Message-Id: <[email protected]>

---
 drivers/s390/cio/vfio_ccw_cp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/s390/cio/vfio_ccw_cp.c +2 -0
index d8f98ad9b029..7ebbd8b482f5 100644
@@ -332,6 +332,8 @@ static void ccwchain_cda_free(struct ccwchain *chain, int idx)
 {
 	struct ccw1 *ccw = chain->ch_ccw + idx;
 
+	if (ccw_is_test(ccw) || ccw_is_noop(ccw) || ccw_is_tic(ccw))
+		return;
 	if (!ccw->count)
 		return;
 
Signature · 1 line
2.13.6
#2 lore raw
In reply to Cornelia Huck
Quoted 12 lines · Cornelia Huck

The following changes since commit 978fa72e82e375764e6e31e7a721408c5186918f:

s390: remove named saved segment support (2017-11-08 09:47:54 +0100)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.git tags/vfio-ccw-20171109

for you to fetch changes up to 408358b50deaf59b07c82a7bff8c7e7cce031fae:

s390: vfio-ccw: Do not attempt to free no-op, test and tic cda. (2017-11-08 14:39:53 +0100)

Quoted 7 lines

----------------------------------------------------------------
A vfio-ccw bugfix: avoid freeing that which should not be freed.

----------------------------------------------------------------

Jason J. Herne (1):
s390: vfio-ccw: Do not attempt to free no-op, test and tic cda.

Pulled into features branch. Thanks!