Changes since the last update:

- Use the mounter’s credentials for file-backed mounts to resolve
    Android SELinux permission issues;
 
  - Remove the unused trace event `erofs_destroy_inode`;
 
  - Error out on crafted out-of-file-range encoded extents;
 
  - Remove an incorrect check for encoded extents.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEQ0A6bDUS9Y+83NPFUXZn5Zlu5qoFAmhWwSQRHHhpYW5nQGtl
 cm5lbC5vcmcACgkQUXZn5Zlu5qqPnw/9Hovnn+Mh/7izSwpaay8CP03gkIa+WNWB
 O/EOB7uX4mzk3+Ns87KFXAdcxv4kg/cAMOcARUArgZHbqbAKJ29oquVGEIW2Uvto
 0BieyNd3vc1zDHgk8+1Alg8LjV2epoY1n/cPIjybDluhyeEsFKoum2qIUDoaNxVr
 4qqJNRW0O8Ja0oKCeafPVx+3HMJ8pACaF6Hr01RxTTuOEGc4ZntHe38r9krrEh1K
 +j/dhbUTS08IzSUzC/rI8bTe7m+Fx11Mtp71MVcy0NCb2qOltN3Uq/4yJh+OoAKa
 +cYVWR2YmkTA2sGDAH2hcagEh5GQL29fcm2Wyxv9cdD4Sx7deVlOCuMdwfDA/fMh
 RTFJA64vsC/um8bFMp4ckXjsyVTdv1gmKZQRWIAmlkJLlsaMxd+BFTlUVZWYKaYI
 RBH9+hNtKY9ufPDDwMuBXrsFwh46p/NxZfS49zgcOWoMUqmYqRg85I9tkyLGpNwz
 +xNGyAChSD5YADAhTmceWvVoVq8gDZ+cof1JX3b3SEChhePkQ7mjek4Yw4FGsRnZ
 5JNyUSZPMuq6d/nuHqOXMOMXe3Ag3uilIne2+dpayXe2MOZckDl1ikm8Uva44+9H
 JB934FTjjKsMO1ivrh/OAc3J2xGvGaZ9g3jOEqTsS00OuuCCb/TyYpuMQLs41vlQ
 SF4+fMZmjok=
 =V8Do
 -----END PGP SIGNATURE-----

Merge tag 'erofs-for-6.16-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs

Pull erofs fixes from Gao Xiang:

 - Use the mounter’s credentials for file-backed mounts to resolve
   Android SELinux permission issues

 - Remove the unused trace event `erofs_destroy_inode`

 - Error out on crafted out-of-file-range encoded extents

 - Remove an incorrect check for encoded extents

* tag 'erofs-for-6.16-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: remove a superfluous check for encoded extents
  erofs: refuse crafted out-of-file-range encoded extents
  erofs: remove unused trace event erofs_destroy_inode
  erofs: impersonate the opener's credentials when accessing backing file
This commit is contained in:
Linus Torvalds 2025-06-21 09:15:08 -07:00
commit 1f9378d4a7
3 changed files with 7 additions and 24 deletions

View File

@ -47,6 +47,7 @@ static void erofs_fileio_ki_complete(struct kiocb *iocb, long ret)
static void erofs_fileio_rq_submit(struct erofs_fileio_rq *rq)
{
const struct cred *old_cred;
struct iov_iter iter;
int ret;
@ -60,7 +61,9 @@ static void erofs_fileio_rq_submit(struct erofs_fileio_rq *rq)
rq->iocb.ki_flags = IOCB_DIRECT;
iov_iter_bvec(&iter, ITER_DEST, rq->bvecs, rq->bio.bi_vcnt,
rq->bio.bi_iter.bi_size);
old_cred = override_creds(rq->iocb.ki_filp->f_cred);
ret = vfs_iocb_iter_read(rq->iocb.ki_filp, &rq->iocb, &iter);
revert_creds(old_cred);
if (ret != -EIOCBQUEUED)
erofs_fileio_ki_complete(&rq->iocb, ret);
}

View File

@ -597,6 +597,10 @@ static int z_erofs_map_blocks_ext(struct inode *inode,
if (la > map->m_la) {
r = mid;
if (la > lend) {
DBG_BUGON(1);
return -EFSCORRUPTED;
}
lend = la;
} else {
l = mid + 1;
@ -635,12 +639,6 @@ static int z_erofs_map_blocks_ext(struct inode *inode,
}
}
map->m_llen = lend - map->m_la;
if (!last && map->m_llen < sb->s_blocksize) {
erofs_err(sb, "extent too small %llu @ offset %llu of nid %llu",
map->m_llen, map->m_la, vi->nid);
DBG_BUGON(1);
return -EFSCORRUPTED;
}
return 0;
}

View File

@ -211,24 +211,6 @@ TRACE_EVENT(erofs_map_blocks_exit,
show_mflags(__entry->mflags), __entry->ret)
);
TRACE_EVENT(erofs_destroy_inode,
TP_PROTO(struct inode *inode),
TP_ARGS(inode),
TP_STRUCT__entry(
__field( dev_t, dev )
__field( erofs_nid_t, nid )
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->nid = EROFS_I(inode)->nid;
),
TP_printk("dev = (%d,%d), nid = %llu", show_dev_nid(__entry))
);
#endif /* _TRACE_EROFS_H */
/* This part must be outside protection */