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] [day] [month] [year] [list]
Date:	Wed, 5 May 2010 09:18:56 -0700
From:	Greg KH <greg@...ah.com>
To:	wzt.wzt@...il.com
Cc:	linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
	gregkh@...e.de
Subject: Re: [PATCH] Staging: Check kmalloc return value before use the
 buffer in ieee80211_softmac.c

On Wed, May 05, 2010 at 02:56:52PM +0800, wzt.wzt@...il.com wrote:
> Check kmalloc return value before use the buffer.
> 
> Signed-off-by: Zhitong Wang <zhitong.wangzt@...baba-inc.com>
> 
> ---
>  .../staging/rtl8192u/ieee80211/ieee80211_softmac.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> index 27d9257..8718ac9 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> @@ -1579,6 +1579,8 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen)
>  		if(*(t++) == MFIE_TYPE_CHALLENGE){
>  			*chlen = *(t++);
>  			*challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC);
> +			if (!*challenge)
> +				return -ENOMEM;

Great catch!

thanks for the patch, now queued up.

greg k-h
--
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