Bug 218235

Summary: Memory Leak in p9pdu_readf with stable reproducer
Product: File System Reporter: Alexey Panov (apanov)
Component: v9fsAssignee: Eric Van Hensbergen (ericvh)
Status: RESOLVED CODE_FIX    
Severity: normal    
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: 5.10.199 Subsystem:
Regression: No Bisected commit-id:
Attachments: syzkaller report
syz-repro
C-repro

Description Alexey Panov 2023-12-06 12:08:14 UTC
Created attachment 305546 [details]
syzkaller report

I have identified a memory leak issue in the Linux Kernel version 5.10 (v5.10.199) related to p9pdu_readf.

This bug was previously discussed in this conversation
https://lore.kernel.org/all/20231027030302.11927-1-hbh25y@gmail.com/
and subsequently fixed in this commit, titled "9p/net: fix possible memory leak in p9_check_errors()".
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce07087964208eee2ca2f9ee4a98f8b5d9027fe6

However, the fix was not backported to the 5.10 kernel version.

To address this, I am planning to backport the fix to kernel version 5.10. The backport will resolve the issue, as confirmed by the reproducer tests.

Attached are the syzkaller report (report.txt), syz-repro (repro.syz), and C-repro (repro.c), demonstrating the issue.
Comment 1 Alexey Panov 2023-12-06 12:09:06 UTC
Created attachment 305547 [details]
syz-repro
Comment 2 Alexey Panov 2023-12-06 12:09:21 UTC
Created attachment 305548 [details]
C-repro
Comment 3 Alexey Panov 2024-01-09 06:06:48 UTC
This fix has been applied in Linux v5.10.206

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1e2db0124c695b11e5c522d87f6ca329e608a897