Commit 08e136e
loop: don't change loop device under exclusive opener in loop_set_status
loop_set_status() is allowed to change the loop device while there
are other openers of the device, even exclusive ones.
In this case, it causes a KASAN: slab-out-of-bounds Read in
ext4_search_dir(), since when looking for an entry in an inlined
directory, e_value_offs is changed underneath the filesystem by
loop_set_status().
Fix the problem by forbidding loop_set_status() from modifying the loop
device while there are exclusive openers of the device. This is similar
to the fix in loop_configure() by commit 33ec3e5 ("loop: Don't
change loop device under exclusive opener") alongside commit ecbe6bc
("block: use bd_prepare_to_claim directly in the loop driver").
Reported-by: syzbot+3ee481e21fd75e14c397@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3ee481e21fd75e14c397
Tested-by: syzbot+3ee481e21fd75e14c397@syzkaller.appspotmail.com
Tested-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Signed-off-by: Raphael Pinsonneault-Thibeault <rpthibeault@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 69153e8 commit 08e136e
1 file changed
Lines changed: 30 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | | - | |
| 1228 | + | |
| 1229 | + | |
1229 | 1230 | | |
1230 | 1231 | | |
1231 | 1232 | | |
1232 | 1233 | | |
1233 | 1234 | | |
1234 | 1235 | | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
1235 | 1246 | | |
1236 | 1247 | | |
1237 | 1248 | | |
| |||
1273 | 1284 | | |
1274 | 1285 | | |
1275 | 1286 | | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
1276 | 1290 | | |
1277 | 1291 | | |
1278 | 1292 | | |
| |||
1352 | 1366 | | |
1353 | 1367 | | |
1354 | 1368 | | |
1355 | | - | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1356 | 1372 | | |
1357 | 1373 | | |
1358 | 1374 | | |
1359 | 1375 | | |
1360 | 1376 | | |
1361 | 1377 | | |
1362 | 1378 | | |
1363 | | - | |
| 1379 | + | |
1364 | 1380 | | |
1365 | 1381 | | |
1366 | 1382 | | |
1367 | | - | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
1368 | 1386 | | |
1369 | 1387 | | |
1370 | 1388 | | |
1371 | 1389 | | |
1372 | 1390 | | |
1373 | | - | |
| 1391 | + | |
1374 | 1392 | | |
1375 | 1393 | | |
1376 | 1394 | | |
| |||
1549 | 1567 | | |
1550 | 1568 | | |
1551 | 1569 | | |
1552 | | - | |
| 1570 | + | |
1553 | 1571 | | |
1554 | 1572 | | |
1555 | 1573 | | |
1556 | 1574 | | |
1557 | 1575 | | |
1558 | 1576 | | |
1559 | | - | |
| 1577 | + | |
1560 | 1578 | | |
1561 | 1579 | | |
1562 | 1580 | | |
| |||
1650 | 1668 | | |
1651 | 1669 | | |
1652 | 1670 | | |
1653 | | - | |
1654 | | - | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
1655 | 1674 | | |
1656 | 1675 | | |
1657 | 1676 | | |
1658 | 1677 | | |
1659 | 1678 | | |
1660 | 1679 | | |
1661 | 1680 | | |
1662 | | - | |
| 1681 | + | |
1663 | 1682 | | |
1664 | 1683 | | |
1665 | 1684 | | |
| |||
1685 | 1704 | | |
1686 | 1705 | | |
1687 | 1706 | | |
1688 | | - | |
| 1707 | + | |
1689 | 1708 | | |
1690 | 1709 | | |
1691 | 1710 | | |
| |||
0 commit comments