Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933071AbdGSWfs (ORCPT ); Wed, 19 Jul 2017 18:35:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36984 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932149AbdGSWfr (ORCPT ); Wed, 19 Jul 2017 18:35:47 -0400 Date: Wed, 19 Jul 2017 15:35:46 -0700 From: Andrew Morton To: ebiederm@xmission.com (Eric W. Biederman) Cc: Elena Reshetova , linux-kernel@vger.kernel.org, peterz@infradead.org, gregkh@linuxfoundation.org, mingo@redhat.com, adobriyan@gmail.com, serge@hallyn.com, arozansk@redhat.com, dave@stgolabs.net, keescook@chromium.org, Hans Liljestrand , David Windsor Subject: Re: [PATCH 1/3] ipc: convert ipc_namespace.count from atomic_t to refcount_t Message-Id: <20170719153546.37567fbf77861653172fa263@linux-foundation.org> In-Reply-To: <87bmottgo4.fsf@xmission.com> References: <1499417992-3238-1-git-send-email-elena.reshetova@intel.com> <1499417992-3238-2-git-send-email-elena.reshetova@intel.com> <87bmottgo4.fsf@xmission.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 693 Lines: 16 On Sun, 09 Jul 2017 16:59:55 -0500 ebiederm@xmission.com (Eric W. Biederman) wrote: > Elena Reshetova writes: > > > refcount_t type and corresponding API should be > > used instead of atomic_t when the variable is used as > > a reference counter. This allows to avoid accidental > > refcounter overflows that might lead to use-after-free > > situations. > > In this patch you can see all of the uses of the count. > What accidental refcount overflows are possible? I do rather dislike these conversions from the point of view of performance overhead and general code bloat. But I seem to have lost that struggle and I don't think any of these are fastpath(?).