Re: [PATCH] module: Harden STRICT_MODULE_RWX

From: Peter Zijlstra
Date: Mon Apr 06 2020 - 10:11:39 EST


On Mon, Apr 06, 2020 at 02:53:37PM +0200, Jessica Yu wrote:

> > > > > > + for (i = 0; i < hdr->e_shnum; i++) {
> > > > > > + if (sechdrs[i].sh_flags & (SHF_EXECINSTR|SHF_WRITE))
> > > > > > + return -ENOEXEC;

Hehe, I'm well familiar with the brain going funny, as evidenced by the
above... :facepalm:

> Ugh sorry, my brain shorted out and for some reason I mistakenly
> thought the check excluded SHF_WRITE|SHF_EXECINSTR|SHF_ALLOC sections.
> It doesn't obviously. Sorry for the noise.