ida: Fix crash in ida_free when the bitmap is empty

[ Upstream commit af73483f4e8b6f5c68c9aa63257bdd929a9c194a ]

The IDA usually detects double-frees, but that detection failed to
consider the case when there are no nearby IDs allocated and so we have a
NULL bitmap rather than simply having a clear bit.  Add some tests to the
test-suite to be sure we don't inadvertently reintroduce this problem.
Unfortunately they're quite noisy so include a message to disregard
the warnings.

BUG=b/321923998
TEST=None
RELEASE_NOTE=Fixed CVE-2023-6915 in the linux kernel.

cos-patch: security-high
Reported-by: Zhenghan Wang <[email protected]>
Change-Id: Ia15d4168601427412efa7446451b428d09373316
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/64330
Tested-by: Cusky Presubmit Bot <[email protected]>
Reviewed-by: Oleksandr Tymoshenko <[email protected]>
2 files changed