All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Fix Ubsan error
@ 2016-03-30 16:59 Navin P.S
  2016-05-06  1:17 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Navin P.S @ 2016-03-30 16:59 UTC (permalink / raw)
  To: linux-ext4

Hi,
  This fixes bugs 114701 and 112161 at bugzilla.kernel.org
  It is caused due to left shift by a negative value which is undefined.
  Since these values are not used after a negative shift the change
  introduces a break.

Signed-off-by: Navin P.S <navinp1912@gmail.com>
---
 fs/ext4/mballoc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 50e05df..8ccfcf7 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1278,6 +1278,8 @@ static int mb_find_order_for_block(struct
ext4_buddy *e4b, int block)
  /* this block is part of buddy of order 'order' */
  return order;
  }
+ if (order > e4b->bd_blkbits)
+ break;
  bb += 1 << (e4b->bd_blkbits - order);
  order++;
  }
@@ -2616,6 +2618,8 @@ int ext4_mb_init(struct super_block *sb)
  do {
  sbi->s_mb_offsets[i] = offset;
  sbi->s_mb_maxs[i] = max;
+ if (i > sb->s_blocksize_bits)
+ break;
  offset += 1 << (sb->s_blocksize_bits - i);
  max = max >> 1;
  i++;
-- 
2.5.0

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

* Re: [PATCH 1/1] Fix Ubsan error
  2016-03-30 16:59 [PATCH 1/1] Fix Ubsan error Navin P.S
@ 2016-05-06  1:17 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-05-06  1:17 UTC (permalink / raw)
  To: Navin P.S; +Cc: linux-ext4

On Wed, Mar 30, 2016 at 10:29:55PM +0530, Navin P.S wrote:
> Hi,
>   This fixes bugs 114701 and 112161 at bugzilla.kernel.org
>   It is caused due to left shift by a negative value which is undefined.
>   Since these values are not used after a negative shift the change
>   introduces a break.
> 
> Signed-off-by: Navin P.S <navinp1912@gmail.com>

Thanks, I've applied

	http://patchwork.ozlabs.org/patch/599805/
	http://patchwork.ozlabs.org/patch/599804/

To address this problem.

					- Ted

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

end of thread, other threads:[~2016-05-06  1:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-30 16:59 [PATCH 1/1] Fix Ubsan error Navin P.S
2016-05-06  1:17 ` Theodore Ts'o

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.