В ядре Linux была устранена следующая уязвимость: net: sparx5: free the matchall entry on destroy sparx5_tc_matchall_replace() выделяет struct sparx5_mall_entry для каждого разгруженного matchall фильтра и добавляет его в sparx5->mall_entries. sparx5_tc_matchall_destroy() удаляет запись из списка, но никогда не освобождает его, поэтому пропускает запись каждого удаленного зеркала и goto matchall фильтра. Освободите вход после его отсоединения. Утечка была обнаружена агентом обзора кода AI и воспроизведена с помощью kmemleak на плате lan969x EV (EV23X71A) путем многократного добавления и удаления зеркала matchall и фильтров goto.
С исправлением kmemleak больше не сообщает об утечке.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: net: sparx5: free the matchall entry on destroy sparx5_tc_matchall_replace() allocates a struct sparx5_mall_entry for every offloaded matchall filter and adds it to sparx5->mall_entries. sparx5_tc_matchall_destroy() removes the entry from the list, but never frees it, so the entry of every deleted mirror and goto matchall filter is leaked. Free the entry after unlinking it. The leak was discovered by an AI code review agent, and reproduced with kmemleak on a lan969x EV board (EV23X71A) by repeatedly adding and deleting matchall mirror and goto filters. With the fix, kmemleak no longer reports the leak.