Re: [PATCH] module: check symbol name offsets

2024-10-21 Thread Luis Chamberlain
On Mon, Oct 21, 2024 at 10:20:38PM +0200, Tobias Stoeckmann wrote: > Hi Luis, > > On Mon, Oct 21, 2024 at 12:55:34PM -0700, Luis Chamberlain wrote: > > And then you can make a series with 3 patches for this and your prior one, > > and you can just refer to the PoC in the fix. > > Thanks for the h

Re: [PATCH] module: check symbol name offsets

2024-10-21 Thread Tobias Stoeckmann
Hi Luis, On Mon, Oct 21, 2024 at 12:55:34PM -0700, Luis Chamberlain wrote: > And then you can make a series with 3 patches for this and your prior one, > and you can just refer to the PoC in the fix. Thanks for the hint to rebase on modules-next. There is no need for my patches, because the check

Re: [PATCH] module: check symbol name offsets

2024-10-21 Thread Luis Chamberlain
On Sat, Oct 19, 2024 at 04:15:32PM +0200, Tobias Stoeckmann wrote: > It must be verified that the symbol name offsets point into the > string table, not outside of it. > > Signed-off-by: Tobias Stoeckmann > --- > Proof of Concept: > > 1. Create "poc.sh" > > ``` > cat > poc.sh << EOF > #!/bin/sh

Re: [PATCH] module: check symbol name offsets

2024-10-19 Thread Tobias Stoeckmann
On Sat, Oct 19, 2024 at 04:15:33PM +0200, Tobias Stoeckmann wrote: > + if (sym[i].st_name >= strhdr->sh_size) { Please note that this commit only makes sense being applied AFTER the other patch sent, i.e. "module: .strtab must be null terminated" because that patch modifies strhdr befo

[PATCH] module: check symbol name offsets

2024-10-19 Thread Tobias Stoeckmann
It must be verified that the symbol name offsets point into the string table, not outside of it. Signed-off-by: Tobias Stoeckmann --- Proof of Concept: 1. Create "poc.sh" ``` cat > poc.sh << EOF #!/bin/sh # Sets an illegal symbol name offset in supplied uncompressed module # usage: ./poc file.k