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: <20080429152607.GA40409@dspnet.fr.eu.org>
Date:	Tue, 29 Apr 2008 17:26:07 +0200
From:	Olivier Galibert <galibert@...ox.com>
To:	linux-kernel@...r.kernel.org
Cc:	alan@...hat.com
Subject: Re: [PATCH] isicom: Fix buffer allocation

On Tue, Apr 29, 2008 at 02:17:33PM +0100, Alan Cox wrote:
> Fix the rather strange buffer management on open that turned up while
> auditing for BKL dependancies
> 
> Signed-off-by: Alan Cox <alan@...hat.com>
> 
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-mm1/drivers/char/isicom.c linux-2.6.25-mm1/drivers/char/isicom.c
> --- linux.vanilla-2.6.25-mm1/drivers/char/isicom.c	2008-04-28 11:36:48.000000000 +0100
> +++ linux-2.6.25-mm1/drivers/char/isicom.c	2008-04-14 10:56:25.000000000 +0100
> @@ -813,15 +813,13 @@
>  		return 0;
>  	if (!port->xmit_buf) {
>  		/* Relies on BKL */
> +		unsigned long page  = get_zeroed_page(GFP_KERNEL);
> +		if (page == 0)
>  			return -ENOMEM;
> +		if (port->xmit_buf)
> +			free_page(page);
> +		else
> +			port->xmit_buf = (unsigned char *) page;
>  	}


Still looks rather strange.  An if(x) inside an if(!x) ?

  OG.
--
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