From: Marc Zyngier Date: Fri, 21 Jun 2013 11:06:55 +0000 (+0100) Subject: ARM: 7768/1: prevent risks of out-of-bound access in ASID allocator X-Git-Tag: omap-for-v3.11/fixes-for-merge-window~41^2~1^3~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8e4a4740fa2b17c0a447b3ab783b3dc10702e27;p=pandora-kernel.git ARM: 7768/1: prevent risks of out-of-bound access in ASID allocator On a CPU that never ran anything, both the active and reserved ASID fields are set to zero. In this case the ASID_TO_IDX() macro will return -1, which is not a very useful value to index a bitmap. Instead of trying to offset the ASID so that ASID #1 is actually bit 0 in the asid_map bitmap, just always ignore bit 0 and start the search from bit 1. This makes the code a bit more readable, and without risk of OoB access. Cc: # 3.9 Acked-by: Will Deacon Acked-by: Catalin Marinas Reported-by: Catalin Marinas Signed-off-by: Marc Zyngier Signed-off-by: Russell King --- Reading git-diff-tree failed