From: Ed Cashin Date: Fri, 5 Oct 2012 00:16:32 +0000 (-0700) Subject: aoe: disallow unsupported AoE minor addresses X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6583303c5e324a918ee1d57201acd9869f3be6da;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git aoe: disallow unsupported AoE minor addresses A guard is inserted to prevent AoE minor addresses (slot addresses) higher than 15 to be used, as they are not yet supported by the driver. There is a change coming that will allow the aoe driver to overcome this limit by using system device minor numbers dynamically, but until then, this guard prevents unexpected targets from being used by the driver when AoE targets with high minor numbers are on the AoE network. Signed-off-by: Ed Cashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index e3291dfa7607..2a6a4316db00 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1359,6 +1359,13 @@ aoecmd_cfg_rsp(struct sk_buff *skb) "Check shelf dip switches.\n"); return; } + if (h->minor >= NPERSHELF) { + pr_err("aoe: e%ld.%d %s, %d\n", + aoemajor, h->minor, + "slot number larger than the maximum", + NPERSHELF-1); + return; + } sysminor = SYSMINOR(aoemajor, h->minor); if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {