On Mon, Oct 24, 2022 at 02:38:14PM -0700, Darrick J. Wong wrote: > <nod> I realized that these helpers introducing unsafe memcpy weren't > needed. Later on after chatting with dchinner a bit I came to the > conclusion that we might as well convert most of the _copy_format > functions to memcpy the structure head and flex array separately since > that function is converting an ondisk log item into its in-memory > representation, and some day we'll make those struct fields endian safe. > They aren't now, and that's one of the (many) gaping holes that need > fixing. Ah, perfect! Yeah, this is one of the other standard solutions -- header and flex array handled separately. I'm still working on APIs to handle the common cases, though. XFS probably will want to keep it separate as you've done. > I sent my candidate fixes series to the list just now. Thanks! I'll go check them out. -- Kees Cook