lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints
On Tue, 1 Dec 2020 16:28:47 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Tue, 1 Dec 2020 12:32:49 -0800
> Axel Rasmussen <axelrasmussen@google.com> wrote:
>
> > +/* Called with reg_lock held. */
>
> The above comment is reduntant, as the lockdep_is_held() below also suggest
> that it is ;-)
>


>
> > static inline char *get_memcg_path_buf(void)
> > {
> > + char *buf;
> > int idx;
> >
> > + rcu_read_lock();
>
> The caller of get_mm_memcg_path() has preemption disabled, which is also
> now an RCU lock. So the rcu_read_lock() is somewhat redundant.


BTW, both of these comments are FYI. You can keep the comment and keep the
rcu_read_lock(). I was just stating that they are redundant, but keeping
them may make the code a bit more robust.

-- Steve

\
 
 \ /
  Last update: 2020-12-01 22:33    [W:0.074 / U:2.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site