Re: remaining flexible-array conversions

From: Jason Gunthorpe
Date: Thu Oct 08 2020 - 11:54:37 EST


On Thu, Oct 08, 2020 at 05:24:03PM +0200, Jan Engelhardt wrote:

> In the case of the RDMA headers, even if we assume best conditions --
> a block of malloc(sizeof(struct ib_uverbs_create_cq_resp) +
> sizeof(u64)*N) and not some struct -- it smells a lot like undefined
> behavior, because ib_uverbs_create_cq_resp::driver_data accesses data
> as u64

driver_data[] is never accessed, it is only used as a pointer. Aliasing
should be OK because all accesses to those bytes consistently use u32.

Fixing the compiler warning requires significant edits of kernel and
user code, not entirely sure it is worthwhile.

If someone wants to do it let me know and I'll give some guidance.

Jason