linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* REGRESSION?: debugfs: inode: debugfs_create_dir uses mode permission from parent
@ 2018-06-12 22:40 John Stultz
  2018-06-12 22:52 ` Kees Cook
  2018-06-13  4:58 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: John Stultz @ 2018-06-12 22:40 UTC (permalink / raw)
  To: Thomas Richter; +Cc: Kees Cook, Greg Kroah-Hartman, lkml

Hey all,
  I noticed recently that linus/master (plus patches) stopped booting
to UI on HiKey960, and I bisected the issue down to:
92170b62f1c1 ("debugfs: inode: debugfs_create_dir uses mode permission
from parent")

On the HiKey960 board, we mount debugfs via:
   mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755

But since the change, it seems most of the nodes in /sys/kernel/debug
are: drwx------

Which ends up breaking the egl library, keeping it from loading.

This seems to be the expected behavior of the patch, but I'm surprised
the mode override is now ignored. It seems like the potential fix here
would be to set the /sys/kernel/debug dir to 755 prior to mounting? Or
is there some other advised solution?

thanks
-john

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: REGRESSION?: debugfs: inode: debugfs_create_dir uses mode permission from parent
  2018-06-12 22:40 REGRESSION?: debugfs: inode: debugfs_create_dir uses mode permission from parent John Stultz
@ 2018-06-12 22:52 ` Kees Cook
  2018-06-12 22:53   ` John Stultz
  2018-06-13  4:58 ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Kees Cook @ 2018-06-12 22:52 UTC (permalink / raw)
  To: John Stultz, Laura Abbott; +Cc: Thomas Richter, Greg Kroah-Hartman, lkml

On Tue, Jun 12, 2018 at 3:40 PM, John Stultz <john.stultz@linaro.org> wrote:
> Hey all,
>   I noticed recently that linus/master (plus patches) stopped booting
> to UI on HiKey960, and I bisected the issue down to:
> 92170b62f1c1 ("debugfs: inode: debugfs_create_dir uses mode permission
> from parent")
>
> On the HiKey960 board, we mount debugfs via:
>    mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
>
> But since the change, it seems most of the nodes in /sys/kernel/debug
> are: drwx------
>
> Which ends up breaking the egl library, keeping it from loading.
>
> This seems to be the expected behavior of the patch, but I'm surprised
> the mode override is now ignored. It seems like the potential fix here
> would be to set the /sys/kernel/debug dir to 755 prior to mounting? Or
> is there some other advised solution?

This change has already be reverted from other people reporting the
problem. Perhaps the root cause is the lack of propagation of the
mode= value?

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: REGRESSION?: debugfs: inode: debugfs_create_dir uses mode permission from parent
  2018-06-12 22:52 ` Kees Cook
@ 2018-06-12 22:53   ` John Stultz
  0 siblings, 0 replies; 4+ messages in thread
From: John Stultz @ 2018-06-12 22:53 UTC (permalink / raw)
  To: Kees Cook; +Cc: Laura Abbott, Thomas Richter, Greg Kroah-Hartman, lkml

On Tue, Jun 12, 2018 at 3:52 PM, Kees Cook <keescook@chromium.org> wrote:
> On Tue, Jun 12, 2018 at 3:40 PM, John Stultz <john.stultz@linaro.org> wrote:
>> Hey all,
>>   I noticed recently that linus/master (plus patches) stopped booting
>> to UI on HiKey960, and I bisected the issue down to:
>> 92170b62f1c1 ("debugfs: inode: debugfs_create_dir uses mode permission
>> from parent")
>>
>> On the HiKey960 board, we mount debugfs via:
>>    mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
>>
>> But since the change, it seems most of the nodes in /sys/kernel/debug
>> are: drwx------
>>
>> Which ends up breaking the egl library, keeping it from loading.
>>
>> This seems to be the expected behavior of the patch, but I'm surprised
>> the mode override is now ignored. It seems like the potential fix here
>> would be to set the /sys/kernel/debug dir to 755 prior to mounting? Or
>> is there some other advised solution?
>
> This change has already be reverted from other people reporting the
> problem. Perhaps the root cause is the lack of propagation of the
> mode= value?

Ah! Thanks, sorry for not searching for the earlier discussion.

thanks
-john

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: REGRESSION?: debugfs: inode: debugfs_create_dir uses mode permission from parent
  2018-06-12 22:40 REGRESSION?: debugfs: inode: debugfs_create_dir uses mode permission from parent John Stultz
  2018-06-12 22:52 ` Kees Cook
@ 2018-06-13  4:58 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-06-13  4:58 UTC (permalink / raw)
  To: John Stultz; +Cc: Thomas Richter, Kees Cook, lkml

On Tue, Jun 12, 2018 at 03:40:41PM -0700, John Stultz wrote:
> Hey all,
>   I noticed recently that linus/master (plus patches) stopped booting
> to UI on HiKey960, and I bisected the issue down to:
> 92170b62f1c1 ("debugfs: inode: debugfs_create_dir uses mode permission
> from parent")
> 
> On the HiKey960 board, we mount debugfs via:
>    mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
> 
> But since the change, it seems most of the nodes in /sys/kernel/debug
> are: drwx------
> 
> Which ends up breaking the egl library, keeping it from loading.

While the debugfs change is now reverted in Linus's tree, I find it
"odd" that a debugfs change would cause egl from loading entirely.  No
userspace code should depend on debugfs files being there or not.  If it
does, that's a bug as debugfs is for _debugging_ stuff, it should not be
an interface between user/kernel that userspace requires for basic
functionality like booting.

And yes, I know all about the crazy qualcom batter api, where they
shoved it into debugfs and ignored the built-in kernel api, that should
be fixed now.  If this is a new one-of-those types of problem, I need to
know so it can get resolved.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-13  4:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 22:40 REGRESSION?: debugfs: inode: debugfs_create_dir uses mode permission from parent John Stultz
2018-06-12 22:52 ` Kees Cook
2018-06-12 22:53   ` John Stultz
2018-06-13  4:58 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).