Re: [PATCH v2] 9P FS: Fix wild-memory-access write in v9fs_get_acl

From: Ivan Orlov
Date: Sat Mar 11 2023 - 07:08:35 EST


On 3/11/23 15:17, Christian Schoenebeck wrote:
I would have written it in different style:

if (buffer_size)
retval = -ERANGE;
else if (attr_size > SSIZE_MAX)
retval = -EOVERFLOW;
else
retval = attr_size; /* request to get the attr_size */

But the behaviour change itself makes sense, so:

Reviewed-by: Christian Schoenebeck <linux_oss@xxxxxxxxxxxxx>

} else {
iov_iter_truncate(&to, attr_size);
retval = p9_client_read(attr_fid, 0, &to, &err);




You are right, the condition can be simplified, thank you! I will rewrite it, send as v3 and mention you in 'suggested-by'.