Re: [PATCH] module: .strtab must be null terminated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	strhdr = &info->sechdrs[info->index.str];
> +	if (strhdr->sh_size > 0 && info->strtab[strhdr->sh_size - 1] != '\0') {
> +		pr_err("module %s: string table isn't null terminated\n",
> +		       info->name ?: "(missing .modinfo section or name field)");
> +		goto no_exec;
> +	}

Reviewed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>

The _very_ correct test is "there must be NUL between last index used
and the end of the section somewhere".

.shstrtab has the same overly restrictive test:

	if (info->secstrings[strhdr->sh_size - 1] != '\0') {

But, of course, it doesn't matter in practice.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux