aboutsummaryrefslogtreecommitdiffstats
path: root/prog/resources_test.go
diff options
context:
space:
mode:
authorPaul Chaignon <paul.chaignon@gmail.com>2023-10-06 20:02:41 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-10-09 10:22:31 +0000
commitf5ee62f7ee98f53dced33b767e59f47b35017568 (patch)
treee3a79d0d20645b7834fe5e44d91d43200c503e0b /prog/resources_test.go
parent77f31e1f821f48a72259fdbd9d285d1ce16956f5 (diff)
prog: fix missing required input resources
While reviewing the changes introduced by previous commits, Aleksandr noticed a bug in the logic to compute all required input resources of a given syscall (function getInputResources). This commit fixes the bug. That function has an optimization to avoid walking structs and unions twice. That optimization however fails to consider the direction and optional bit. For example, if a struct is first encountered with DirOut (== output resource), it will never be analyzed again and will not be included in getInputResources' returned values. That same struct could however be included elsewhere with DirIn. The exact same issue affects the optional bit since optional resources are now also skipped by getInputResources. One approach to fix this is to only consider a struct or union as 'seen' if it was seen with the same direction and optional bit. This commit implements that approach. Fixes: 852e3d2eae98 ("sys: support recursive structs") Reported-by: Aleksandr Nogikh <nogikh@google.com> Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'prog/resources_test.go')
0 files changed, 0 insertions, 0 deletions