Messages in this thread | | | Subject | Re: [PATCH net-next v2] net: bpf: make eBPF interpreter images read-only | From | Eric Dumazet <> | Date | Tue, 02 Sep 2014 14:40:59 -0700 |
| |
On Tue, 2014-09-02 at 14:31 -0700, Alexei Starovoitov wrote:
> > +static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) > > +{ > > + set_memory_rw((unsigned long)fp, fp->pages); > > why rw is needed? > since fp is allocated with vmalloc, vfree doesn't need > to touch the pages to free them, no?
That assumes that vmalloc() do not have any debugging features, like poisoning content before freeing, to catch some use after free.
Lets be clean and safe, and give back same memory permission we had after vmalloc()
| |