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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 1 Mar 2009 20:54:50 +0100
From:	Karsten Keil <kkeil@...e.de>
To:	Frank Seidel <fseidel@...e.de>
Cc:	linux kernel <linux-kernel@...r.kernel.org>,
	akpm@...ux-foundation.org, kkeil@...e.de,
	linux-isdn@...r.kernel.org, Frank Seidel <frank@...eidel.de>,
	Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>,
	Andreas Eversberg <andreas@...rsberg.eu>,
	Hannes Eder <hannes@...neseder.net>,
	Adrian Bunk <bunk@...nel.org>
Subject: Re: [PATCHv2] isdn: reduce stack size of mISDN_dsp

On Sun, Mar 01, 2009 at 06:10:24PM +0100, Frank Seidel wrote:
> From: Frank Seidel <frank@...eidel.de>
> 
> Reduce stack size memory footprint of mISDN_dsp.
> (From 1468 bytes for dsp_cmx_send on i386 down
> to 44).

Looks safer and has the same function as before, but
I think we should work on a better solution later, which
use one buffer per instance and allocate it on creation time.
Andreas, what do you think ?

> 
> Signed-off-by: Frank Seidel <frank@...eidel.de>
> ---
>  drivers/isdn/mISDN/dsp_cmx.c |   12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> --- a/drivers/isdn/mISDN/dsp_cmx.c
> +++ b/drivers/isdn/mISDN/dsp_cmx.c
> @@ -1592,13 +1592,21 @@ dsp_cmx_send(void *arg)
>  	struct dsp_conf_member *member;
>  	struct dsp *dsp;
>  	int mustmix, members;
> -	s32 mixbuffer[MAX_POLL+100], *c;
> +	s32 *mixbuffer;
> +	s32 *c;
>  	u8 *p, *q;
>  	int r, rr;
>  	int jittercheck = 0, delay, i;
>  	u_long flags;
>  	u16 length, count;
>  
> +	mixbuffer = kmalloc(sizeof(*mixbuffer) * (MAX_POLL + 100), GFP_KERNEL);
> +	if (!mixbuffer) {
> +		printk(KERN_ERR "mISDN_dsp: cannot allocate buffer(%s)\n",
> +		       __func__);
> +		return;
> +	}
> +
>  	/* lock */
>  	spin_lock_irqsave(&dsp_lock, flags);
>  
> @@ -1811,6 +1819,8 @@ dsp_cmx_send(void *arg)
>  
>  	/* unlock */
>  	spin_unlock_irqrestore(&dsp_lock, flags);
> +
> +	kfree(mixbuffer);
>  }
>  
>  /*

-- 
Karsten Keil
--
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