Another comment: ERR_BAD_FS might be a better fit given how it can be
triggered.

Regards

Le sam. 17 mai 2025, 14:09, Vladimir 'phcoder' Serbinenko <phco...@gmail.com>
a écrit :

>
> Small comment, otherwise looks good
>
> Le sam. 17 mai 2025, 04:26, Andrew Hamilton <adham...@gmail.com> a écrit :
>
>> Avoid attempting to defererence a NULL pointer to call read_symlink when
>> the given filesystem does not provide a read_symlink function. This could
>> be triggered if the calling filesystem had a file marked as a symlink.
>> This appears possible for HFS and was observed during fuzzing of NTFS.
>>
>> Signed-off-by: Andrew Hamilton <adham...@gmail.com>
>> ---
>>  grub-core/fs/fshelp.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/grub-core/fs/fshelp.c b/grub-core/fs/fshelp.c
>> index cb41934b4..a9d24a908 100644
>> --- a/grub-core/fs/fshelp.c
>> +++ b/grub-core/fs/fshelp.c
>> @@ -226,7 +226,10 @@ find_file (char *currpath,
>>             return grub_error (GRUB_ERR_SYMLINK_LOOP,
>>                                N_("too deep nesting of symlinks"));
>>
>> -         symlink = read_symlink (ctx->currnode->node);
>> +         if (read_symlink != NULL)
>> +           symlink = read_symlink (ctx->currnode->node);
>> +         else
>> +           return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("read_symlink is
>> NULL"));
>>
>
> Not worth translating. Otherwise
> Reviewed-by: Vladimir Serbinenko <phco...@gmail.com>
>
>>
>>           if (!symlink)
>>             return grub_errno;
>> --
>> 2.39.5
>>
>>
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to