Kees Cook ab62ef82ea ntfs: mft: remove VLA usage
In the quest to remove all stack VLA usage from the kernel[1], this
allocates the maximum size stack buffer.  Existing checks already
require that blocksize >= NTFS_BLOCK_SIZE and mft_record_size <=
PAGE_SIZE, so max_bhs can be at most PAGE_SIZE / NTFS_BLOCK_SIZE.
Sanity checks are added for robustness.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

Link: http://lkml.kernel.org/r/20180626172909.41453-4-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Anton Altaparmakov <anton@tuxera.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-17 16:20:27 -07:00
..
2018-08-17 16:20:27 -07:00
2005-04-16 15:20:36 -07:00
2018-08-17 16:20:27 -07:00
2014-10-09 22:25:46 -04:00
2014-04-07 16:35:49 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2015-06-23 18:01:59 -04:00
2009-01-22 13:15:55 +03:00
2011-03-31 11:26:23 -03:00
2015-06-24 17:49:38 -07:00
2018-08-17 16:20:27 -07:00
2005-04-16 15:20:36 -07:00
2016-01-22 18:04:28 -05:00
2011-03-31 11:26:23 -03:00
2006-12-07 08:39:23 -08:00
2008-05-24 09:56:08 -07:00