Immutable
typeImmutable is /r/-declared (the key difference from /r/laundervictim, which uses /p/launderpkg.Immutable).
Value
launderrvictim.Immutable
gImm
*launderrvictim.Immutable- OID
- 0fe33b…133c:70
gImm details
init.2
func()- OID
- 0fe33b…133c:4
init.2 details
GetImm
func() *launderrvictim.ImmutableGetImm 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.
- OID
- 0fe33b…133c:6
GetImm details
ReadImm
func() stringReadImm reads the current field for after-attack verification.
- OID
- 0fe33b…133c:7
ReadImm details
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.
- OID
- 0fe33b…133c:8
UseAnyMutator details
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.
- OID
- 0fe33b…133c:9
ApplyHook details
WithEmbed
typeWithEmbed embeds launderpkg.Immutable by VALUE (method promotion gives WithEmbed an .Apply method).
Value
launderrvictim.WithEmbed
WithPtr
typeWithPtr has a POINTER FIELD to launderpkg.Immutable.
Value
launderrvictim.WithPtr
WithVal
typeWithVal 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
gWithEmbed
*launderrvictim.WithEmbed- OID
- 0fe33b…133c:72
gWithEmbed details
gWithPtr
*launderrvictim.WithPtr- OID
- 0fe33b…133c:75
gWithPtr details
gWithVal
*launderrvictim.WithVal- OID
- 0fe33b…133c:79
gWithVal details
init.13
func()- OID
- 0fe33b…133c:13
init.13 details
GetWithEmbed
func() *launderrvictim.WithEmbed- OID
- 0fe33b…133c:14
GetWithEmbed details
GetWithPtr
func() *launderrvictim.WithPtr- OID
- 0fe33b…133c:15
GetWithPtr details
GetWithVal
func() *launderrvictim.WithVal- OID
- 0fe33b…133c:16
GetWithVal details
ReadEmbed
func() string- OID
- 0fe33b…133c:17
ReadEmbed details
ReadPtr
func() string- OID
- 0fe33b…133c:18
ReadPtr details
ReadVal
func() string- OID
- 0fe33b…133c:19
ReadVal details
WithBareEmbed
typeValue
launderrvictim.WithBareEmbed
WithBarePtr
typeValue
launderrvictim.WithBarePtr
WithBareVal
typeValue
launderrvictim.WithBareVal
gWithBareEmbed
*launderrvictim.WithBareEmbed- OID
- 0fe33b…133c:82
gWithBareEmbed details
gWithBarePtr
*launderrvictim.WithBarePtr- OID
- 0fe33b…133c:85
gWithBarePtr details
gWithBareVal
*launderrvictim.WithBareVal- OID
- 0fe33b…133c:89
gWithBareVal details
init.26
func()- OID
- 0fe33b…133c:23
init.26 details
GetWithBareEmbed
func() *launderrvictim.WithBareEmbed- OID
- 0fe33b…133c:24
GetWithBareEmbed details
GetWithBarePtr
func() *launderrvictim.WithBarePtr- OID
- 0fe33b…133c:25
GetWithBarePtr details
GetWithBareVal
func() *launderrvictim.WithBareVal- OID
- 0fe33b…133c:26
GetWithBareVal details
ReadBareEmbed
func() string- OID
- 0fe33b…133c:27
ReadBareEmbed details
ReadBarePtr
func() string- OID
- 0fe33b…133c:28
ReadBarePtr details
ReadBareVal
func() string- OID
- 0fe33b…133c:29
ReadBareVal details
gBareSlice
[]launderpkg.Bare- OID
- 0fe33b…133c:92
gBareSlice details
gBarePtrSlice
[]*launderpkg.Bare- OID
- 0fe33b…133c:95
gBarePtrSlice details
gBareArr
[3]launderpkg.Bare- OID
- 0fe33b…133c:100
gBareArr details
gBarePtrArr
[3]*launderpkg.Bare- OID
- 0fe33b…133c:104
gBarePtrArr details
gBareMap
map[string]launderpkg.Bare- OID
- 0fe33b…133c:111
gBareMap details
gBarePtrMap
map[string]*launderpkg.Bare- OID
- 0fe33b…133c:114
gBarePtrMap details
init.39
func()- OID
- 0fe33b…133c:41
init.39 details
GetBareSlice
func() []launderpkg.Bare- OID
- 0fe33b…133c:42
GetBareSlice details
GetBarePtrSlice
func() []*launderpkg.Bare- OID
- 0fe33b…133c:43
GetBarePtrSlice details
GetBareArr
func() *[3]launderpkg.Bare- OID
- 0fe33b…133c:44
GetBareArr details
GetBarePtrArr
func() *[3]*launderpkg.Bare- OID
- 0fe33b…133c:45
GetBarePtrArr details
GetBareMap
func() map[string]launderpkg.Bare- OID
- 0fe33b…133c:46
GetBareMap details
GetBarePtrMap
func() map[string]*launderpkg.Bare- OID
- 0fe33b…133c:47
GetBarePtrMap details
ReadBareSlice0
func() string- OID
- 0fe33b…133c:48
ReadBareSlice0 details
ReadBareSlice0Then1
func() string- OID
- 0fe33b…133c:49
ReadBareSlice0Then1 details
ReadBarePtrSlice0
func() string- OID
- 0fe33b…133c:50
ReadBarePtrSlice0 details
ReadBareArr0
func() string- OID
- 0fe33b…133c:51
ReadBareArr0 details
ReadBarePtrArr0
func() string- OID
- 0fe33b…133c:52
ReadBarePtrArr0 details
ReadBareMapA
func() string- OID
- 0fe33b…133c:53
ReadBareMapA details
ReadBarePtrMapA
func() string- OID
- 0fe33b…133c:54
ReadBarePtrMapA details
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?
- OID
- 0fe33b…133c:55
DeferCallback details
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.
- OID
- 0fe33b…133c:56
PanicAfterPushDefer details
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.
- OID
- 0fe33b…133c:57
DeferApplyHook details
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.
- OID
- 0fe33b…133c:58
RecoverAndRetry details
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.
- OID
- 0fe33b…133c:59
CallThenPanic details
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).
- OID
- 0fe33b…133c:60
CallPDeferApply details
ImmHook
typeValue
launderrvictim.ImmHook
gHooks
[]launderrvictim.ImmHookValue
<zero>
RegisterHook
func(h launderrvictim.ImmHook)- OID
- 0fe33b…133c:62
RegisterHook details
RunHooks
func()- OID
- 0fe33b…133c:63
RunHooks details
PlainHook
typeValue
launderrvictim.PlainHook
gPlainHooks
[]launderrvictim.PlainHookValue
<zero>
RegisterPlainHook
func(h launderrvictim.PlainHook)- OID
- 0fe33b…133c:65
RegisterPlainHook details
RunPlainHooks
func()- OID
- 0fe33b…133c:66
RunPlainHooks details
ClearHooks
func()- OID
- 0fe33b…133c:67
ClearHooks details
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.
- OID
- 0fe33b…133c:68
MakeWriterClosure details
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.
- OID
- 0fe33b…133c:69