lkml.org 
[lkml]   [2014]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: cred_guard_mutex vs seq_file::lock [was: Re: 3.14.0+/x86: lockdep and mutexes not getting along]
On Thu, Jul 31, 2014 at 01:31:30AM +0300, Kirill A. Shutemov wrote:
...
> >
> > *cringe*
> >
> > I don't like it. That really should be a responsiblity of specific ->show();
> > "I'm going to take that mutex, bugger off if we are in execve()" makes a lot
> > more sense than having e.g. seq_read() care of that. IOW, I would very
> > much prefer the patch you've sent last week.
> >
> > And yes, it might leave lockdep false positives, but that's better dealt with
> > by annotating the sucker ("this guy has a separate lockdep class for its
> > ->lock"). E.g. by splitting proc_single_file_operations in two and having
> > the one used for those files do lockdep_set_class() in its ->open().
>
> I've got annoyed by the lockdep warning. What about the patch below?
>
> From 54d8c463e12f23c09d6a2dbf93a4dc9bcb493c67 Mon Sep 17 00:00:00 2001
> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Date: Thu, 31 Jul 2014 00:59:52 +0300
> Subject: [PATCH] procfs: silence lockdep warning about read vs. exec seq_file
>
> Testcase:
>
> cat /proc/self/maps >/dev/null
> chmod +x /proc/self/net/packet
> exec /proc/self/net/packet
>
> It triggers lockdep warning:
...
>
> It's a false positive: seq files which take cred_guard_mutex are never
> executable. Let's use separate lock class for them.
>
> I don't know why we allow "chmod +x" on some proc files, notably net-related.
> Is it a bug?
>
> Also I suspect eb94cd96e05d fixes non-existing bug, like this one.

Yeah, it should. And the patch looks good to me. Still I think maybe indeed
we need to prevent ability to set executable attribute on proc seq files?


\
 
 \ /
  Last update: 2014-07-31 10:01    [W:0.056 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site