From 9fe8aa42c5bd11e2eb6952a16da6287205d7bf97 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 24 Feb 2018 14:33:36 +0100 Subject: prog: add arbitrary mutation of complex structs Squash complex structs into flat byte array and mutate this array with generic blob mutations. This allows to mutate what we currently consider as paddings and add/remove paddings from structs, etc. --- sys/linux/init_iptables.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/linux/init_iptables.go') diff --git a/sys/linux/init_iptables.go b/sys/linux/init_iptables.go index d0e776045..86001b4c3 100644 --- a/sys/linux/init_iptables.go +++ b/sys/linux/init_iptables.go @@ -117,6 +117,9 @@ func (arch *arch) generateEbtables(g *prog.Gen, typ prog.Type, old prog.Arg) ( arg = old calls = g.MutateArg(arg) } + if g.Target().ArgContainsAny(arg) { + return + } hooksField, entriesField := 4, 7 if g.Target().PtrSize == 8 { // Account for paddings. @@ -155,6 +158,7 @@ func (arch *arch) generateEbtables(g *prog.Gen, typ prog.Type, old prog.Arg) ( } hookArg.Val = addr } + // TODO(dvyukov): assign jump targets for targets. return } -- cgit mrf-deployment