Re: [PATCH 07/27] gpu: nova-core: add optional ucodes firmware loading
From: John Hubbard
Date: Wed Aug 19 2026 - 22:22:24 EST
On 8/19/26 10:55 AM, Timur Tabi wrote:
> On Tue, 2026-08-18 at 20:52 -0700, John Hubbard wrote:
>> + if file.is_empty()
>> + || matches!(file, "." | "..")
>> + || file
>> + .bytes()
>> + .any(|b| b == b'/' || b == b'\\' || b.is_ascii_control())
>> + {
>> + return Err(EINVAL);
>> + }
>
> I'm not sure if this is needed because request_into_buf() will reject any crazy filename that
> would result from an invalid FILE tag.
OK, mostly yes. I'll simplify the checks down to just looking for empty,
".", "..", or "/".
>
>> +
>> + let size = usize::from_safe_cast(self.get_u32(b"SIZE")?);
>> + if size == 0 {
>> + return Err(EINVAL); // TODO: Use ENODATA once available.
>> + }
>
> FYI, ENODATA is already in linux-next.
>
OK, I'll just cherry pick it into my branch as a prerequisite, for v2,
and use ENODATA here and get rid of that TODO.
thanks,
--
John Hubbard