Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71d6ad08 authored by Al Viro's avatar Al Viro
Browse files

p9_client_readdir() fix



Don't assume that server is sane and won't return more data than
asked for.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 890559e3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2101,6 +2101,10 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
		trace_9p_protocol_dump(clnt, req->rc);
		goto free_and_error;
	}
	if (rsize < count) {
		pr_err("bogus RREADDIR count (%d > %d)\n", count, rsize);
		count = rsize;
	}

	p9_debug(P9_DEBUG_9P, "<<< RREADDIR count %d\n", count);