Bug 260489 - Permissions on audio and midi devices
Summary: Permissions on audio and midi devices
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-17 09:34 UTC by Goran Mekić
Modified: 2022-01-07 13:31 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Goran Mekić 2021-12-17 09:34:20 UTC
To give just an example, /dev/umidi* have 644 perms, which means I can read MIDI in, but not write to MIDI out. I spent hours trying to identify faulty cable only to realize it's the device file that doesn't have proper permissions. My suggestion is to either have audio group with rw permissions on dsp, midi and umidi devices or to adjust permissions on those devices so everyone can read and write. I slightly prefer dedicated audio group as that way I can limit who has access to audio hardware. I am posting here for a discussion and whatever we decide, I'll be glad to implement.
Comment 1 Florian Walpen 2021-12-17 10:43:54 UTC
I was bitten by the unexpected default permissions of /dev/umidi* too. But tightening dsp permissions to an audio group will be disruptive to many desktop users - they'll have to add themselves to the audio group manually. We would need a good reason to justify that.

For me it boils down to the following questions:
1. Is there a technical / security reason that prevents permission 666 on umidi?
2. Are there significant security gains by tightening audio permissions in general?

@HPS: What do you think?
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2021-12-17 10:47:44 UTC
Hi,

/dev/dsp* already has 666 permissions, so I guess doing the same for midi wouldn't hurt.

--HPS
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2021-12-17 10:48:02 UTC
Alexander, what do you think?
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-12-17 10:56:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2fcd7d380ba103060d43d6d01c1af6bb95819504

commit 2fcd7d380ba103060d43d6d01c1af6bb95819504
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-12-17 10:52:00 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-12-17 10:54:19 +0000

    snd_uaudio(4): Loosen up the USB MIDI permissions.

    This makes USB MIDI more userfriendly for desktop users.

    PR:             260489
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking

 sys/dev/sound/usb/uaudio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-01-07 13:31:38 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=457750da86f17598be135b3cc706f4275560749d

commit 457750da86f17598be135b3cc706f4275560749d
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-12-17 10:52:00 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-01-07 13:23:26 +0000

    snd_uaudio(4): Loosen up the USB MIDI permissions.

    This makes USB MIDI more userfriendly for desktop users.

    PR:             260489
    Sponsored by:   NVIDIA Networking

    (cherry picked from commit 2fcd7d380ba103060d43d6d01c1af6bb95819504)

 sys/dev/sound/usb/uaudio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)