On Sun, Nov 29, 2020, at 23:22, Alexei Starovoitov wrote: > On Sun, Nov 29, 2020 at 10:38 AM Markus Ongyerth <bpf@xxxxxxxx> wrote: > > > > Hi, > > > > I've been looking into introspecting and possibly convincing an application to behave slightly different with bpf measures. > > > > I found `bpf_probe_user_write` but as far as I can tell, that only works for memory areas. > > Is there an alternative that can be used on registers as well? > > fyi bpf_probe_write_user() warns in dmesg. I've seen the note about that. I don't really mind, since it's not spammy but once when the code is loaded. > That was done on purpose to avoid usage of this helper in production code. > A new helper can be added to adjust user regs, but it will have similar warning. > It's better to discuss the use case first. > Do you envision user regs to be changed after uprobe in an arbitrary location > or in some fixed place and only particular regs? My current usecase needs to be able to set PT_REGS_PARM2 and PT_REG_PARM4 I think in specific function entry uprobes to modify an argument usually passed in a register by ABI. And that's what I'd use for playing around with things in general I think. Arbitrary registers at arbitrary points sounds like fund but also way more dangerous.