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

laundervictim source realm

Package laundervictim is the "victim" realm in the launder-game tests. It exposes a package-level g that an attacker ...

Overview

Package laundervictim is the "victim" realm in the launder-game tests. It exposes a package-level g that an attacker tries to mutate by various means. Two shapes are exposed:

  • gVal is `launderpkg.Object` (value type).
  • gPtr is `*launderpkg.Object` (pointer to a fresh Object).

Both are allocated at init under this realm's context, so their PkgID stamp is /r/.../laundervictim. The attacker's job is to make the stamp not match m.Realm at the write site — by laundering the stamp, capturing the value, or exploiting a borrow-rule shift.

Functions 10

func GetBuf

Action
1func GetBuf() []byte
source

GetBuf returns the victim's own byte buffer. The returned slice aliases the victim's persisted backing array (/r/laundervictim-stamped).

func GetImm

Action
1func GetImm() *launderpkg.Immutable
source

GetImm returns the pointer to gImm — a *Immutable, which has no mutator method in /p/launderpkg. Victim's intent: callers can read but not write.

func GetPtr

Action
1func GetPtr() *launderpkg.Object
source

GetPtr returns the pointer to gPtr's underlying Object. The returned pointer aliases the victim's persisted state.

func GetVal

Action
1func GetVal() launderpkg.Object
source

GetVal returns g by VALUE (caller gets a copy).

func GetValAddr

Action
1func GetValAddr() *launderpkg.Object
source

GetValAddr returns &gVal — a pointer to the value-typed slot. The returned pointer aliases the victim's persisted state.

func Invoke

Action
1func Invoke(e Exploiter)
source

Invoke calls the attacker's methods passing the victim's g by both value and by pointer.

func ReadVal

Action
1func ReadVal() string
source

ReadVal / ReadPtr / ReadImm / ReadBuf report the current values for after-attack verification.

Types 1

type Exploiter

interface
1type Exploiter interface {
2	Something(launderpkg.Object)
3	SomethingPtr(*launderpkg.Object)
4}
source

Exploiter is the interface the victim accepts. The attacker supplies an implementation; the victim invokes Something(g) passing its own g. This is the "victim hands attacker the data" vector.

Imports 1

Source Files 2