All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] binfmt_elf: fix unsigned regset0_size compared to less than zero
@ 2020-07-27 17:40 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2020-07-27 17:40 UTC (permalink / raw)
  To: Alexander Viro, linux-fsdevel; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable regset0_size is an unsigned int and it is being checked
for an error by checking if it is less than zero, and hence this
check is always going to be false.  Fix this by making the variable
regset0_size signed.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 0f17865d8847 ("introduction of regset ->get() wrappers, switching ELF coredumps to those")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/binfmt_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 6a171a28bdf7..13d053982dd7 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1821,7 +1821,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
 				 long signr, size_t *total)
 {
 	unsigned int i;
-	unsigned int regset0_size;
+	int regset0_size;
 
 	/*
 	 * NT_PRSTATUS is the one special case, because the regset data
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH][next] binfmt_elf: fix unsigned regset0_size compared to less than zero
@ 2020-07-27 17:40 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2020-07-27 17:40 UTC (permalink / raw)
  To: Alexander Viro, linux-fsdevel; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable regset0_size is an unsigned int and it is being checked
for an error by checking if it is less than zero, and hence this
check is always going to be false.  Fix this by making the variable
regset0_size signed.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 0f17865d8847 ("introduction of regset ->get() wrappers, switching ELF coredumps to those")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/binfmt_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 6a171a28bdf7..13d053982dd7 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1821,7 +1821,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
 				 long signr, size_t *total)
 {
 	unsigned int i;
-	unsigned int regset0_size;
+	int regset0_size;
 
 	/*
 	 * NT_PRSTATUS is the one special case, because the regset data
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH][next] binfmt_elf: fix unsigned regset0_size compared to less than zero
  2020-07-27 17:40 ` Colin King
@ 2020-07-27 18:43   ` Al Viro
  -1 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2020-07-27 18:43 UTC (permalink / raw)
  To: Colin King; +Cc: linux-fsdevel, kernel-janitors, linux-kernel

On Mon, Jul 27, 2020 at 06:40:54PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable regset0_size is an unsigned int and it is being checked
> for an error by checking if it is less than zero, and hence this
> check is always going to be false.  Fix this by making the variable
> regset0_size signed.

Folded and pushed...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][next] binfmt_elf: fix unsigned regset0_size compared to less than zero
@ 2020-07-27 18:43   ` Al Viro
  0 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2020-07-27 18:43 UTC (permalink / raw)
  To: Colin King; +Cc: linux-fsdevel, kernel-janitors, linux-kernel

On Mon, Jul 27, 2020 at 06:40:54PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable regset0_size is an unsigned int and it is being checked
> for an error by checking if it is less than zero, and hence this
> check is always going to be false.  Fix this by making the variable
> regset0_size signed.

Folded and pushed...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-27 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 17:40 [PATCH][next] binfmt_elf: fix unsigned regset0_size compared to less than zero Colin King
2020-07-27 17:40 ` Colin King
2020-07-27 18:43 ` Al Viro
2020-07-27 18:43   ` Al Viro

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.