Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+7 -24
+3
fs/erofs/fileio.c
··· 47 47 48 48 static void erofs_fileio_rq_submit(struct erofs_fileio_rq *rq) 49 49 { 50 + const struct cred *old_cred; 50 51 struct iov_iter iter; 51 52 int ret; 52 53 ··· 61 60 rq->iocb.ki_flags = IOCB_DIRECT; 62 61 iov_iter_bvec(&iter, ITER_DEST, rq->bvecs, rq->bio.bi_vcnt, 63 62 rq->bio.bi_iter.bi_size); 63 + old_cred = override_creds(rq->iocb.ki_filp->f_cred); 64 64 ret = vfs_iocb_iter_read(rq->iocb.ki_filp, &rq->iocb, &iter); 65 + revert_creds(old_cred); 65 66 if (ret != -EIOCBQUEUED) 66 67 erofs_fileio_ki_complete(&rq->iocb, ret); 67 68 }
+4 -6
fs/erofs/zmap.c
··· 597 597 598 598 if (la > map->m_la) { 599 599 r = mid; 600 + if (la > lend) { 601 + DBG_BUGON(1); 602 + return -EFSCORRUPTED; 603 + } 600 604 lend = la; 601 605 } else { 602 606 l = mid + 1; ··· 639 635 } 640 636 } 641 637 map->m_llen = lend - map->m_la; 642 - if (!last && map->m_llen < sb->s_blocksize) { 643 - erofs_err(sb, "extent too small %llu @ offset %llu of nid %llu", 644 - map->m_llen, map->m_la, vi->nid); 645 - DBG_BUGON(1); 646 - return -EFSCORRUPTED; 647 - } 648 638 return 0; 649 639 } 650 640
-18
include/trace/events/erofs.h
··· 211 211 show_mflags(__entry->mflags), __entry->ret) 212 212 ); 213 213 214 - TRACE_EVENT(erofs_destroy_inode, 215 - TP_PROTO(struct inode *inode), 216 - 217 - TP_ARGS(inode), 218 - 219 - TP_STRUCT__entry( 220 - __field( dev_t, dev ) 221 - __field( erofs_nid_t, nid ) 222 - ), 223 - 224 - TP_fast_assign( 225 - __entry->dev = inode->i_sb->s_dev; 226 - __entry->nid = EROFS_I(inode)->nid; 227 - ), 228 - 229 - TP_printk("dev = (%d,%d), nid = %llu", show_dev_nid(__entry)) 230 - ); 231 - 232 214 #endif /* _TRACE_EROFS_H */ 233 215 234 216 /* This part must be outside protection */