lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Feb 2022 08:33:07 +0530
From:   Ritesh Harjani <riteshh@...ux.ibm.com>
To:     Jan Kara <jack@...e.cz>
Cc:     linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        "Theodore Ts'o" <tytso@....edu>,
        Harshad Shirwadkar <harshadshirwadkar@...il.com>
Subject: Re: [PATCHv1 7/9] ext4: Add ext4_sb_block_valid() refactored out of
 ext4_inode_block_valid()

On 22/02/07 05:42PM, Jan Kara wrote:
> On Sat 05-02-22 19:39:56, Ritesh Harjani wrote:
> > This API will be needed at places where we don't have an inode
> > for e.g. while freeing blocks in ext4_group_add_blocks()
> >
> > Suggested-by: Jan Kara <jack@...e.cz>
> > Signed-off-by: Ritesh Harjani <riteshh@...ux.ibm.com>
>
> ...
>
> > @@ -329,7 +324,8 @@ int ext4_inode_block_valid(struct inode *inode, ext4_fsblk_t start_blk,
> >  		else if (start_blk >= (entry->start_blk + entry->count))
> >  			n = n->rb_right;
> >  		else {
> > -			ret = (entry->ino == inode->i_ino);
> > +			if (inode)
> > +				ret = (entry->ino == inode->i_ino);
> >  			break;
>
> In case inode is not passed, we must not overlap any entry in the rbtree.
> So we should return 0, not 1.
>
Damm! Thanks for catching that. Don't know how did I miss that.
Will make this below change then.
	else {
		ret = 0;
		if (inode)
			ret = (entry->ino == inode->i_ino)
		break;
	}

-riteshh

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ