[lvc-project] [PATCH 5.10.y] cifs: Fix connections leak when tlink setup failed

Vasiliy Kovalev kovalev at altlinux.org
Thu Apr 23 17:11:55 MSK 2026


On 4/23/26 11:21, Fedor Pchelkin wrote:
> On Tue, 21. Apr 16:26, Vasiliy Kovalev wrote:
>> From: Zhang Xiaoxu <zhangxiaoxu5 at huawei.com>
>>
>> commit 1dcdf5f5b2137185cbdd5385f29949ab3da4f00c upstream.
>>
>> If the tlink setup failed, lost to put the connections, then
>> the module refcnt leak since the cifsd kthread not exit.
>>
>> Also leak the fscache info, and for next mount with fsc, it will
>> print the follow errors:
>>    CIFS: Cache volume key already in use (cifs,127.0.0.1:445,TEST)
>>
>> Let's check the result of tlink setup, and do some cleanup.
>>
>> Fixes: 56c762eb9bee ("cifs: Refactor out cifs_mount()")
>> Reviewed-by: Paulo Alcantara (SUSE) <pc at cjr.nz>
>> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5 at huawei.com>
>> Signed-off-by: Steve French <stfrench at microsoft.com>
>> [ kovalev: bp to fix CVE-2022-49822; adapted to use direct xid/ses/tcon
>>    variables instead of mnt_ctx struct fields due to the older kernel not
>>    having the corresponding cifs_mount() refactoring (see upstream commit
>>    c88f7dcd6d64) ]
>> Signed-off-by: Vasiliy Kovalev <kovalev at altlinux.org>
> 
> См. https://sashiko.dev/#/patchset/20260421132612.38517-1-kovalev%40altlinux.org.
> 
> Требуется доп. исследование корректности бэкпорта в рамках 5.10.  [не
> удивлюсь, если в апстриме была/есть такая же проблема]

Спасибо за замечание, отправил v2 
[https://lore.kernel.org/all/20260423140245.195039-1-kovalev@altlinux.org/].



More information about the lvc-project mailing list