rc: virtual_oss: Create a loopback device in the default configuration #16

Manually merged
christos merged 1 commit from christos/loop into main 2026-05-21 17:39:32 +00:00 AGit
Member

The loopback device allows us to record desktop sound by reading from
it, or even use it as an input device, for example during a call.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

The loopback device allows us to record desktop sound by reading from it, or even use it as an input device, for example during a call. Sponsored by: The FreeBSD Foundation MFC after: 1 week
rc: virtual_oss: Create a loopback device in the default configuration
Some checks failed
Checklist / commit (pull_request_target) Has been cancelled
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (pull_request) Has been cancelled
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / amd64 macos-latest (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 macos-latest (clang-18) (pull_request) Has been cancelled
caea20be3e
The loopback device allows us to record desktop sound by reading from
it, or even use it as an input device, for example during a call.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Member

What are the default permissions of the device? Does it let an unprivileged application record all sound that gets written to /dev/dsp?

What are the default permissions of the device? Does it let an unprivileged application record all sound that gets written to /dev/dsp?
Author
Member

Devices are created with 0666, see voss_dsp_perm in usr.sbin/virtual_oss/virtual_oss/main.c. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp.

That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example.

What threat are you having in mind?

Devices are created with 0666, see `voss_dsp_perm` in `usr.sbin/virtual_oss/virtual_oss/main.c`. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp. That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example. What threat are you having in mind?
Author
Member

@christos wrote in #16 (comment):

Devices are created with 0666, see voss_dsp_perm in usr.sbin/virtual_oss/virtual_oss/main.c. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp.

That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example.

What threat are you having in mind?

Bump.

@christos wrote in https://ron-dev.freebsd.org/FreeBSD/src/pulls/16#issuecomment-223: > Devices are created with 0666, see `voss_dsp_perm` in `usr.sbin/virtual_oss/virtual_oss/main.c`. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp. > > That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example. > > What threat are you having in mind? Bump.
Member

@christos wrote in #16 (comment):

Devices are created with 0666, see voss_dsp_perm in usr.sbin/virtual_oss/virtual_oss/main.c. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp.

That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example.

What threat are you having in mind?

@christos wrote in #16 (comment):

Devices are created with 0666, see voss_dsp_perm in usr.sbin/virtual_oss/virtual_oss/main.c. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp.

That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example.

What threat are you having in mind?

Any unprivileged user, including "nobody" would be able to open the device and snoop audio. Better would be to require the user to belong to some special group, akin to "video", no?

@christos wrote in https://ron-dev.freebsd.org/FreeBSD/src/pulls/16#issuecomment-223: > Devices are created with 0666, see `voss_dsp_perm` in `usr.sbin/virtual_oss/virtual_oss/main.c`. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp. > > That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example. > > What threat are you having in mind? @christos wrote in https://ron-dev.freebsd.org/FreeBSD/src/pulls/16#issuecomment-223: > Devices are created with 0666, see `voss_dsp_perm` in `usr.sbin/virtual_oss/virtual_oss/main.c`. So unprivileged users can indeed "snoop" the audio getting written to /dev/dsp. > > That being said, if we don't let unprivileged users access it, someone who wants to stream their desktop audio, say, during a video conference, or a live stream, has to run the browser or streaming program as root, for example. > > What threat are you having in mind? Any unprivileged user, including "nobody" would be able to open the device and snoop audio. Better would be to require the user to belong to some special group, akin to "video", no?
Author
Member

@markj wrote in #16 (comment):

Any unprivileged user, including "nobody" would be able to open the device and snoop audio. Better would be to require the user to belong to some special group, akin to "video", no?

I like this idea. We could create an "audio" group, which the user will have to be part of in order to open any sound(4) or virtual_oss(8) devices. I'll submit a patch.

@markj wrote in https://ron-dev.freebsd.org/FreeBSD/src/pulls/16#issuecomment-329: > Any unprivileged user, including "nobody" would be able to open the device and snoop audio. Better would be to require the user to belong to some special group, akin to "video", no? I like this idea. We could create an "audio" group, which the user will have to be part of in order to open any sound(4) or virtual_oss(8) devices. I'll submit a patch.
Author
Member

#26

https://ron-dev.freebsd.org/FreeBSD/src/pulls/26
Author
Member

Bump.

Bump.
emaste approved these changes 2026-05-21 17:06:42 +00:00
christos force-pushed christos/loop from caea20be3e
Some checks failed
Checklist / commit (pull_request_target) Has been cancelled
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (pull_request) Has been cancelled
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / amd64 macos-latest (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 macos-latest (clang-18) (pull_request) Has been cancelled
to 8532b4a436
Some checks failed
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Has been cancelled
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Has been cancelled
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Has been cancelled
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Has been cancelled
Checklist / commit (pull_request_target) Has been cancelled
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (pull_request) Has been cancelled
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / amd64 macos-latest (clang-18) (pull_request) Has been cancelled
Cross-build Kernel / aarch64 macos-latest (clang-18) (pull_request) Has been cancelled
2026-05-21 17:37:56 +00:00
Compare
christos manually merged commit 8532b4a436 into main 2026-05-21 17:39:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FreeBSD/src!16
No description provided.