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]
Message-Id: <200802261225.41724.dhazelton@enter.net>
Date:	Tue, 26 Feb 2008 12:25:41 -0500
From:	Daniel Hazelton <dhazelton@...er.net>
To:	Jiri Kosina <jkosina@...e.cz>
Cc:	Jan Kara <jack@...e.cz>, Andrew Morton <akpm@...ux-foundation.org>,
	Nix <nix@...eri.org.uk>, Peter Osterlund <petero2@...ia.com>,
	linux-kernel@...r.kernel.org, dm-devel@...hat.com,
	Jan Kara <jack@....cz>
Subject: Re: 2.6.24.2: 4KSTACKS + pcdrw + dm + mount -> stack overflow: ide-cd related? dm-related?

On Tuesday 26 February 2008 06:10:34 Jiri Kosina wrote:
> On Mon, 25 Feb 2008, Jan Kara wrote:
> >   Yes, exactly two of them. One is  non-trivial to get rid of - it's
> > used for encoding of filename before we write it,
>
> Why can't we do just
>
>
>
> UDF: Optimize stack usage
>
> Signed-off-by: Jiri Kosina <jkosina@...e.cz>
>
> diff --git a/fs/udf/namei.c b/fs/udf/namei.c
> index 112a5fb..706a2b5 100644
> --- a/fs/udf/namei.c
> +++ b/fs/udf/namei.c
> @@ -336,7 +336,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode
> *dir, {
>  	struct super_block *sb = dir->i_sb;
>  	struct fileIdentDesc *fi = NULL;
> -	char name[UDF_NAME_LEN], fname[UDF_NAME_LEN];
> +	char *name, *fname;
>  	int namelen;
>  	loff_t f_pos;
>  	int flen;
> @@ -352,6 +352,14 @@ static struct fileIdentDesc *udf_add_entry(struct
> inode *dir, struct extent_position epos = {};
>  	struct udf_inode_info *dinfo;
>
> +	name = kmalloc(sizeof(char) * UDF_NAME_LEN, GFP_KERNEL);
> +	fname = kmalloc(sizeof(char) * UDF_NAME_LEN, GFP_KERNEL);
> +
> +	if (!name || !fname) {
> +		*err = -ENOMEM;
> +		return NULL;
> +	}
> +

Wouldn't it be better to check each individually, so you do wind up leaking a 
buffer here if one gets allocated and the other doesn't ?

>  	if (dentry) {
>  		if (!dentry->d_name.len) {
>  			*err = -EINVAL;
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index f3ac4ab..42e3ba8 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -1345,7 +1345,7 @@ static void udf_load_logicalvolint(struct super_block
> *sb, kernel_extent_ad loc) *	July 1, 1997 - Andrew E. Mileski
>   *	Written, tested, and released.
>   */
> -static int udf_process_sequence(struct super_block *sb, long block,
> +static int noinline udf_process_sequence(struct super_block *sb, long
> block, long lastblock, kernel_lb_addr *fileset)
>  {
>  	struct buffer_head *bh = NULL;
> --
> 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/

DRH

-- 
Dialup is like pissing through a pipette. Slow and excruciatingly painful.
--
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