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:	Tue, 25 Jan 2011 14:35:40 +0000
From:	David Howells <dhowells@...hat.com>
To:	Davidlohr Bueso <dave@....org>
Cc:	dhowells@...hat.com, LKML <linux-kernel@...r.kernel.org>,
	keyrings@...ux-nfs.org
Subject: Re: [PATCH] security: keyring: remove redundant NULL check

Davidlohr Bueso <dave@....org> wrote:

> -	if (prealloc) {
> -		kfree(prealloc);
> -		key_payload_reserve(keyring,
> -				    keyring->datalen - KEYQUOTA_LINK_BYTES);
> -	}
> +	kfree(prealloc);
> +	key_payload_reserve(keyring,
> +			keyring->datalen - KEYQUOTA_LINK_BYTES);
> +

This is not correct, since you'd be removing the quota allocation for the new
link in the case that __key_link() was called (and cleared *_prealloc).

However, the upstream code isn't correct either, since the preallocation may
not have extended the reservation at all (if it decided to displace a key
rather than adding a key).

David
--
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