Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752228AbdGGKY2 convert rfc822-to-8bit (ORCPT ); Fri, 7 Jul 2017 06:24:28 -0400 Received: from mga07.intel.com ([134.134.136.100]:49928 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbdGGKY0 (ORCPT ); Fri, 7 Jul 2017 06:24:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,322,1496127600"; d="scan'208";a="105794838" From: "Reshetova, Elena" To: Peter Zijlstra CC: "linux-kernel@vger.kernel.org" , "cgroups@vger.kernel.org" , "linux-audit@redhat.com" , "linux-fsdevel@vger.kernel.org" , "gregkh@linuxfoundation.org" , "viro@zeniv.linux.org.uk" , "tj@kernel.org" , "mingo@redhat.com" , "hannes@cmpxchg.org" , "lizefan@huawei.com" , "acme@kernel.org" , "alexander.shishkin@linux.intel.com" , "eparis@redhat.com" , "akpm@linux-foundation.org" , "arnd@arndb.de" , "luto@kernel.org" , "keescook@chromium.org" , Hans Liljestrand , David Windsor , Thomas Gleixner Subject: RE: [PATCH 14/15] kernel: convert futex_pi_state.refcount from atomic_t to refcount_t Thread-Topic: [PATCH 14/15] kernel: convert futex_pi_state.refcount from atomic_t to refcount_t Thread-Index: AQHS9wCo5QY4hvTBzE2JOYLHihWHc6JIB1aAgAAf4mA= Date: Fri, 7 Jul 2017 10:24:20 +0000 Message-ID: <2236FBA76BA1254E88B949DDB74E612B6FF21DBE@IRSMSX102.ger.corp.intel.com> References: <1499418269-3686-1-git-send-email-elena.reshetova@intel.com> <1499418269-3686-15-git-send-email-elena.reshetova@intel.com> <20170707092603.rmt4ne4c75k5qg56@hirez.programming.kicks-ass.net> In-Reply-To: <20170707092603.rmt4ne4c75k5qg56@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1818 Lines: 47 > On Fri, Jul 07, 2017 at 12:04:28PM +0300, Elena Reshetova wrote: > > 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. > > > > Signed-off-by: Elena Reshetova > > Signed-off-by: Hans Liljestrand > > Signed-off-by: Kees Cook > > Signed-off-by: David Windsor > > I'll let tglx comment on the SoB chain, I know he likes those :-) You > did Cc him right, seeing how he's the maintainer of this stuff.. > > *sigh* you didn't :-( After so many patches send you _really_ should > know to Cc the right people. It is not so trivial as you might think. Unless right person shows up as maintainer/supporter when I run get_maintainer script, it is hard to figure out who is the right CC person. And the amount of sending patches doesn't help, because if a person reacts on patches and asks to change/fix stuff, it doesn't mean he is the right person, he might be just reading mailing list and having time to do reviews :( That's said, I will try to improve the CC list. > > > --- > > kernel/futex.c | 13 +++++++------ > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > @@ -814,7 +815,7 @@ static struct futex_pi_state *alloc_pi_state(void) > > > > static void get_pi_state(struct futex_pi_state *pi_state) > > { > > - WARN_ON_ONCE(!atomic_inc_not_zero(&pi_state->refcount)); > > + WARN_ON_ONCE(!refcount_inc_not_zero(&pi_state->refcount)); > > } > > I think we have refcount_inc() for just that case, no? > Yes, this slipped through. Will fix so it would look shorted. Thank you for catching it! Best Regards, Elena.