On Thu, Apr 6, 2023 at 7:35 PM Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > ah, in that sense... What's the reasoning for this enforcement? I'm > just afraid that it will complicate applications that don't care and > are not aware of this field and do retries with the same attribute. On > first try, the kernel fills out log_true_size, application retries and > doesn't clear log_true_size (because it was written a while ago, but > compiled against latest kernel UAPI, so passes sizeof(union bpf_attr) > that includes new field). And that suddenly starts failing with > -EINVAL. > > Seems like an unfortunate side effect, no? What's the harm in not > validating this field, if it's an output-only parameter? Hmm good point. Just abundance of caution, but in this case it doesn't make sense.