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-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 pa

[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 mo

[PATCH] module: .strtab must be null terminated

2024-10-19 Thread Tobias Stoeckmann
The string table must be NUL-terminated, just like the section name table. Signed-off-by: Tobias Stoeckmann --- In order to create a proof of concept, which I can't get into a simple script right now, it's easiest to move '.strtab' to the end of the module file, write as ma