]> git.baikalelectronics.ru Git - kernel.git/commit
dm: raid fix write_mostly arg validation
authorJonthan Brassow <jbrassow@redhat.com>
Sun, 25 Sep 2011 22:26:19 +0000 (23:26 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Sun, 25 Sep 2011 22:26:19 +0000 (23:26 +0100)
commit5aa0aaa7f54432055307f3120d1ae040d8e106ff
treed77436773e5c8a2274e1b0db507e5c251f225ecf
parent5f5a3efc9daa250737c0b524baa3259adba31459
dm: raid fix write_mostly arg validation

Fix off-by-one error in validation of write_mostly.

The user-supplied value given for the 'write_mostly' argument must be an
index starting at 0.  The validation of the supplied argument failed to
check for 'N' ('>' vs '>='), which would have caused an access beyond the
end of the array.

Reported-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-raid.c