diff options
author | Rich Felker <dalias@aerifal.cx> | 2021-10-19 16:07:14 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2021-10-19 16:07:14 -0400 |
commit | 3733c831f293b3bbfd0e51faec8ee71112c62c3e (patch) | |
tree | 99df9366357c0435191239bc5803308c7af21ca1 /compat/time32/cnd_timedwait_time32.c | |
parent | b76f37fd5625d038141b52184956fb4b7838e9a5 (diff) | |
download | musl-3733c831f293b3bbfd0e51faec8ee71112c62c3e.tar.gz musl-3733c831f293b3bbfd0e51faec8ee71112c62c3e.tar.bz2 musl-3733c831f293b3bbfd0e51faec8ee71112c62c3e.tar.xz musl-3733c831f293b3bbfd0e51faec8ee71112c62c3e.zip |
fix struct layout mismatch in sound ioctl time32 fallback conversion
the snd_pcm_mmap_control struct used with SNDRV_PCM_IOCTL_SYNC_PTR was
mistakenly defined in the kernel uapi with "before u32" padding both
before and after the first u32 member. our conversion between the
modern struct and the legacy time32 struct was written without
awareness of that mistake, and assumed the time64 version of the
struct was the intended form with padding to match the layout on
64-bit archs. as a result, the struct was not converted correctly when
running on old kernels, with audio glitches as the likely result.
this was discovered thanks to a related bug in the kernel, whereby
32-bit userspace running on a 64-bit kernel also suffered from the
types mismatching. the mistaken layout is now the ABI and can't be
changed -- or at least making a new ioctl to change it would just
result in a worse situation.
our conversion here is changed to treat the snd_pcm_mmap_control
substruct as two separate substructs at locations dependent on
endianness (since the displacement depends on endianness), using the
existing conversion framework.
Diffstat (limited to 'compat/time32/cnd_timedwait_time32.c')
0 files changed, 0 insertions, 0 deletions