Page MenuHomeFreeBSD

sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO
ClosedPublic

Authored by christos on Jul 5 2024, 2:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 7, 12:59 AM
Unknown Object (File)
Sat, Oct 25, 1:23 AM
Unknown Object (File)
Oct 8 2025, 2:39 AM
Unknown Object (File)
Sep 20 2025, 4:48 PM
Unknown Object (File)
Sep 10 2025, 11:39 AM
Unknown Object (File)
Aug 30 2025, 1:33 AM
Unknown Object (File)
Aug 25 2025, 7:22 PM
Unknown Object (File)
Aug 25 2025, 1:25 AM
Subscribers

Details

Summary

If the channel list is empty, min_rate and min_channels will be INT_MAX.
Instead, assign them to 0, like we do in sndstat_get_caps().

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58506
Build 55394: arc lint + arc unit

Event Timeline

@dev_submerge.ch I didn't add the same check in dsp_oss_engineinfo() because it will return EINVAL right away if no channel is found, and even if we find it, I don't think it's possible that caps->fmlist can be empty.

This revision is now accepted and ready to land.Jul 5 2024, 6:54 PM