On Thu, 2024-01-04 at 09:13 -0800, Yonghong Song wrote: > On 1/4/24 8:37 AM, Eduard Zingerman wrote: [...] > > I agree with this change, but I don't understand under which conditions > > current STACK_ZERO logic is sub-optimal. > > I tried executing test case from patch #2 w/o applying patch #1 and it passes. > > Could you please elaborate / conjure a test case that would fail w/o patch #1? > > The logic is similar to > https://lore.kernel.org/all/20231205184248.1502704-9-andrii@xxxxxxxxxx/ > > STACK_ZERO logic is sub-optimal in some cases only w.r.t. the number of > verifier states. So there is no correctness issue. > Patch 2 is added in response to Andrii's request in > https://lore.kernel.org/all/CAEf4BzaWets3fHUGtctwCNWecR9ASRCO2kFagNy8jJZmPBWYDA@xxxxxxxxxxxxxx/ > Since with patch 1 the original STACK_ZERO case is converted to STACK_SPILL, > Patch 2 is added to cover STACK_ZERO case. So with or with patch 1, patch 2 > will succeed since it uses STACK_ZERO logic. Understood, thank you. Probably no need to add more tests then. A patch [1] might be related, it handles STACK_ZERO vs zero spill vs unbound scalar spill on regsafe side. [1] https://lore.kernel.org/bpf/20231220214013.3327288-15-maxtram95@xxxxxxxxx/