mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] isofs: release buffer head before return
@ 2021-01-18 12:04 Pan Bian
  2021-01-18 14:41 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Pan Bian @ 2021-01-18 12:04 UTC (permalink / raw)
  To: Jan Kara, Andrew Morton; +Cc: linux-kernel, Pan Bian

Release the buffer header before returning error code.

Fixes: 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem")
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 fs/isofs/dir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index f0fe641893a5..b9e6a7ec78be 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -152,6 +152,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file,
 			printk(KERN_NOTICE "iso9660: Corrupted directory entry"
 			       " in block %lu of inode %lu\n", block,
 			       inode->i_ino);
+			brelse(bh);
 			return -EIO;
 		}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] isofs: release buffer head before return
  2021-01-18 12:04 [PATCH] isofs: release buffer head before return Pan Bian
@ 2021-01-18 14:41 ` Jan Kara
  2021-01-25 16:58   ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2021-01-18 14:41 UTC (permalink / raw)
  To: Pan Bian; +Cc: Jan Kara, Andrew Morton, linux-kernel

On Mon 18-01-21 04:04:55, Pan Bian wrote:
> Release the buffer header before returning error code.
> 
> Fixes: 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem")
> Signed-off-by: Pan Bian <bianpan2016@163.com>

OK, good spotting. But the other hunk in commit 2deb1acc653c seems to have
the same problem so we might fix it as well when we are at it?

								Honza

> ---
>  fs/isofs/dir.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
> index f0fe641893a5..b9e6a7ec78be 100644
> --- a/fs/isofs/dir.c
> +++ b/fs/isofs/dir.c
> @@ -152,6 +152,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file,
>  			printk(KERN_NOTICE "iso9660: Corrupted directory entry"
>  			       " in block %lu of inode %lu\n", block,
>  			       inode->i_ino);
> +			brelse(bh);
>  			return -EIO;
>  		}
>  
> -- 
> 2.17.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] isofs: release buffer head before return
  2021-01-18 14:41 ` Jan Kara
@ 2021-01-25 16:58   ` Jan Kara
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2021-01-25 16:58 UTC (permalink / raw)
  To: Pan Bian; +Cc: Jan Kara, Andrew Morton, linux-kernel

On Mon 18-01-21 15:41:23, Jan Kara wrote:
> On Mon 18-01-21 04:04:55, Pan Bian wrote:
> > Release the buffer header before returning error code.
> > 
> > Fixes: 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem")
> > Signed-off-by: Pan Bian <bianpan2016@163.com>
> 
> OK, good spotting. But the other hunk in commit 2deb1acc653c seems to have
> the same problem so we might fix it as well when we are at it?

OK, I did this myself and picked the patch to my tree.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-25 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 12:04 [PATCH] isofs: release buffer head before return Pan Bian
2021-01-18 14:41 ` Jan Kara
2021-01-25 16:58   ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®