lkml.org 
[lkml]   [2017]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/9] tools: convert cgroup_sel.refcnt from atomic_t to refcount_t
    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 <linux/atomic.h>
    > +#include <linux/refcount.h>

    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 <acme@redhat.com>
    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

    \
     
     \ /
      Last update: 2017-02-21 16:45    [W:2.809 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site