All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiunn Chang <c0d1n61at3@gmail.com>
To: skhan@linuxfoundation.org
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	oded.gabbay@gmail.com
Subject: [Linux-kernel-mentees][PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift
Date: Wed, 26 Jun 2019 22:25:31 -0500	[thread overview]
Message-ID: <20190627032532.18374-3-c0d1n61at3@gmail.com> (raw)
In-Reply-To: <20190627010137.5612-3-c0d1n61at3@gmail.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: c0d1n61at3 at gmail.com (Jiunn Chang)
Subject: [Linux-kernel-mentees] [PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift
Date: Wed, 26 Jun 2019 22:25:31 -0500	[thread overview]
Message-ID: <20190627032532.18374-3-c0d1n61at3@gmail.com> (raw)
In-Reply-To: <20190627010137.5612-3-c0d1n61at3@gmail.com>

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 at 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

WARNING: multiple messages have this Message-ID (diff)
From: c0d1n61at3@gmail.com (Jiunn Chang)
Subject: [Linux-kernel-mentees] [PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift
Date: Wed, 26 Jun 2019 22:25:31 -0500	[thread overview]
Message-ID: <20190627032532.18374-3-c0d1n61at3@gmail.com> (raw)
Message-ID: <20190627032531.OEZl-vSHiIPf7TtKJT6KKIA0blsEfmtNcjD8pZ3ikRg@z> (raw)
In-Reply-To: <20190627010137.5612-3-c0d1n61at3@gmail.com>

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 at 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

  parent reply	other threads:[~2019-06-27  3:25 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27  1:01 [Linux-kernel-mentees] [PATCH] uapi: linux: Fix undefined behavior in bit shift c0d1n61at3
2019-06-27  1:01 ` Jiunn Chang
2019-06-27  1:01 ` c0d1n61at3
2019-06-27  1:01   ` Jiunn Chang
2019-06-27  1:01 ` c0d1n61at3
2019-06-27  1:01   ` Jiunn Chang
2019-06-27  1:18   ` skhan
2019-06-27  1:18     ` Shuah Khan
2019-06-27  3:25   ` Jiunn Chang [this message]
2019-06-27  3:25     ` [Linux-kernel-mentees] [PATCH v2] drm/amdkfd: " Jiunn Chang
2019-06-27  3:25     ` c0d1n61at3
2019-06-27  3:33     ` [Linux-kernel-mentees][PATCH " Shuah Khan
2019-06-27  3:33       ` [Linux-kernel-mentees] [PATCH " Shuah Khan
2019-06-27  3:33       ` skhan
2019-06-27  5:04     ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang
2019-06-27  5:04       ` [Linux-kernel-mentees] [PATCH " Jiunn Chang
2019-06-27  5:04       ` c0d1n61at3
2019-06-27  1:01 ` [Linux-kernel-mentees] [PATCH] uapi: linux: " c0d1n61at3
2019-06-27  1:01   ` Jiunn Chang
2019-06-27  1:18   ` skhan
2019-06-27  1:18     ` Shuah Khan
2019-06-27  3:25   ` [Linux-kernel-mentees][PATCH v2] nl80211: " Jiunn Chang
2019-06-27  3:25     ` [Linux-kernel-mentees] [PATCH " Jiunn Chang
2019-06-27  3:25     ` c0d1n61at3
2019-06-27  3:34     ` [Linux-kernel-mentees][PATCH " Shuah Khan
2019-06-27  3:34       ` [Linux-kernel-mentees] [PATCH " Shuah Khan
2019-06-27  3:34       ` skhan
2019-06-28 13:57       ` [Linux-kernel-mentees][PATCH " Johannes Berg
2019-06-28 13:57         ` [Linux-kernel-mentees] [PATCH " Johannes Berg
2019-06-28 13:57         ` johannes
2019-06-28 15:04         ` [Linux-kernel-mentees][PATCH " Shuah Khan
2019-06-28 15:04           ` [Linux-kernel-mentees] [PATCH " Shuah Khan
2019-06-28 15:04           ` skhan
2019-06-28 15:17           ` [Linux-kernel-mentees][PATCH " Johannes Berg
2019-06-28 15:17             ` [Linux-kernel-mentees] [PATCH " Johannes Berg
2019-06-28 15:17             ` johannes
2019-06-28 15:27             ` [Linux-kernel-mentees][PATCH " Shuah Khan
2019-06-28 15:27               ` [Linux-kernel-mentees] [PATCH " Shuah Khan
2019-06-28 15:27               ` skhan
2019-07-04 18:34         ` [Linux-kernel-mentees][PATCH " Jiunn Chang
2019-07-04 18:34           ` [Linux-kernel-mentees] [PATCH " Jiunn Chang
2019-07-04 18:34           ` c0d1n61at3
2019-07-04 20:20           ` [Linux-kernel-mentees][PATCH " Johannes Berg
2019-07-04 20:20             ` [Linux-kernel-mentees] [PATCH " Johannes Berg
2019-07-04 20:20             ` johannes
2019-06-27  5:04     ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang
2019-06-27  5:04       ` [Linux-kernel-mentees] [PATCH " Jiunn Chang
2019-06-27  5:04       ` c0d1n61at3
2019-06-27  1:12 ` [Linux-kernel-mentees] [PATCH] uapi: linux: " skhan
2019-06-27  1:12   ` Shuah Khan
2019-06-27  3:25 ` [Linux-kernel-mentees][PATCH v2] packet: " Jiunn Chang
2019-06-27  3:25   ` [Linux-kernel-mentees] [PATCH " Jiunn Chang
2019-06-27  3:25   ` c0d1n61at3
2019-06-27  3:32   ` [Linux-kernel-mentees][PATCH " Shuah Khan
2019-06-27  3:32     ` [Linux-kernel-mentees] [PATCH " Shuah Khan
2019-06-27  3:32     ` skhan
2019-06-27 16:22     ` [Linux-kernel-mentees][PATCH " David Miller
2019-06-27 16:22       ` [Linux-kernel-mentees] [PATCH " David Miller
2019-06-27 16:22       ` davem
2019-06-27 16:52       ` [Linux-kernel-mentees][PATCH " Shuah Khan
2019-06-27 16:52         ` [Linux-kernel-mentees] [PATCH " Shuah Khan
2019-06-27 16:52         ` skhan
2019-06-27 17:05         ` [Linux-kernel-mentees][PATCH " Alexei Starovoitov
2019-06-27 17:05           ` [Linux-kernel-mentees] [PATCH " Alexei Starovoitov
2019-06-27 17:05           ` alexei.starovoitov
2019-06-27 17:08           ` [Linux-kernel-mentees][PATCH " Shuah Khan
2019-06-27 17:08             ` [Linux-kernel-mentees] [PATCH " Shuah Khan
2019-06-27 17:08             ` skhan
2019-06-27 16:57       ` [Linux-kernel-mentees][PATCH " Jiunn Chang
2019-06-27 16:57         ` [Linux-kernel-mentees] [PATCH " Jiunn Chang
2019-06-27 16:57         ` c0d1n61at3
2019-06-27 17:34         ` [Linux-kernel-mentees][PATCH " David Miller
2019-06-27 17:34           ` [Linux-kernel-mentees] [PATCH " David Miller
2019-06-27 17:34           ` davem
2019-06-27  5:04   ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang
2019-06-27  5:04     ` [Linux-kernel-mentees] [PATCH " Jiunn Chang
2019-06-27  5:04     ` c0d1n61at3
2019-06-29 18:06   ` [Linux-kernel-mentees][PATCH v2] " David Miller
2019-06-29 18:06     ` [Linux-kernel-mentees] [PATCH " David Miller
2019-06-29 18:06     ` davem

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190627032532.18374-3-c0d1n61at3@gmail.com \
    --to=c0d1n61at3@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oded.gabbay@gmail.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.