Logging in/out on console while logged in in X removes hardware acceleration

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging in/out on console while logged in in X removes hardware acceleration

Nils Reuße-4
Dear all,

logging in and out changes the owner of the /dev/drm0 file, so that one
loses hardware acceleration in X when additionally logging in and out on
a console.  Here's what I do:

1) Boot Openbsd and log into X with xenodm.  Ownership of /dev/drm0:

     $ ls -l /dev/drm0
     crw-------  1 nils  wheel   87,   0 Jul 31 13:07 /dev/drm0

2) Switch to a console (e.g. CTRL-ALT-F1) and log in with the same user.
  The file is now owned by my user-group:

     $ ls -l /dev/drm0
     crw-------  1 nils  nils   87,   0 Jul 31 13:07 /dev/drm0

3) Log out from the console.  Ownership changes back to root/wheel,
thereby disabling hardware acceleration in X:

     $ ls -l /dev/drm0
     crw-------  1 root  wheel   87,   0 Jul 31 13:07 /dev/drm0

To regain hardware acceleration, I have to manually chown the file back
to my userid, or relogin with xenodm.  So I guess logging in chowns the
file with my user (even with my user group when logging in via console),
and logging out reassigns the file owner to root.

I guess not much can be done about this, or can it?

Nils

Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

Theo de Raadt-2
I'm not sure what can be done about it.

/etc/fbtab's first role is to give access to subsystems, but it's
second more important role is to *take them away* later.

Unfortunately there is nothing "keeping state" about previous access
conditions, as well it is quite unclear if reverting to previous access
conditions would be a safe choice.


=?UTF-8?Q?Nils_Reu=c3=9fe?= <[hidden email]> wrote:

> Dear all,
>
> logging in and out changes the owner of the /dev/drm0 file, so that one
> loses hardware acceleration in X when additionally logging in and out on
> a console.  Here's what I do:
>
> 1) Boot Openbsd and log into X with xenodm.  Ownership of /dev/drm0:
>
>      $ ls -l /dev/drm0
>      crw-------  1 nils  wheel   87,   0 Jul 31 13:07 /dev/drm0
>
> 2) Switch to a console (e.g. CTRL-ALT-F1) and log in with the same user.
>   The file is now owned by my user-group:
>
>      $ ls -l /dev/drm0
>      crw-------  1 nils  nils   87,   0 Jul 31 13:07 /dev/drm0
>
> 3) Log out from the console.  Ownership changes back to root/wheel,
> thereby disabling hardware acceleration in X:
>
>      $ ls -l /dev/drm0
>      crw-------  1 root  wheel   87,   0 Jul 31 13:07 /dev/drm0
>
> To regain hardware acceleration, I have to manually chown the file back
> to my userid, or relogin with xenodm.  So I guess logging in chowns the
> file with my user (even with my user group when logging in via console),
> and logging out reassigns the file owner to root.
>
> I guess not much can be done about this, or can it?
>
> Nils
>

Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

Nils Reuße-4
Hi Theo,

thank you for your reply.  Well then, I guess I just stop switching
around between different login sessions ;)

Nils


Am 31.07.2020 um 16:08 schrieb Theo de Raadt:

> I'm not sure what can be done about it.
>
> /etc/fbtab's first role is to give access to subsystems, but it's
> second more important role is to *take them away* later.
>
> Unfortunately there is nothing "keeping state" about previous access
> conditions, as well it is quite unclear if reverting to previous access
> conditions would be a safe choice.
>
>
> =?UTF-8?Q?Nils_Reu=c3=9fe?= <[hidden email]> wrote:
>
>> Dear all,
>>
>> logging in and out changes the owner of the /dev/drm0 file, so that one
>> loses hardware acceleration in X when additionally logging in and out on
>> a console.  Here's what I do:
>>
>> 1) Boot Openbsd and log into X with xenodm.  Ownership of /dev/drm0:
>>
>>       $ ls -l /dev/drm0
>>       crw-------  1 nils  wheel   87,   0 Jul 31 13:07 /dev/drm0
>>
>> 2) Switch to a console (e.g. CTRL-ALT-F1) and log in with the same user.
>>    The file is now owned by my user-group:
>>
>>       $ ls -l /dev/drm0
>>       crw-------  1 nils  nils   87,   0 Jul 31 13:07 /dev/drm0
>>
>> 3) Log out from the console.  Ownership changes back to root/wheel,
>> thereby disabling hardware acceleration in X:
>>
>>       $ ls -l /dev/drm0
>>       crw-------  1 root  wheel   87,   0 Jul 31 13:07 /dev/drm0
>>
>> To regain hardware acceleration, I have to manually chown the file back
>> to my userid, or relogin with xenodm.  So I guess logging in chowns the
>> file with my user (even with my user group when logging in via console),
>> and logging out reassigns the file owner to root.
>>
>> I guess not much can be done about this, or can it?
>>
>> Nils
>>


Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

Mihai Popescu-3
In reply to this post by Nils Reuße-4
| Well then, I guess I just stop switching around between different login
sessions

What about avoiding Ctrl+Alt+F1 (and ... F5 wich is X) and use ... +F2,
+F3, etc.?
You could still miss some settings, I am not sure.

I wonder if /etc/fbtab is able to support multiple tty entries and manage
them each.
Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

lists-2
In reply to this post by Nils Reuße-4
Fri, 31 Jul 2020 17:36:53 +0200 Nils Reuße <[hidden email]>

> Hi Theo,
>
> thank you for your reply.  Well then, I guess I just stop switching
> around between different login sessions ;)
>
> Nils
>
>
> Am 31.07.2020 um 16:08 schrieb Theo de Raadt:
> > I'm not sure what can be done about it.
> >
> > /etc/fbtab's first role is to give access to subsystems, but it's
> > second more important role is to *take them away* later.
> >
> > Unfortunately there is nothing "keeping state" about previous access
> > conditions, as well it is quite unclear if reverting to previous access
> > conditions would be a safe choice.
> >

Hi Nils,

Or use own tooling to reset desired permissions when you're in X again,
try to see if your window manager accepts bindings and use it instead..

--
Kind regards,
Anton Lazarov
MScEng EECSIT

Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

Strahil Nikolov
Hi All,

can somwone explain me why all login sessions use /dev/drm0 and not /dev/drm1  or something like that ?

Best Regards,
Strahil Nikolov

На 2 август 2020 г. 18:22:23 GMT+03:00, [hidden email] написа:

>Fri, 31 Jul 2020 17:36:53 +0200 Nils Reuße <[hidden email]>
>> Hi Theo,
>>
>> thank you for your reply.  Well then, I guess I just stop switching
>> around between different login sessions ;)
>>
>> Nils
>>
>>
>> Am 31.07.2020 um 16:08 schrieb Theo de Raadt:
>> > I'm not sure what can be done about it.
>> >
>> > /etc/fbtab's first role is to give access to subsystems, but it's
>> > second more important role is to *take them away* later.
>> >
>> > Unfortunately there is nothing "keeping state" about previous
>access
>> > conditions, as well it is quite unclear if reverting to previous
>access
>> > conditions would be a safe choice.
>> >
>
>Hi Nils,
>
>Or use own tooling to reset desired permissions when you're in X again,
>try to see if your window manager accepts bindings and use it instead..

Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

Theo de Raadt-2
Explanation: It is how it works.




Strahil Nikolov <[hidden email]> wrote:

> Hi All,
>
> can somwone explain me why all login sessions use /dev/drm0 and not /dev/drm1  or something like that ?
>
> Best Regards,
> Strahil Nikolov
>
> На 2 август 2020 г. 18:22:23 GMT+03:00, [hidden email] написа:
> >Fri, 31 Jul 2020 17:36:53 +0200 Nils Reuße <[hidden email]>
> >> Hi Theo,
> >>
> >> thank you for your reply.  Well then, I guess I just stop switching
> >> around between different login sessions ;)
> >>
> >> Nils
> >>
> >>
> >> Am 31.07.2020 um 16:08 schrieb Theo de Raadt:
> >> > I'm not sure what can be done about it.
> >> >
> >> > /etc/fbtab's first role is to give access to subsystems, but it's
> >> > second more important role is to *take them away* later.
> >> >
> >> > Unfortunately there is nothing "keeping state" about previous
> >access
> >> > conditions, as well it is quite unclear if reverting to previous
> >access
> >> > conditions would be a safe choice.
> >> >
> >
> >Hi Nils,
> >
> >Or use own tooling to reset desired permissions when you're in X again,
> >try to see if your window manager accepts bindings and use it instead..
>

Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

Mihai Popescu-3
In reply to this post by Nils Reuße-4
> can somwone explain me ...

I guess one can, but it must be from old unix days. Things got changed and
mixed, but they are considered ordinary now, so ordinary that even a basic
newbie unix book skips them entirely.
I am curious even now what is the link among shell, terminal, console, tty.
Even the newbies list is closed.

All this will not hinder OpenBSD development, so use it as it is and try to
grab some answers from internet, good or bad ones it is to you to check.
Reply | Threaded
Open this post in threaded view
|

Re: Logging in/out on console while logged in in X removes hardware acceleration

Strahil Nikolov
Thanks for the  reply.

In the first place,  I was  wondering if creation of /dev/drm1  (same major and minor) is even possible. In Linux I can create as many devices I need pointing to the same major & minor numbers (for example creating a /dev/null for a chroot jail).

If the logic  is the same, then each login can create a separate device and later just remove it on logout. Yet,  from security perspective it could be a bad solution ...


Best  Regards,
Strahil Nikolov


На 2 август 2020 г. 23:42:08 GMT+03:00, Mihai Popescu <[hidden email]> написа:

>> can somwone explain me ...
>
>I guess one can, but it must be from old unix days. Things got changed
>and
>mixed, but they are considered ordinary now, so ordinary that even a
>basic
>newbie unix book skips them entirely.
>I am curious even now what is the link among shell, terminal, console,
>tty.
>Even the newbies list is closed.
>
>All this will not hinder OpenBSD development, so use it as it is and
>try to
>grab some answers from internet, good or bad ones it is to you to
>check.