diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-11-30 02:35:25 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-11-30 02:35:25 +0000 |
commit | 666c8bb78e29b705480ed1457adf7879703f6b41 (patch) | |
tree | b2614535e69e932fda40797acf7ae2aa7847d2ef /sys/dev/pci/drm/amd/amdkfd/kfd_svm.c | |
parent | f4114b4dbc792aec936fb61b29f6b58f8e6a12ec (diff) |
drm/amdkfd: Fix shift out-of-bounds issue
From Jesse Zhang
2806f880379232e789957c2078d612669eb7a69c in linux-6.1.y/6.1.64
282c1d793076c2edac6c3db51b7e8ed2b41d60a5 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/amd/amdkfd/kfd_svm.c')
-rw-r--r-- | sys/dev/pci/drm/amd/amdkfd/kfd_svm.c | 2 |
1 files changed, 1 insertions, 1 deletions
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?"); |