From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695AbdBUPoX (ORCPT ); Tue, 21 Feb 2017 10:44:23 -0500 Received: from mail.kernel.org ([198.145.29.136]:41192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbdBUPoC (ORCPT ); Tue, 21 Feb 2017 10:44:02 -0500 Date: Tue, 21 Feb 2017 12:43:56 -0300 From: Arnaldo Carvalho de Melo To: Elena Reshetova Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, peterz@infradead.org, gregkh@linuxfoundation.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, mark.rutland@arm.com, akpm@linux-foundation.org, matija.glavinic-pecotic.ext@nokia.com, Hans Liljestrand , Kees Cook , David Windsor Subject: Re: [PATCH 1/9] tools: convert cgroup_sel.refcnt from atomic_t to refcount_t Message-ID: <20170221154356.GF5052@kernel.org> References: <1487691303-31858-1-git-send-email-elena.reshetova@intel.com> <1487691303-31858-2-git-send-email-elena.reshetova@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487691303-31858-2-git-send-email-elena.reshetova@intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Feb 21, 2017 at 05:34:55PM +0200, Elena Reshetova escreveu: > 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. > #define __CGROUP_H__ > > -#include > +#include So this is the first one, I was expecting the copy from include/linux/refcount.h to be made to tools/include/linux/refcount.h, as was done for tools/include/linux/atomic.h and all the other stuff in tools/include/ See: commit c4b6014e8bb0c8d47fe5c71ebc604f31091e5d3f Author: Arnaldo Carvalho de Melo Date: Mon Jul 11 10:28:48 2016 -0300 tools: Add copy of perf_event.h to tools/include/linux/ -------------- For one of the reasons we've been doing this. - Arnaldo > struct option; > > struct cgroup_sel { > char *name; > int fd; > - atomic_t refcnt; > + refcount_t refcnt; > }; > > > -- > 2.7.4