Page MenuHomeFreeBSD

sound: Prevent uninitialized variable destruction in chn_init()
ClosedPublic

Authored by christos on May 20 2024, 2:03 PM.
Tags
None
Referenced Files
F132404852: D45272.id.diff
Thu, Oct 16, 3:52 PM
F132404851: D45272.id138786.diff
Thu, Oct 16, 3:52 PM
F132404850: D45272.id138788.diff
Thu, Oct 16, 3:52 PM
F132404838: D45272.id138784.diff
Thu, Oct 16, 3:52 PM
F132354376: D45272.diff
Thu, Oct 16, 4:32 AM
Unknown Object (File)
Wed, Oct 15, 1:31 AM
Unknown Object (File)
Fri, Sep 26, 3:15 PM
Unknown Object (File)
Sep 14 2025, 7:56 AM
Subscribers

Details

Summary

If dsp_unit2name() fails, we'll get to out2 with b, bs and devinfo
uninitialized, which will result in a panic.

Reported by: Pierre Pronchery <pierre@freebsdfoundation.org>
Reported by: Coverity Scan
CID: 1545029, 1545025
Pull-request: https://github.com/freebsd/freebsd-src/pull/1240
Sponsored by: The FreeBSD Foundation
MFC after: 1 day

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
sys/dev/sound/pcm/channel.c
1252

These assignments are redundant since c was allocated with M_ZERO. You could just get rid of them.

This revision is now accepted and ready to land.May 20 2024, 2:08 PM
christos added inline comments.
sys/dev/sound/pcm/channel.c
1252
christos marked an inline comment as done.

Address Mark's comment.

This revision now requires review to proceed.May 20 2024, 2:12 PM
sys/dev/sound/pcm/channel.c
1252

It should just be done in a single patch, IMHO, but ok.

This revision is now accepted and ready to land.May 20 2024, 2:15 PM