Commit f8f296e
Claudio Imbrenda
KVM: s390: vsie: Fix race in acquire_gmap_shadow()
The shadow gmap returned by gmap_create_shadow() could get dropped
before taking the gmap->children_lock. This meant that the shadow gmap
was sometimes being used while its reference count was 0.
Fix this by taking the additional reference inside gmap_create_shadow()
while still holding gmap->children_lock, instead of afterwards.
Fixes: e38c884 ("KVM: s390: Switch to new gmap")
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>1 parent b6ab71a commit f8f296e
2 files changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| 1182 | + | |
| 1183 | + | |
1182 | 1184 | | |
1183 | 1185 | | |
1184 | 1186 | | |
| |||
1189 | 1191 | | |
1190 | 1192 | | |
1191 | 1193 | | |
1192 | | - | |
| 1194 | + | |
1193 | 1195 | | |
1194 | | - | |
1195 | | - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
1196 | 1201 | | |
1197 | 1202 | | |
1198 | 1203 | | |
| |||
1206 | 1211 | | |
1207 | 1212 | | |
1208 | 1213 | | |
| 1214 | + | |
1209 | 1215 | | |
1210 | 1216 | | |
1211 | 1217 | | |
| |||
1219 | 1225 | | |
1220 | 1226 | | |
1221 | 1227 | | |
| 1228 | + | |
1222 | 1229 | | |
1223 | 1230 | | |
1224 | 1231 | | |
1225 | 1232 | | |
| 1233 | + | |
1226 | 1234 | | |
1227 | 1235 | | |
1228 | 1236 | | |
1229 | 1237 | | |
1230 | 1238 | | |
1231 | 1239 | | |
| 1240 | + | |
1232 | 1241 | | |
1233 | 1242 | | |
1234 | 1243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
| 1259 | + | |
1259 | 1260 | | |
1260 | 1261 | | |
1261 | 1262 | | |
1262 | 1263 | | |
1263 | 1264 | | |
1264 | 1265 | | |
1265 | 1266 | | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1266 | 1271 | | |
1267 | 1272 | | |
1268 | 1273 | | |
1269 | 1274 | | |
1270 | | - | |
1271 | 1275 | | |
1272 | 1276 | | |
1273 | 1277 | | |
| |||
0 commit comments