From 666c8bb78e29b705480ed1457adf7879703f6b41 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 30 Nov 2023 02:35:25 +0000 Subject: drm/amdkfd: Fix shift out-of-bounds issue From Jesse Zhang 2806f880379232e789957c2078d612669eb7a69c in linux-6.1.y/6.1.64 282c1d793076c2edac6c3db51b7e8ed2b41d60a5 in mainline linux --- sys/dev/pci/drm/amd/amdkfd/kfd_svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/pci/drm/amd/amdkfd/kfd_svm.c') diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c b/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c index 6281d370bb4..208812512d8 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_svm.c @@ -764,7 +764,7 @@ svm_range_apply_attrs(struct kfd_process *p, struct svm_range *prange, prange->flags &= ~attrs[i].value; break; case KFD_IOCTL_SVM_ATTR_GRANULARITY: - prange->granularity = attrs[i].value; + prange->granularity = min_t(uint32_t, attrs[i].value, 0x3F); break; default: WARN_ONCE(1, "svm_range_check_attrs wasn't called?"); -- cgit v1.2.3