[PATCH] firmware: arm_ffa: Fix NULL dereference in ffa_partition_info_get()

Sudeep Holla sudeep.holla at kernel.org
Wed Jun 17 02:06:13 PDT 2026


On Tue, Jun 16, 2026 at 02:14:59PM -0700, Unnathi Chalicheemala wrote:
> On 6/12/2026 3:55 AM, Sudeep Holla wrote:
> > 
> >> Per the FF-A spec, the all-zeros UUID is the defined wildcard that
> >> instructs the SPMC to return information for all partitions. Map NULL
> >> and empty string to uuid_null rather than crashing in uuid_parse(),
> >> preserving the intended "return all partitions" semantics for callers
> >> that pass NULL.
> >>
> > 
> > Agreed on the spec part but not w.r.t the interface. Where is the driver
> > using this call and why is it sending null or wants to extract all the
> > partition information ?
> > 
> 
> A developer wanting all partitions might reasonably pass the all-zeros string
> "00000000-0000-0000-0000-000000000000"?

I understand that and the core driver does exactly this when initialising
to enumerate all the partitions on the system. But you didn't answer my
question as where is the FF-A client driver pass NULL ? You just expressed
the possibility here.


[...]

> > I object to make it uuid_null. Below check is enough to check NULL
> > dereference.
> > 
> > -       if (uuid_parse(uuid_str, &uuid)) {
> > +       if (!uuid_str || uuid_parse(uuid_str, &uuid)) {
> > 
> > 
> > I don't think we need to service NULL as valid argument via this interface
> > as the callee driver needs to pass its partition UUID here.
> > 
> I agree with you, NULL doesn't seem like a valid use case.
> 
> Will send another version with your suggestion, thank you for the review.
> 

Thanks!

-- 
Regards,
Sudeep



More information about the linux-arm-kernel mailing list