On Fri, Jul 24, 2020 at 10:10:08AM -0400, Chuck Lever wrote: > >> I'd like to remove this code, but > >> I'd first like to understand how it will effect the code that follows > >> immediately after: > >> > >> offset = xdr_pad_size(buf->head[0].iov_len); > >> if (offset) { > >> buf->buflen = RPCSVC_MAXPAYLOAD; > >> xdr_shift_buf(buf, offset); > >> fix_priv_head(buf, pad); > >> } > > So if one of those patches removes "pad = priv_len - buf->len;" > then the above code will break. > > But I'm trying to see when it is possible for gss_unwrap to > return a head buffer that is not quad-aligned. Not coming up > with any such scenario. Thinking about it more, even if there was some gss mechanism returning misaligned data, the best place to fix that would likely be in the mechanism-specific code (partly for reasons noted in the comment right here--it'll be more efficient to put the data in the right spot as you encrypt it.) --b.