In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_uac1_legacy: remove broken string configfs attributes The UAC1_STR_ATTRIBUTE macro defines configfs show/store handlers for the fn_play, fn_cap, and fn_cntl string options. Функция хранилища содержит инвертированную нулевую проверку возвращаемого значения kstrndup(). Это означает, что каждая попытка записи возвращает -ENOMEM на успех и лишает указатель NULL на неудачу выделения.
Атрибуты были сломаны и не использовались в течение многих лет. Удалите макрос UAC1_STR_ATTRIBUTE и три сгенерированных им атрибута. Внутренние по умолчанию (FILE_PCM_PLAYBACK, FILE_PCM_CAPTURE, FILE_CONTROL), установленные в f_audio_alloc_inst(), не затрагиваются.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_uac1_legacy: remove broken string configfs attributes The UAC1_STR_ATTRIBUTE macro defines configfs show/store handlers for the fn_play, fn_cap, and fn_cntl string options. The store function contains an inverted null check on the kstrndup() return value. This means every write attempt returns -ENOMEM on success and dereferences a NULL pointer on allocation failure. The attributes have been broken and unused for many years. Remove the UAC1_STR_ATTRIBUTE macro and the three attributes it generated. The internal defaults (FILE_PCM_PLAYBACK, FILE_PCM_CAPTURE, FILE_CONTROL) set in f_audio_alloc_inst() are unaffected.