From 5ba6cd305f8ce9c4e2e1539daa8856a6fd491733 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Apr 20 2023 11:00:09 +0000 Subject: bluetooth: btbcm: Fix logic error in forming the board name (bsc#1012628). --- diff --git a/patches.kernel.org/6.2.12-015-bluetooth-btbcm-Fix-logic-error-in-forming-the.patch b/patches.kernel.org/6.2.12-015-bluetooth-btbcm-Fix-logic-error-in-forming-the.patch new file mode 100644 index 0000000..ae60ab7 --- /dev/null +++ b/patches.kernel.org/6.2.12-015-bluetooth-btbcm-Fix-logic-error-in-forming-the.patch @@ -0,0 +1,38 @@ +From: Sasha Finkelstein +Date: Fri, 10 Mar 2023 11:28:42 +0100 +Subject: [PATCH] bluetooth: btbcm: Fix logic error in forming the board name. +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: b76abe4648c1acc791a207e7c08d1719eb9f4ea8 + +commit b76abe4648c1acc791a207e7c08d1719eb9f4ea8 upstream. + +This patch fixes an incorrect loop exit condition in code that replaces +'/' symbols in the board name. There might also be a memory corruption +issue here, but it is unlikely to be a real problem. + +Cc: +Signed-off-by: Sasha Finkelstein +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + drivers/bluetooth/btbcm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c +index 3006e2a0..43e98a59 100644 +--- a/drivers/bluetooth/btbcm.c ++++ b/drivers/bluetooth/btbcm.c +@@ -511,7 +511,7 @@ static const char *btbcm_get_board_name(struct device *dev) + len = strlen(tmp) + 1; + board_type = devm_kzalloc(dev, len, GFP_KERNEL); + strscpy(board_type, tmp, len); +- for (i = 0; i < board_type[i]; i++) { ++ for (i = 0; i < len; i++) { + if (board_type[i] == '/') + board_type[i] = '-'; + } +-- +2.35.3 + diff --git a/series.conf b/series.conf index c0cc8e8..8606d2e 100644 --- a/series.conf +++ b/series.conf @@ -2242,6 +2242,7 @@ patches.kernel.org/6.2.12-012-ALSA-hda-hdmi-disable-KAE-for-Intel-DG2.patch patches.kernel.org/6.2.12-013-Bluetooth-L2CAP-Fix-use-after-free-in-l2cap_di.patch patches.kernel.org/6.2.12-014-Bluetooth-Fix-race-condition-in-hidp_session_t.patch + patches.kernel.org/6.2.12-015-bluetooth-btbcm-Fix-logic-error-in-forming-the.patch ######################################################## # Build fixes that apply to the vanilla kernel too.