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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 1 Apr 2015 12:55:46 +0200
From:	Jan Kara <jack@...e.cz>
To:	Changwoo Min <changwoo.m@...il.com>
Cc:	jack@...e.cz, linux-kernel@...r.kernel.org, taesoo@...ech.edu,
	changwoo@...ech.edu, sanidhya@...ech.edu, blee@...ech.edu,
	csong84@...ech.edu
Subject: Re: [PATCH] udf: NULL dereference at udf_symlink() on error

On Mon 23-03-15 02:11:49, Changwoo Min wrote:
> There is no check for udf_tgetblk(), which could return NULL, in udf_symlink(). 
> So there is a possibility of returning NULL under heavy memory pressure and 
> possibility of NULL dereference. 
> 
> Signed-off-by: Changwoo Min <changwoo.m@...il.com>
> ---
>  fs/udf/namei.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/udf/namei.c b/fs/udf/namei.c
> index 33b246b..ed2f221 100644
> --- a/fs/udf/namei.c
> +++ b/fs/udf/namei.c
> @@ -902,6 +902,10 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
>  				iinfo->i_location.partitionReferenceNum,
>  				0);
>  		epos.bh = udf_tgetblk(sb, block);
> +		if (!epos.bh) {
> +			err = -ENOMEM;
  This should be -EIO as per our discussion at the previous patch.
Otherwise I agree.

								Honza

> +			goto out_no_entry;
> +		}
>  		lock_buffer(epos.bh);
>  		memset(epos.bh->b_data, 0x00, bsize);
>  		set_buffer_uptodate(epos.bh);
> -- 
> 1.9.1
> 
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ