The problem is caused by this bit in af_alg_sendmsg(): /* use the existing memory in an allocated page */ if (ctx->merge) { sgl = list_entry(ctx->tsgl_list.prev, struct af_alg_tsgl, list); sg = sgl->sg + sgl->cur - 1; len = min_t(size_t, len, PAGE_SIZE - sg->offset - sg->length); err = memcpy_from_msg(page_address(sg_page(sg)) + sg->offset + sg->length, msg, len); if (err) goto unlock; sg->length += len; ctx->merge = (sg->offset + sg->length) & (PAGE_SIZE - 1); ctx->used += len; copied += len; size -= len; continue; } it doesn't exist in the old af_alg_sendpage() code. It merges data supplied by sendmsg() into the last page in the list if there's space. So we need a flag to keep track of whether the last page is appendable-to or not. David