Patch "interconnect: Treat xlate() returning NULL node as an error" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    interconnect: Treat xlate() returning NULL node as an error

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     interconnect-treat-xlate-returning-null-node-as-an-e.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0d1a358b99b1c7c3f82479a1ac697a9d176f6c8d
Author: Mike Tipton <quic_mdtipton@xxxxxxxxxxx>
Date:   Wed Oct 25 07:58:29 2023 -0700

    interconnect: Treat xlate() returning NULL node as an error
    
    [ Upstream commit ad2ab1297d0c80899125a842bb7a078abfe1e6ce ]
    
    Currently, if provider->xlate() or provider->xlate_extended()
    "successfully" return a NULL node, then of_icc_get_from_provider() won't
    consider that an error and will successfully return the NULL node. This
    bypasses error handling in of_icc_get_by_index() and leads to NULL
    dereferences in path_find().
    
    This could be avoided by ensuring provider callbacks always return an
    error for NULL nodes, but it's better to explicitly protect against this
    in the common framework.
    
    Fixes: 87e3031b6fbd ("interconnect: Allow endpoints translation via DT")
    Signed-off-by: Mike Tipton <quic_mdtipton@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231025145829.11603-1-quic_mdtipton@xxxxxxxxxxx
    Signed-off-by: Georgi Djakov <djakov@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 0c6fc954e7296..1d9494f64a215 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -381,6 +381,9 @@ struct icc_node_data *of_icc_get_from_provider(struct of_phandle_args *spec)
 	}
 	mutex_unlock(&icc_lock);
 
+	if (!node)
+		return ERR_PTR(-EINVAL);
+
 	if (IS_ERR(node))
 		return ERR_CAST(node);
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux