Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

launderrvictim state

Back to all declarations

Immutable

type

Immutable is /r/-declared (the key difference from /r/laundervictim, which uses /p/launderpkg.Immutable).

Value

launderrvictim.Immutable

GetImm

func() *launderrvictim.Immutable

GetImm hands out a pointer to gImm. Standard "victim exposes a pointer to its state" antipattern — but with /r/-declared data, the attacker should still be unable to write through it.

Open
OID
0fe33b…133c:6
GetImm details

Inspect func

ReadImm

func() string

ReadImm reads the current field for after-attack verification.

Open
OID
0fe33b…133c:7
ReadImm details

Inspect func

UseAnyMutator

func(m launderpkg.AnyMutator)

UseAnyMutator boxes gImm as any and dispatches a /p/-declared AnyMutator. This is the dangerous shape from Attack L: victim boxes its own /r/-declared data through a /p/-defined interface that the attacker can implement.

Open
OID
0fe33b…133c:8
UseAnyMutator details

Inspect func

ApplyHook

func(h func(...))

ApplyHook dispatches a caller-supplied callback on gImm. The callback's parameter type is /r/launderrvictim-declared, so /p/ packages can't supply this hook — only /r/ realms can.

Open
OID
0fe33b…133c:9
ApplyHook details

Inspect func

WithEmbed

type

WithEmbed embeds launderpkg.Immutable by VALUE (method promotion gives WithEmbed an .Apply method).

Value

launderrvictim.WithEmbed

WithPtr

type

WithPtr has a POINTER FIELD to launderpkg.Immutable.

Value

launderrvictim.WithPtr

WithVal

type

WithVal has a VALUE FIELD of launderpkg.Immutable (not embedded; the field is named, no method promotion — but the value is still addressable through c.Inner).

Value

launderrvictim.WithVal

GetWithEmbed

func() *launderrvictim.WithEmbed
Open
OID
0fe33b…133c:14
GetWithEmbed details

Inspect func

GetWithPtr

func() *launderrvictim.WithPtr
Open
OID
0fe33b…133c:15
GetWithPtr details

Inspect func

GetWithVal

func() *launderrvictim.WithVal
Open
OID
0fe33b…133c:16
GetWithVal details

Inspect func

WithBareEmbed

type

Value

launderrvictim.WithBareEmbed

WithBarePtr

type

Value

launderrvictim.WithBarePtr

WithBareVal

type

Value

launderrvictim.WithBareVal

gWithBareEmbed

*launderrvictim.WithBareEmbed
Open
OID
0fe33b…133c:82
gWithBareEmbed details

Inspect pointer

gWithBarePtr

*launderrvictim.WithBarePtr
Open
OID
0fe33b…133c:85
gWithBarePtr details

Inspect pointer

gWithBareVal

*launderrvictim.WithBareVal
Open
OID
0fe33b…133c:89
gWithBareVal details

Inspect pointer

GetWithBareEmbed

func() *launderrvictim.WithBareEmbed
Open
OID
0fe33b…133c:24
GetWithBareEmbed details

Inspect func

GetWithBarePtr

func() *launderrvictim.WithBarePtr
Open
OID
0fe33b…133c:25
GetWithBarePtr details

Inspect func

GetWithBareVal

func() *launderrvictim.WithBareVal
Open
OID
0fe33b…133c:26
GetWithBareVal details

Inspect func

ReadBareEmbed

func() string
Open
OID
0fe33b…133c:27
ReadBareEmbed details

Inspect func

gBareMap

map[string]launderpkg.Bare
Open
OID
0fe33b…133c:111
gBareMap details

Inspect map

gBarePtrMap

map[string]*launderpkg.Bare
Open
OID
0fe33b…133c:114
gBarePtrMap details

Inspect map

GetBareSlice

func() []launderpkg.Bare
Open
OID
0fe33b…133c:42
GetBareSlice details

Inspect func

GetBarePtrSlice

func() []*launderpkg.Bare
Open
OID
0fe33b…133c:43
GetBarePtrSlice details

Inspect func

GetBareArr

func() *[3]launderpkg.Bare
Open
OID
0fe33b…133c:44
GetBareArr details

Inspect func

GetBarePtrArr

func() *[3]*launderpkg.Bare
Open
OID
0fe33b…133c:45
GetBarePtrArr details

Inspect func

GetBareMap

func() map[string]launderpkg.Bare
Open
OID
0fe33b…133c:46
GetBareMap details

Inspect func

GetBarePtrMap

func() map[string]*launderpkg.Bare
Open
OID
0fe33b…133c:47
GetBarePtrMap details

Inspect func

ReadBareSlice0

func() string
Open
OID
0fe33b…133c:48
ReadBareSlice0 details

Inspect func

ReadBareSlice0Then1

func() string
Open
OID
0fe33b…133c:49
ReadBareSlice0Then1 details

Inspect func

ReadBarePtrSlice0

func() string
Open
OID
0fe33b…133c:50
ReadBarePtrSlice0 details

Inspect func

ReadBarePtrArr0

func() string
Open
OID
0fe33b…133c:52
ReadBarePtrArr0 details

Inspect func

ReadBarePtrMapA

func() string
Open
OID
0fe33b…133c:54
ReadBarePtrMapA details

Inspect func

DeferCallback

func(h func(...))

DeferCallback installs h as a defer inside an /r/launderrvictim frame, then returns. h runs at frame pop. The question: at the time h is invoked, m.Realm has just been restored to caller's realm by PopFrameAndReturn — but wait, defers run BEFORE PopFrameAndReturn. So m.Realm should still be victim's. Does the deferred h then run under victim authority?

Open
OID
0fe33b…133c:55
DeferCallback details

Inspect func

PanicAfterPushDefer

func(h func(...))

PanicAfterPushDefer pushes a defer and then panics, so the defer runs as part of panic unwinding. Tests that m.Realm is correctly borrowed when the defer body invokes a foreign function.

Open
OID
0fe33b…133c:56
PanicAfterPushDefer details

Inspect func

DeferApplyHook

func(h func(...))

DeferApplyHook defers an ApplyHook call. The deferred ApplyHook itself runs borrow rule #1 to /r/launderrvictim, and inside the callback runs as borrow rule #1 of the attacker's realm — the standard known-open Apply pattern, but now triggered via defer.

Open
OID
0fe33b…133c:57
DeferApplyHook details

Inspect func

RecoverAndRetry

func(h func(...)) recovered interface{...}

RecoverAndRetry: inside a victim method, defer a recover, write something to gImm, then panic. After the recover, the function returns normally. Tests that internal panic/recover doesn't leak state.

Open
OID
0fe33b…133c:58
RecoverAndRetry details

Inspect func

CallThenPanic

func(h func(...))

CallThenPanic invokes h synchronously and then panics. If h is attacker-supplied and writes via captured pointer, this is just a re-shape of ApplyHook.

Open
OID
0fe33b…133c:59
CallThenPanic details

Inspect func

CallPDeferApply

func(fn func(...))

CallPDeferApply: multi-level defer chain. Victim invokes a /p/-method (DeferApply) on a victim-owned \*launderpkg.Immutable; the /p/-method defers the attacker callback. Three frames at callback time: attacker.main → victim.CallPDeferApply → /p/.DeferApply (deferred fn dispatches here).

Open
OID
0fe33b…133c:60
CallPDeferApply details

Inspect func

ImmHook

type

Value

launderrvictim.ImmHook

gHooks

[]launderrvictim.ImmHook

Value

<zero>

RegisterHook

func(h launderrvictim.ImmHook)
Open
OID
0fe33b…133c:62
RegisterHook details

Inspect func

PlainHook

type

Value

launderrvictim.PlainHook

gPlainHooks

[]launderrvictim.PlainHook

Value

<zero>

RegisterPlainHook

func(h launderrvictim.PlainHook)
Open
OID
0fe33b…133c:65
RegisterPlainHook details

Inspect func

MakeWriterClosure

func(value string) func(...)

MakeWriterClosure constructs a /r/-victim-declared closure that captures gImm and writes through it. The closure body is /r/-victim- declared, so borrow rule #1 fires at invocation → m.Realm = /r/-victim → write commits with victim authority. Returning this closure to an attacker is "consenting to write" by the victim.

Open
OID
0fe33b…133c:68
MakeWriterClosure details

Inspect func

MakeApplyTrampoline

func() func(...)

MakeApplyTrampoline returns a closure that captures &gImm.Field indirectly: it captures \*Immutable, and dispatches a caller-supplied callback fn on it. /r/-victim-declared body → borrow rule #1 → m.Realm = /r/-victim. If \`fn\` is /p/-declared (e.g. EvilWrite), it inherits victim authority. This is "victim returns a closure that's itself an Apply-style trampoline" — a packaged Apply.

Open
OID
0fe33b…133c:69
MakeApplyTrampoline details

Inspect func
Immutable : type =launderrvictim.Immutable
gImm : *launderrvictim.Immutable Inspect
init.2 : func() Inspect
GetImm : func() *launderrvictim.Immutable Inspect
ReadImm : func() string Inspect
UseAnyMutator : func(m launderpkg.AnyMutator) Inspect
ApplyHook : func(h func(...)) Inspect
WithEmbed : type =launderrvictim.WithEmbed
WithPtr : type =launderrvictim.WithPtr
WithVal : type =launderrvictim.WithVal
gWithEmbed : *launderrvictim.WithEmbed Inspect
gWithPtr : *launderrvictim.WithPtr Inspect
gWithVal : *launderrvictim.WithVal Inspect
init.13 : func() Inspect
GetWithEmbed : func() *launderrvictim.WithEmbed Inspect
GetWithPtr : func() *launderrvictim.WithPtr Inspect
GetWithVal : func() *launderrvictim.WithVal Inspect
ReadEmbed : func() string Inspect
ReadPtr : func() string Inspect
ReadVal : func() string Inspect
WithBareEmbed : type =launderrvictim.WithBareEmbed
WithBarePtr : type =launderrvictim.WithBarePtr
WithBareVal : type =launderrvictim.WithBareVal
gWithBareEmbed : *launderrvictim.WithBareEmbed Inspect
gWithBarePtr : *launderrvictim.WithBarePtr Inspect
gWithBareVal : *launderrvictim.WithBareVal Inspect
init.26 : func() Inspect
GetWithBareEmbed : func() *launderrvictim.WithBareEmbed Inspect
GetWithBarePtr : func() *launderrvictim.WithBarePtr Inspect
GetWithBareVal : func() *launderrvictim.WithBareVal Inspect
ReadBareEmbed : func() string Inspect
ReadBarePtr : func() string Inspect
ReadBareVal : func() string Inspect
gBareSlice : []launderpkg.Bare (len=2) Inspect
gBarePtrSlice : []*launderpkg.Bare (len=2) Inspect
gBareArr : [3]launderpkg.Bare Inspect
gBarePtrArr : [3]*launderpkg.Bare Inspect
gBareMap : map[string]launderpkg.Bare Inspect
gBarePtrMap : map[string]*launderpkg.Bare Inspect
init.39 : func() Inspect
GetBareSlice : func() []launderpkg.Bare Inspect
GetBarePtrSlice : func() []*launderpkg.Bare Inspect
GetBareArr : func() *[3]launderpkg.Bare Inspect
GetBarePtrArr : func() *[3]*launderpkg.Bare Inspect
GetBareMap : func() map[string]launderpkg.Bare Inspect
GetBarePtrMap : func() map[string]*launderpkg.Bare Inspect
ReadBareSlice0 : func() string Inspect
ReadBareSlice0Then1 : func() string Inspect
ReadBarePtrSlice0 : func() string Inspect
ReadBareArr0 : func() string Inspect
ReadBarePtrArr0 : func() string Inspect
ReadBareMapA : func() string Inspect
ReadBarePtrMapA : func() string Inspect
DeferCallback : func(h func(...)) Inspect
PanicAfterPushDefer : func(h func(...)) Inspect
DeferApplyHook : func(h func(...)) Inspect
RecoverAndRetry : func(h func(...)) recovered interface{...} Inspect
CallThenPanic : func(h func(...)) Inspect
CallPDeferApply : func(fn func(...)) Inspect
ImmHook : type =launderrvictim.ImmHook
gHooks : []launderrvictim.ImmHook =<zero>
RegisterHook : func(h launderrvictim.ImmHook) Inspect
RunHooks : func() Inspect
PlainHook : type =launderrvictim.PlainHook
gPlainHooks : []launderrvictim.PlainHook =<zero>
RegisterPlainHook : func(h launderrvictim.PlainHook) Inspect
RunPlainHooks : func() Inspect
ClearHooks : func() Inspect
MakeWriterClosure : func(value string) func(...) Inspect
MakeApplyTrampoline : func() func(...) Inspect