• Takashi Iwai's avatar
    ALSA: pcm: oss: Fix regression by buffer overflow fix (again) · ff7e06a5
    Takashi Iwai authored
    [ This is essentially the same fix as commit ae769d35, but it's
      adapted to the latest code for 5.7; hence it contains no Fixes or
      other tags for avoid backport confusion -- tiwai ]
    
    The recent fix for the OOB access in PCM OSS plugins (commit
    f2ecf903: "ALSA: pcm: oss: Avoid plugin buffer overflow") caused a
    regression on OSS applications.  The patch introduced the size check
    in client and slave size calculations to limit to each plugin's buffer
    size, but I overlooked that some code paths call those without
    allocating the buffer but just for estimation.
    
    This patch fixes the bug by skipping the size check for those code
    paths while keeping checking in the actual transfer calls.
    
    Link: https://lore.kernel.org/r/20200403073818.27943-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    ff7e06a5
pcm_plugin.c 21.6 KB