Files
linux/net/9p
Fedor Pchelkin ff49bf1867 net: 9p: avoid freeing uninit memory in p9pdu_vreadf
If some of p9pdu_readf() calls inside case 'T' in p9pdu_vreadf() fails,
the error path is not handled properly. *wnames or members of *wnames
array may be left uninitialized and invalidly freed.

Initialize *wnames to NULL in beginning of case 'T'. Initialize the first
*wnames array element to NULL and nullify the failing *wnames element so
that the error path freeing loop stops on the first NULL element and
doesn't proceed further.

Found by Linux Verification Center (linuxtesting.org).

Fixes: ace51c4dd2 ("9p: add new protocol support code")
Signed-off-by: Fedor Pchelkin <[email protected]>
Message-ID: <[email protected]>
Cc: [email protected]
Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Christian Schoenebeck <[email protected]>
Signed-off-by: Dominique Martinet <[email protected]>
2023-12-13 05:44:30 +09:00
..
2021-11-04 21:04:25 +09:00
2023-05-04 21:46:57 +01:00
2022-01-10 10:00:09 +09:00
2022-10-05 07:05:41 +09:00
2021-11-03 17:45:04 +09:00