* [Linux-kernel-mentees][PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift [not found] <20190627010137.5612-3-c0d1n61at3@gmail.com> @ 2019-06-27 3:25 ` Jiunn Chang 2019-06-27 3:33 ` Shuah Khan 2019-06-27 5:04 ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang 0 siblings, 2 replies; 3+ messages in thread From: Jiunn Chang @ 2019-06-27 3:25 UTC (permalink / raw) To: skhan; +Cc: linux-kernel-mentees, dri-devel, linux-kernel, oded.gabbay Shifting signed 32-bit value by 31 bits is undefined. Changing most significant bit to unsigned. Changes included in v2: - use subsystem specific subject lines - CC required mailing lists Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com> --- include/uapi/linux/kfd_ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index dc067ed0b72d..ae5669272303 100644 --- a/include/uapi/linux/kfd_ioctl.h +++ b/include/uapi/linux/kfd_ioctl.h @@ -339,7 +339,7 @@ struct kfd_ioctl_acquire_vm_args { #define KFD_IOC_ALLOC_MEM_FLAGS_USERPTR (1 << 2) #define KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL (1 << 3) /* Allocation flags: attributes/access options */ -#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1 << 31) +#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1U << 31) #define KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE (1 << 30) #define KFD_IOC_ALLOC_MEM_FLAGS_PUBLIC (1 << 29) #define KFD_IOC_ALLOC_MEM_FLAGS_NO_SUBSTITUTE (1 << 28) -- 2.22.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Linux-kernel-mentees][PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift 2019-06-27 3:25 ` [Linux-kernel-mentees][PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift Jiunn Chang @ 2019-06-27 3:33 ` Shuah Khan 2019-06-27 5:04 ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang 1 sibling, 0 replies; 3+ messages in thread From: Shuah Khan @ 2019-06-27 3:33 UTC (permalink / raw) To: Jiunn Chang Cc: linux-kernel-mentees, dri-devel, linux-kernel, oded.gabbay, skh >> Shuah Khan On 6/26/19 9:25 PM, Jiunn Chang wrote: > Shifting signed 32-bit value by 31 bits is undefined. Changing most > significant bit to unsigned. > > Changes included in v2: > - use subsystem specific subject lines > - CC required mailing lists > > Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com> > --- Move version change lines here. > include/uapi/linux/kfd_ioctl.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h > index dc067ed0b72d..ae5669272303 100644 > --- a/include/uapi/linux/kfd_ioctl.h > +++ b/include/uapi/linux/kfd_ioctl.h > @@ -339,7 +339,7 @@ struct kfd_ioctl_acquire_vm_args { > #define KFD_IOC_ALLOC_MEM_FLAGS_USERPTR (1 << 2) > #define KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL (1 << 3) > /* Allocation flags: attributes/access options */ > -#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1 << 31) > +#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1U << 31) > #define KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE (1 << 30) > #define KFD_IOC_ALLOC_MEM_FLAGS_PUBLIC (1 << 29) > #define KFD_IOC_ALLOC_MEM_FLAGS_NO_SUBSTITUTE (1 << 28) > thanks, -- Shuah ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Linux-kernel-mentees][PATCH v3] drm/amdkfd: Fix undefined behavior in bit shift 2019-06-27 3:25 ` [Linux-kernel-mentees][PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift Jiunn Chang 2019-06-27 3:33 ` Shuah Khan @ 2019-06-27 5:04 ` Jiunn Chang 1 sibling, 0 replies; 3+ messages in thread From: Jiunn Chang @ 2019-06-27 5:04 UTC (permalink / raw) To: skhan; +Cc: linux-kernel-mentees, dri-devel, linux-kernel, oded.gabbay Shifting signed 32-bit value by 31 bits is undefined. Changing most significant bit to unsigned. Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com> --- Changes included in v3: - remove change log from patch description Changes included in v2: - use subsystem specific subject lines - CC required mailing lists include/uapi/linux/kfd_ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index dc067ed0b72d..ae5669272303 100644 --- a/include/uapi/linux/kfd_ioctl.h +++ b/include/uapi/linux/kfd_ioctl.h @@ -339,7 +339,7 @@ struct kfd_ioctl_acquire_vm_args { #define KFD_IOC_ALLOC_MEM_FLAGS_USERPTR (1 << 2) #define KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL (1 << 3) /* Allocation flags: attributes/access options */ -#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1 << 31) +#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1U << 31) #define KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE (1 << 30) #define KFD_IOC_ALLOC_MEM_FLAGS_PUBLIC (1 << 29) #define KFD_IOC_ALLOC_MEM_FLAGS_NO_SUBSTITUTE (1 << 28) -- 2.22.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-27 5:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20190627010137.5612-3-c0d1n61at3@gmail.com>
2019-06-27 3:25 ` [Linux-kernel-mentees][PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift Jiunn Chang
2019-06-27 3:33 ` Shuah Khan
2019-06-27 5:04 ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox