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: <m2fw3sf8eu.fsf@firstfloor.org>
Date:	Thu, 29 Nov 2012 12:42:17 -0800
From:	Andi Kleen <andi@...stfloor.org>
To:	Kent Overstreet <koverstreet@...gle.com>
Cc:	Benjamin LaHaise <bcrl@...ck.org>, linux-kernel@...r.kernel.org,
	linux-aio@...ck.org, linux-fsdevel@...r.kernel.org, zab@...hat.com,
	jmoyer@...hat.com, axboe@...nel.dk, viro@...iv.linux.org.uk
Subject: Re: [PATCH 22/25] Generic dynamic per cpu refcounting

Kent Overstreet <koverstreet@...gle.com> writes:

> On Thu, Nov 29, 2012 at 02:34:52PM -0500, Benjamin LaHaise wrote:
>> On Thu, Nov 29, 2012 at 11:29:25AM -0800, Kent Overstreet wrote:
>> > There's some kind of symmetry going on here, and if I'd been awake more
>> > in college I could probably say exactly why it works, but it does.
>> 
>> I think the catch is that using only a 32 bit counter is something the 
>> user could arbitrarily control the sum of all parts.  I think a 64 bit 
>> counter may be required to ensure no overflow occurs.  Otherwise, an 
>> overflow could result in a premature free when there are still 2^32 
>> objects active thanks to a malicious user (possible on systems with lots 
>> of memory these days -- remote, but possible).
>
> That's no different from regular atomic_t - but you're right, we
> should be using size_t for anything userspace can manipulate.

The regular atomic_t is limited in ways that you are not.
See my original mail.

-Andi

-- 
ak@...ux.intel.com -- Speaking for myself only
--
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