From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin LaHaise Subject: Re: [PATCH 22/25] Generic dynamic per cpu refcounting Date: Thu, 29 Nov 2012 14:34:52 -0500 Message-ID: <20121129193452.GI19042@kvack.org> References: <1354121029-1376-1-git-send-email-koverstreet@google.com> <1354121029-1376-23-git-send-email-koverstreet@google.com> <20121129185720.GE15094@google.com> <20121129185953.GW16230@one.firstfloor.org> <20121129191214.GG15094@google.com> <20121129192003.GX16230@one.firstfloor.org> <20121129192925.GH15094@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andi Kleen , linux-kernel@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, zab@redhat.com, jmoyer@redhat.com, axboe@kernel.dk, viro@zeniv.linux.org.uk To: Kent Overstreet Return-path: Content-Disposition: inline In-Reply-To: <20121129192925.GH15094@google.com> Sender: owner-linux-aio@kvack.org List-Id: linux-fsdevel.vger.kernel.org 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). -ben -- "Thought is the essence of where you are now." -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to majordomo@kvack.org. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: aart@kvack.org