Patch "pinctrl: single: fix potential NULL dereference" has been added to the 5.10-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

    pinctrl: single: fix potential NULL dereference

to the 5.10-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:
     pinctrl-single-fix-potential-null-dereference.patch
and it can be found in the queue-5.10 subdirectory.

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



commit bac93c5cd626b6f44ed3e3e788e5bef921734208
Author: Maxim Korotkov <korotkov.maxim.s@xxxxxxxxx>
Date:   Fri Nov 18 13:43:32 2022 +0300

    pinctrl: single: fix potential NULL dereference
    
    [ Upstream commit d2d73e6d4822140445ad4a7b1c6091e0f5fe703b ]
    
    Added checking of pointer "function" in pcs_set_mux().
    pinmux_generic_get_function() can return NULL and the pointer
    "function" was dereferenced without checking against NULL.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 571aec4df5b7 ("pinctrl: single: Use generic pinmux helpers for managing functions")
    Signed-off-by: Maxim Korotkov <korotkov.maxim.s@xxxxxxxxx>
    Reviewed-by: Tony Lindgren <tony@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221118104332.943-1-korotkov.maxim.s@xxxxxxxxx
    Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index d139cd9e6d130..22e471933b373 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -372,6 +372,8 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, unsigned fselector,
 	if (!pcs->fmask)
 		return 0;
 	function = pinmux_generic_get_function(pctldev, fselector);
+	if (!function)
+		return -EINVAL;
 	func = function->data;
 	if (!func)
 		return -EINVAL;



[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