From 2ca36995aaecbfcd2268b19cf3445fdf64bb508e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 3 May 2024 07:13:00 +0200 Subject: prog: fix panic during squashing Netbsd syzbot instance crashes trying to squash a pointer. Pointers must not be squashed. This happens because of recursive ucontext_t type that contains a pointer to itself. When we assign SquashableElem recursive struct types may not be fully generated yet, and ForeachArgType won't observe all types. Assign SquashableElem after all types are fully generated. --- prog/any.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/any.go') diff --git a/prog/any.go b/prog/any.go index ee898446b..c43d8dd8d 100644 --- a/prog/any.go +++ b/prog/any.go @@ -175,7 +175,7 @@ func (target *Target) squashPtrImpl(a Arg, elems *[]Arg) { case *GroupArg: target.squashGroup(arg, elems) default: - panic("bad arg kind") + panic(fmt.Sprintf("bad arg kind %v (%#v) %v", a, a, a.Type())) } if pad != 0 { elem := target.ensureDataElem(elems) -- cgit mrf-deployment