summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2014-03-07 15:24:10 (GMT)
committerBrian Norris <computersforpeace@gmail.com>2014-04-18 05:22:03 (GMT)
commitbe54f8f1c76890f4b6163715aed5a3d0a7309dc2 (patch)
treeb03c93620bb5f5dcd65b34b779a24fccfa9b8ed5 /security
parentd66d3519c6732db3b4dea2f0c31c514633e89001 (diff)
downloadlinux-be54f8f1c76890f4b6163715aed5a3d0a7309dc2.tar.xz
mtd: mtd_oobtest: generate consistent data for verification
mtd_oobtest writes OOB, read it back and verify. The verification is not correctly done if oobsize is not multiple of 4. Although the data to be written and the data to be compared are generated by several prandom_byte_state() calls starting with the same seed, these two are generated with the different size and different number of calls. Due to the implementation of prandom_byte_state() if the size on each call is not multiple of 4, the resulting data is not always same. This fixes it by just calling prandom_byte_state() once and using correct range instead of calling it multiple times for each. Reported-by: George Cherian <george.cherian@ti.com> Reported-by: Lothar Waßmann <LW@KARO-electronics.de> Tested-by: Lothar Waßmann <LW@KARO-electronics.de> Cc: George Cherian <george.cherian@ti.com> Cc: Lothar Waßmann <LW@KARO-electronics.de> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Lee Jones <lee.jones@linaro.org> Cc: linux-mtd@lists.infradead.org Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions