From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751296AbdBXO3b (ORCPT ); Fri, 24 Feb 2017 09:29:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbdBXO3Y (ORCPT ); Fri, 24 Feb 2017 09:29:24 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <1487691808-11289-2-git-send-email-elena.reshetova@intel.com> <1487691808-11289-1-git-send-email-elena.reshetova@intel.com> <12908.1487780160@warthog.procyon.org.uk> <2236FBA76BA1254E88B949DDB74E612B41C4EF59@IRSMSX102.ger.corp.intel.com> <8877.1487784554@warthog.procyon.org.uk> To: Kees Cook Cc: dhowells@redhat.com, "Reshetova, Elena" , "linux-kernel@vger.kernel.org" , "linux-afs@lists.infradead.org" , "peterz@infradead.org" , "gregkh@linuxfoundation.org" , Hans Liljestrand , David Windsor Subject: Re: [PATCH 1/4] fs, afs: convert afs_cell.usage from atomic_t to refcount_t MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32459.1487946105.1@warthog.procyon.org.uk> Date: Fri, 24 Feb 2017 14:21:45 +0000 Message-ID: <32460.1487946105@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Feb 2017 14:21:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kees Cook wrote: > We can't allow the increment from 0 since it violates the intended > use-after-free protections. I would have thought that the protections would've been against the carry flag getting set. > If "0" means "still valid" then this > sounds like it needs a global +1, as Elena suggested in her reply. This makes it sound like refcount_t is then unsuitable for this. Since I want to overhaul the code to use more RCU and eliminate some of the locking, it might be worth waiting on the patches. David