FreeBSD Bugzilla – Attachment 165127 Details for
Bug 205938
[ext2fs][patch][panic] EXT4: reading mmaped file causes panic because struct buf leaks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix a kernel panic when reading mmaped files from EXT4
0001-Fix-a-kernel-panic-when-reading-mmaped-files-from-EX.patch (text/plain), 1.49 KB, created by
Damjan Jovanovic
on 2016-01-05 23:53:26 UTC
(
hide
)
Description:
Fix a kernel panic when reading mmaped files from EXT4
Filename:
MIME Type:
Creator:
Damjan Jovanovic
Created:
2016-01-05 23:53:26 UTC
Size:
1.49 KB
patch
obsolete
>From 3938f308f4c29fdd3022d57babb8017b89dedb9e Mon Sep 17 00:00:00 2001 >From: Damjan Jovanovic <damjan.jov@gmail.com> >Date: Wed, 6 Jan 2016 01:01:28 +0200 >Subject: =?UTF-8?q?Fix=20a=20kernel=20panic=20when=20reading=20mmaped=20fi?= > =?UTF-8?q?les=20from=20EXT4=20filesystems,=0Acaused=20by=20the=20buffer?= > =?UTF-8?q?=20from=20ext4=5Fext=5Ffind=5Fextent()=20not=20getting=20releas?= > =?UTF-8?q?ed.?= > >--- > sys/fs/ext2fs/ext2_bmap.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > >diff --git a/sys/fs/ext2fs/ext2_bmap.c b/sys/fs/ext2fs/ext2_bmap.c >index d144e92..7d4a880 100644 >--- a/sys/fs/ext2fs/ext2_bmap.c >+++ b/sys/fs/ext2fs/ext2_bmap.c >@@ -96,6 +96,7 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bnp, int *runp, int *runb) > struct ext4_extent *ep; > struct ext4_extent_path path = { .ep_bp = NULL }; > daddr_t lbn; >+ int ret = 0; > > ip = VTOI(vp); > fs = ip->i_e2fs; >@@ -113,15 +114,21 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bnp, int *runp, int *runb) > ext4_ext_find_extent(fs, ip, lbn, &path); > ep = path.ep_ext; > if (ep == NULL) >- return (EIO); >+ ret = EIO; >+ else { >+ *bnp = fsbtodb(fs, lbn - ep->e_blk + >+ (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); > >- *bnp = fsbtodb(fs, lbn - ep->e_blk + >- (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); >+ if (*bnp == 0) >+ *bnp = -1; >+ } > >- if (*bnp == 0) >- *bnp = -1; >+ if (path.ep_bp != NULL) { >+ brelse(path.ep_bp); >+ path.ep_bp = NULL; >+ } > >- return (0); >+ return (ret); > } > > /* >-- >2.6.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 205938
: 165127 |
165231