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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 12 Feb 2008 11:34:09 -0500
From:	Paul Moore <paul.moore@...com>
To:	Pavel Emelyanov <xemul@...nvz.org>
Cc:	David Miller <davem@...emloft.net>,
	Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH][NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def.

On Tuesday 12 February 2008 11:27:16 am Pavel Emelyanov wrote:
> Currently, if the call to netlbl_domhsh_search succeeds the
> return result will still be NULL.
>
> Fix that, by returning the found entry (if any).
>
> Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>

Good catch, thanks.

Acked-by: Paul Moore <paul.moore@...com>

> ---
>
> diff --git a/net/netlabel/netlabel_domainhash.c
> b/net/netlabel/netlabel_domainhash.c index 9a8ea01..fd46231 100644
> --- a/net/netlabel/netlabel_domainhash.c
> +++ b/net/netlabel/netlabel_domainhash.c
> @@ -150,11 +150,11 @@ static struct netlbl_dom_map
> *netlbl_domhsh_search_def(const char *domain) entry =
> netlbl_domhsh_search(domain);
>  	if (entry == NULL) {
>  		entry = rcu_dereference(netlbl_domhsh_def);
> -		if (entry != NULL && entry->valid)
> -			return entry;
> +		if (entry != NULL && !entry->valid)
> +			entry = NULL;
>  	}
>
> -	return NULL;
> +	return entry;
>  }
>
>  /*

-- 
paul moore
linux security @ hp
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists