Re: include/linux/compiler_types.h:631:45: error: call to '__compiletime_assert_433' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct qla_tgt_sess_op, atio) + sizeof(u->atio) != sizeof(*u)

From: Finn Thain

Date: Mon Nov 23 2026 - 22:32:14 EST



On Mon, 23 Nov 2026, Bart Van Assche wrote:

> On 11/23/26 3:05 PM, Finn Thain wrote:
> > Yes, two alternative solutions were submitted in March (either remove the
> > assertion or rework it). The build bot reported the problem again in
> > September so I resubmitted the "rework" alternative. Sashiko-bot didn't
> > have much praise for that*, so now I'm leaning towards the "remove"
> > alternative. I have been advised to keep re-submitting, and I will do so
> > after a suitable back-off in retry rate i.e. 2027 or 2028.
> >
> > *
> > https://lore.kernel.org/r/93e35f60-e465-7f76-0043-f997fe2ec8c7@xxxxxxxxxxxxxx
>
> What an LLM came up with after I asked it to fix
> https://lore.kernel.org/lkml/202603030747.VX0v4otS-lkp@xxxxxxxxx/ can be
> found below. One of the comments of the LLM is "This is essentially Finn
> Thain's "Rework BUILD_BUG_ON() assertion" patch with your two review
> comments from this morning applied". Sashiko reports "No issues found"
> for the patch below. No Signed-off-by from me because I think Finn
> should be credited for his work instead of I.
>

Thanks, Bart. I'll take that as a vote for "rework". There is an
associated risk though: I can't test the patch as I don't have access to
suitable hardware. (Perhaps someone with such access will volunteer.)

Whereas, the "remove" alternative doesn't require testing as it doesn't
risk a regression.

I have a question for your LLM. Sashiko-bot said, in response to my patch:

Similarly, get_datalen_for_atio() accesses the array out-of-bounds
when len > 0:

drivers/scsi/qla2xxx/qla_target.h:get_datalen_for_atio() {
...
return get_unaligned_be32(&atio->u.isp24.fcp_cmnd.add_cdb[len * 4]);
...
}

I don't understand why the patch from your LLM did not raise the same OOB
access concerns.

Adding a flex array to struct qla_tgt_sess_op can prevent new struct
members being added in the wrong spot in that struct but can't prevent new
struct members being added to struct atio7_fcp_cmnd. Neither does the
assertion. So the "remove" alternative doesn't have all the disadvantages
that you might expect.