Re: [PATCH 07/27] gpu: nova-core: add optional ucodes firmware loading

John Hubbard <[email protected]>
Newsgroups dev.linux.lists.nova-gpu,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.