Re: [PATCH 1/2] 9p/xen: check logical size for buffer size

From: Dominique Martinet
Date: Mon Nov 21 2022 - 19:40:04 EST


Christian Schoenebeck wrote on Mon, Nov 21, 2022 at 05:35:56PM +0100:
> Looks good (except of s/rreq/req/ mentioned by Stefano already).

Thanks for the review (I've taken this as a 'reviewed-by' under the
assumption of that fix, sorry for being a bit aggressive at collecting
these -- I'd rather overcredit work being done than the other way around)

I'll send this and the three other commits in my 9p-next branch to Linus
tomorrow around this time:
https://github.com/martinetd/linux/commits/9p-next


> > memcpy(&req->rc, &h, sizeof(h));
>
> Is that really OK?
>
> 1. `h` is of type xen_9pfs_header and declared as packed, whereas `rc` is of
> type p9_fcall not declared as packed.
>
> 2. Probably a bit dangerous to assume the layout of xen_9pfs_header being in
> sync with the starting layout of p9_fcall without any compile-time
> assertion?

I've done this in a follow up that will be sent to Linus later as per
Stefano's suggestion.

--
Dominique