From ba9f4cd6dee9770bb6fc0e0a0dca74c53c2b7b43 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 23 May 2024 14:08:58 +0200 Subject: [PATCH] 6.1-stable patches added patches: arm64-atomics-lse-remove-stale-dependency-on-jump_label.patch drm-amdgpu-fix-possible-null-dereference-in-amdgpu_ras_query_error_status_helper.patch --- ...emove-stale-dependency-on-jump_label.patch | 55 +++++++++++++++++++ ...amdgpu_ras_query_error_status_helper.patch | 47 ++++++++++++++++ queue-6.1/series | 2 + 3 files changed, 104 insertions(+) create mode 100644 queue-6.1/arm64-atomics-lse-remove-stale-dependency-on-jump_label.patch create mode 100644 queue-6.1/drm-amdgpu-fix-possible-null-dereference-in-amdgpu_ras_query_error_status_helper.patch diff --git a/queue-6.1/arm64-atomics-lse-remove-stale-dependency-on-jump_label.patch b/queue-6.1/arm64-atomics-lse-remove-stale-dependency-on-jump_label.patch new file mode 100644 index 00000000000..220a782a9aa --- /dev/null +++ b/queue-6.1/arm64-atomics-lse-remove-stale-dependency-on-jump_label.patch @@ -0,0 +1,55 @@ +From 657eef0a5420a02c02945ed8c87f2ddcbd255772 Mon Sep 17 00:00:00 2001 +From: Mark Rutland +Date: Mon, 14 Nov 2022 12:54:24 +0000 +Subject: arm64: atomics: lse: remove stale dependency on JUMP_LABEL + +From: Mark Rutland + +commit 657eef0a5420a02c02945ed8c87f2ddcbd255772 upstream. + +Currently CONFIG_ARM64_USE_LSE_ATOMICS depends upon CONFIG_JUMP_LABEL, +as the inline atomics were indirected with a static branch. + +However, since commit: + + 21fb26bfb01ffe0d ("arm64: alternatives: add alternative_has_feature_*()") + +... we use an alternative_branch (which is always available) rather than +a static branch, and hence the dependency is unnecessary. + +Remove the stale dependency, along with the stale include. This will +allow the use of LSE atomics in kernels built with CONFIG_JUMP_LABEL=n, +and reduces the risk of circular header dependencies via . + +Signed-off-by: Mark Rutland +Cc: Catalin Marinas +Cc: Will Deacon +Link: https://lore.kernel.org/r/20221114125424.2998268-1-mark.rutland@arm.com +Signed-off-by: Will Deacon +Signed-off-by: Oleksandr Tymoshenko +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/Kconfig | 1 - + arch/arm64/include/asm/lse.h | 1 - + 2 files changed, 2 deletions(-) + +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -1752,7 +1752,6 @@ config ARM64_LSE_ATOMICS + + config ARM64_USE_LSE_ATOMICS + bool "Atomic instructions" +- depends on JUMP_LABEL + default y + help + As part of the Large System Extensions, ARMv8.1 introduces new +--- a/arch/arm64/include/asm/lse.h ++++ b/arch/arm64/include/asm/lse.h +@@ -10,7 +10,6 @@ + + #include + #include +-#include + #include + #include + #include diff --git a/queue-6.1/drm-amdgpu-fix-possible-null-dereference-in-amdgpu_ras_query_error_status_helper.patch b/queue-6.1/drm-amdgpu-fix-possible-null-dereference-in-amdgpu_ras_query_error_status_helper.patch new file mode 100644 index 00000000000..f99674b7bcc --- /dev/null +++ b/queue-6.1/drm-amdgpu-fix-possible-null-dereference-in-amdgpu_ras_query_error_status_helper.patch @@ -0,0 +1,47 @@ +From b8d55a90fd55b767c25687747e2b24abd1ef8680 Mon Sep 17 00:00:00 2001 +From: Srinivasan Shanmugam +Date: Tue, 26 Dec 2023 15:32:19 +0530 +Subject: drm/amdgpu: Fix possible NULL dereference in amdgpu_ras_query_error_status_helper() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Srinivasan Shanmugam + +commit b8d55a90fd55b767c25687747e2b24abd1ef8680 upstream. + +Return invalid error code -EINVAL for invalid block id. + +Fixes the below: + +drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1183 amdgpu_ras_query_error_status_helper() error: we previously assumed 'info' could be null (see line 1176) + +Suggested-by: Hawking Zhang +Cc: Tao Zhou +Cc: Hawking Zhang +Cc: Christian König +Cc: Alex Deucher +Signed-off-by: Srinivasan Shanmugam +Reviewed-by: Hawking Zhang +Signed-off-by: Alex Deucher +[Ajay: applied AMDGPU_RAS_BLOCK_COUNT condition to amdgpu_ras_query_error_status() + as amdgpu_ras_query_error_status_helper() not present in v6.6, v6.1 + amdgpu_ras_query_error_status_helper() was introduced in 8cc0f5669eb6] +Signed-off-by: Ajay Kaher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +@@ -974,6 +974,9 @@ int amdgpu_ras_query_error_status(struct + if (!obj) + return -EINVAL; + ++ if (!info || info->head.block == AMDGPU_RAS_BLOCK_COUNT) ++ return -EINVAL; ++ + if (info->head.block == AMDGPU_RAS_BLOCK__UMC) { + amdgpu_ras_get_ecc_info(adev, &err_data); + } else { diff --git a/queue-6.1/series b/queue-6.1/series index 1538bc3e5dd..ece6675853c 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -31,3 +31,5 @@ xfs-allow-inode-inactivation-during-a-ro-mount-log-recovery.patch xfs-fix-log-recovery-when-unknown-rocompat-bits-are-set.patch xfs-get-root-inode-correctly-at-bulkstat.patch xfs-short-circuit-xfs_growfs_data_private-if-delta-is-zero.patch +arm64-atomics-lse-remove-stale-dependency-on-jump_label.patch +drm-amdgpu-fix-possible-null-dereference-in-amdgpu_ras_query_error_status_helper.patch -- 2.47.3