Re: debugfs file creation from a user process ioctl

From: Greg Kroah-Hartman
Date: Thu Sep 27 2012 - 11:18:36 EST


On Thu, Sep 27, 2012 at 02:17:05PM +1000, Dave Airlie wrote:
> Hi guys,
>
> we've been seeing an error with nouveau and I'm not sure if its new or
> we just never spent time looking into it.
>
> The basics are when a new drm client opens the device it gets a
> channel assigned, we allocate the channel and a side effect of channel
> allocation is we get a file in debugfs with some info on the channel.
> However this fails as the process context we are in is non-root, and
> the directory is 755.

But the kernel is the thing that is creating the file, so shouldn't it
be created no matter the permission setting? I guess I never thought of
something other than the "root" process ever creating debugfs files,
odd.

> I don't think I want to be modifiying fsuid, but is there another
> practical way to do this, its not majorly urgent, Ben has indicated
> he's probably ripping the channel debugfs code out but I was just
> wondering for future reference.

I don't think anything other than modifying fsuid would work here,
sorry. Put it in the "create the debugfs file" function and you should
be fine.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/