[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52a063a3-ca63-4dd9-8914-62ef0a7ed794@oracle.com>
Date: Wed, 26 Jun 2024 12:40:44 -0500
From: Dave Kleikamp <dave.kleikamp@...cle.com>
To: Jeongjun Park <aha310510@...il.com>, shaggy@...nel.org
Cc: jfs-discussion@...ts.sourceforge.net, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
syzbot+241c815bda521982cb49@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com, willy@...radead.org
Subject: Re: [PATCH] jfs: Fix array-index-out-of-bounds in diFree
On 5/30/24 8:28AM, Jeongjun Park wrote:
>>
>> Matthew Wilcox wrote:
>>> This is not a good commit message.
>>
>>>> + if(agno >= MAXAG || agno < 0)
>>>
>>> Please follow normal kernel whitespace rules -- one space between 'if'
>>> and the open paren.
>>
>> Has confirmed. This is a patch that re-edited the relevant part to
>> comply with the rules.
>>
>> Thanks.
>>
>
> I have just discovered that the patch I sent last time has been left
> unattended. It appears that the vulnerability continues to occur in
> version 6.10.0-rc1. I would appreciate it if you could review the patch
> and let me know what might be wrong with it.
Sorry this has taken me so long.
Applied.
>
> Regards
>
> Reported-by: syzbot+241c815bda521982cb49@...kaller.appspotmail.com
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Jeongjun Park <aha310510@...il.com>
> ---
> fs/jfs/jfs_imap.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
> index 2ec35889ad24..1407feccbc2d 100644
> --- a/fs/jfs/jfs_imap.c
> +++ b/fs/jfs/jfs_imap.c
> @@ -290,7 +290,7 @@ int diSync(struct inode *ipimap)
> int diRead(struct inode *ip)
> {
> struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
> - int iagno, ino, extno, rc;
> + int iagno, ino, extno, rc, agno;
> struct inode *ipimap;
> struct dinode *dp;
> struct iag *iagp;
> @@ -339,8 +339,11 @@ int diRead(struct inode *ip)
>
> /* get the ag for the iag */
> agstart = le64_to_cpu(iagp->agstart);
> + agno = BLKTOAG(agstart, JFS_SBI(ip->i_sb));
>
> release_metapage(mp);
> + if (agno >= MAXAG || agno < 0)
> + return -EIO;
>
> rel_inode = (ino & (INOSPERPAGE - 1));
> pageno = blkno >> sbi->l2nbperpage;
Powered by blists - more mailing lists