linux/drivers/md
Andy Isaacson bed31ed9e1 [PATCH] fix read past end of array in md/linear.c
When iterating through an array, one must be careful to test one's index
variable rather than another similarly-named variable.

The loop will read off the end of conf->disks[] in the following
(pathological) case:

  % dd bs=1 seek=840716287 if=/dev/zero of=d1 count=1
  % for i in 2 3 4; do dd if=/dev/zero of=d$i bs=1k count=$(($i+150)); done
  % ./vmlinux ubd0=root ubd1=d1 ubd2=d2 ubd3=d3 ubd4=d4
  # mdadm -C /dev/md0 --level=linear --raid-devices=4 /dev/ubd[1234]

adding some printks, I saw this:

  [42949374.960000] hash_spacing = 821120
  [42949374.960000] cnt          = 4
  [42949374.960000] min_spacing  = 801
  [42949374.960000] j=0 size=820928 sz=820928
  [42949374.960000] i=0 sz=820928 hash_spacing=820928
  [42949374.960000] j=1 size=64 sz=64
  [42949374.960000] j=2 size=64 sz=128
  [42949374.960000] j=3 size=64 sz=192
  [42949374.960000] j=4 size=1515870810 sz=1515871002

Cc: Gautham R Shenoy <ego@in.ibm.com>
Acked-by: Neil Brown <neilb@cse.unsw.edu.au>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-16 19:25:03 -07:00
..
raid6test [PATCH] RAID6 Altivec fix 2005-09-17 11:49:58 -07:00
.gitignore gitignore: misc files 2006-01-01 22:21:50 +01:00
bitmap.c [PATCH] remove invalidate_inode_pages() 2007-02-11 10:51:31 -08:00
dm-bio-list.h [PATCH] dm: suspend: add noflush pushback 2006-12-08 08:29:09 -08:00
dm-bio-record.h
dm-crypt.c [PATCH] dm: map and endio symbolic return codes 2006-12-08 08:29:09 -08:00
dm-emc.c [PATCH] struct path: rename DM's struct path 2006-12-08 08:28:40 -08:00
dm-exception-store.c [PATCH] dm snapshot: fix metadata writing when suspending 2006-10-03 08:04:14 -07:00
dm-hw-handler.c BUG_ON() Conversion in md/dm-hw-handler.c 2006-03-24 18:36:27 +01:00
dm-hw-handler.h [PATCH] struct path: rename DM's struct path 2006-12-08 08:28:40 -08:00
dm-io.c [PATCH] dm io: fix bi_max_vecs 2006-12-08 08:29:08 -08:00
dm-io.h [PATCH] device-mapper: remove unused definition 2006-01-06 08:34:00 -08:00
dm-ioctl.c [PATCH] mark struct file_operations const 4 2007-02-12 09:48:45 -08:00
dm-linear.c [PATCH] dm: map and endio symbolic return codes 2006-12-08 08:29:09 -08:00
dm-log.c [PATCH] dm: raid1: reset sync_search on resume 2006-12-08 08:29:09 -08:00
dm-log.h [PATCH] dm: log: rename complete_resync_work 2006-12-08 08:29:09 -08:00
dm-mpath.c [PATCH] dm: mpath: use noflush suspending 2006-12-08 08:29:09 -08:00
dm-mpath.h [PATCH] struct path: rename DM's struct path 2006-12-08 08:28:40 -08:00
dm-path-selector.c BUG_ON() Conversion in md/dm-path-selector.c 2006-03-26 18:21:58 +02:00
dm-path-selector.h [PATCH] struct path: rename DM's struct path 2006-12-08 08:28:40 -08:00
dm-raid1.c [PATCH] dm: log: rename complete_resync_work 2006-12-08 08:29:09 -08:00
dm-round-robin.c [PATCH] struct path: rename DM's struct path 2006-12-08 08:28:40 -08:00
dm-snap.c [PATCH] make drivers/md/dm-snap.c:ksnapd static 2006-12-08 08:29:09 -08:00
dm-snap.h [PATCH] dm snapshot: add workqueue 2006-10-03 08:04:14 -07:00
dm-stripe.c [PATCH] dm: map and endio symbolic return codes 2006-12-08 08:29:09 -08:00
dm-table.c [PATCH] dm table: add target flush 2006-10-03 08:04:16 -07:00
dm-target.c [PATCH] dm: improve error message consistency 2006-06-26 09:58:36 -07:00
dm-zero.c [PATCH] dm: map and endio symbolic return codes 2006-12-08 08:29:09 -08:00
dm.c [PATCH] dm-multipath: fix stall on noflush suspend/resume 2007-01-26 13:51:00 -08:00
dm.h [PATCH] dm: suspend: add noflush pushback 2006-12-08 08:29:09 -08:00
faulty.c [PATCH] md: Don't assume that READ==0 and WRITE==1 - use the names explicitly 2006-12-13 09:05:48 -08:00
Kconfig [CRYPTO] dm-crypt: Select CRYPTO_CBC 2006-12-10 10:18:57 -08:00
kcopyd.c [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
kcopyd.h
linear.c [PATCH] fix read past end of array in md/linear.c 2007-03-16 19:25:03 -07:00
Makefile [PATCH] md: merge raid5 and raid6 code 2006-06-26 09:58:37 -07:00
md.c [PATCH] md: restart a (raid5) reshape that has been aborted due to a read/write error 2007-03-01 14:53:36 -08:00
mktables.c
multipath.c [PATCH] md: fix up maintenance of ->degraded in multipath 2006-10-28 11:30:51 -07:00
raid0.c [PATCH] md: define backing_dev_info.congested_fn for raid0 and linear 2006-10-03 08:04:18 -07:00
raid1.c [PATCH] md: fix potential memalloc deadlock in md 2007-01-26 13:51:00 -08:00
raid5.c [PATCH] md: fix for raid6 reshape 2007-03-05 07:57:53 -08:00
raid6.h [PATCH] RAID6 Altivec fix 2005-09-17 11:49:58 -07:00
raid6algos.c [PATCH] drivers/md/raid6algos.c: fix a NULL dereference 2006-06-23 07:43:08 -07:00
raid6altivec.uc [PATCH] RAID6 Altivec fix 2005-09-17 11:49:58 -07:00
raid6int.uc
raid6mmx.c [PATCH] md: RAID6: clean up CPUID and FPU enter/exit code 2007-03-01 14:53:36 -08:00
raid6recov.c
raid6sse1.c [PATCH] md: RAID6: clean up CPUID and FPU enter/exit code 2007-03-01 14:53:36 -08:00
raid6sse2.c [PATCH] md: RAID6: clean up CPUID and FPU enter/exit code 2007-03-01 14:53:36 -08:00
raid6x86.h [PATCH] md: RAID6: clean up CPUID and FPU enter/exit code 2007-03-01 14:53:36 -08:00
raid10.c [PATCH] md: fix raid10 recovery problem. 2007-03-01 14:53:36 -08:00
unroll.pl
xor.c