[PATCH v8 3/5] Add system-wide tunables: Apply tunables part
DJ Delorie
dj@redhat.com
Fri Jun 26 03:15:49 GMT 2026
Arjun Shankar <arjun@redhat.com> writes:
>> + if (ext.sections[cache_extension_tag_tunables].base
>> + + ext.sections[cache_extension_tag_tunables].size
>> + < (void *) & tec[count])
>> + return NULL;
>
> This could be exact, like the assert in patch #1.
Fixed.
>> + /* Validate each entry. */
>> + int s_start = (const char *) (&cache_new->libs[cache_new->nlibs]) - *data;
>> + int s_end = s_start + cache_new->len_strings;
>> + for (i = 0; i < count; i ++)
>> + {
>> + if (thc->tunables[i].name_offset < s_start
>> + || thc->tunables[i].name_offset >= s_end
>> + || thc->tunables[i].value_offset < s_start
>> + || thc->tunables[i].value_offset >= s_end)
>> + return NULL;
>> + }
>
> Offset validation. flag_offset can also be checked here (except when it's zero).
Added.
More information about the Libc-alpha
mailing list