Subject: + drivers-misc-sgi-gru-grufaultc-fix-a-sanity-test-in-gru_set_context_option.patch added to -mm tree To: sivanich@xxxxxxx,dan.carpenter@xxxxxxxxxx,holt@xxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Fri, 31 May 2013 14:28:55 -0700 The patch titled Subject: drivers/misc/sgi-gru/grufault.c: fix a sanity test in gru_set_context_option() has been added to the -mm tree. Its filename is drivers-misc-sgi-gru-grufaultc-fix-a-sanity-test-in-gru_set_context_option.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Dimitri Sivanich <sivanich@xxxxxxx> Subject: drivers/misc/sgi-gru/grufault.c: fix a sanity test in gru_set_context_option() "req.val1 == -1" is valid but it doesn't make sense to check gru_base[-1]. gru_base[] is a global array. Signed-off-by: Dimitri Sivanich <sivanich@xxxxxxx> Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Cc: Robin Holt <holt@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/misc/sgi-gru/grufault.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN drivers/misc/sgi-gru/grufault.c~drivers-misc-sgi-gru-grufaultc-fix-a-sanity-test-in-gru_set_context_option drivers/misc/sgi-gru/grufault.c --- a/drivers/misc/sgi-gru/grufault.c~drivers-misc-sgi-gru-grufaultc-fix-a-sanity-test-in-gru_set_context_option +++ a/drivers/misc/sgi-gru/grufault.c @@ -876,8 +876,9 @@ int gru_set_context_option(unsigned long switch (req.op) { case sco_blade_chiplet: /* Select blade/chiplet for GRU context */ - if (req.val1 < -1 || req.val1 >= GRU_MAX_BLADES || !gru_base[req.val1] || - req.val0 < -1 || req.val0 >= GRU_CHIPLETS_PER_HUB) { + if (req.val0 < -1 || req.val0 >= GRU_CHIPLETS_PER_HUB || + req.val1 < -1 || req.val1 >= GRU_MAX_BLADES || + (req.val1 >= 0 && !gru_base[req.val1])) { ret = -EINVAL; } else { gts->ts_user_blade_id = req.val1; _ Patches currently in -mm which might be from sivanich@xxxxxxx are drivers-misc-sgi-gru-grufilec-fix-info-leak-in-gru_get_config_info.patch drivers-misc-sgi-gru-grufaultc-fix-a-sanity-test-in-gru_set_context_option.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html