Commit 4ea4b5e4 authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by liwei
Browse files

greybus: lights: check return of get_channel_from_mode

mainline inclusion
from mainline-v6.10-rc1
commit a1ba19a1ae7cd1e324685ded4ab563e78fe68648
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA7D18
CVE: CVE-2024-38637

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a1ba19a1ae7cd1e324685ded4ab563e78fe68648

--------------------------------

If channel for the given node is not found we return null from
get_channel_from_mode. Make sure we validate the return pointer
before using it in two of the missing places.

This was originally reported in [0]:
Found by Linux Verification Center (linuxtesting.org) with SVACE.

[0] https://lore.kernel.org/all/20240301190425.120605-1-m.lobanov@rosalinux.ru



Fixes: 2870b52b ("greybus: lights: add lights implementation")
Reported-by: default avatarMikhail Lobanov <m.lobanov@rosalinux.ru>
Suggested-by: default avatarMikhail Lobanov <m.lobanov@rosalinux.ru>
Suggested-by: default avatarAlex Elder <elder@ieee.org>
Signed-off-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Link: https://lore.kernel.org/r/20240325221549.2185265-1-rmfrfs@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatardengquan <dengquan9@huawei.com>
parent 393e79c0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment