https://github.com/torvalds/linux
Revision 86aea56f14929ff1c05eca1776e9068e907429d5 authored by Christos Gkekas on 08 July 2017, 19:50:21 UTC, committed by John Johansen on 22 September 2017, 20:00:57 UTC
verify_header() is currently checking whether interface version is less
than 5 *and* greater than 7, which always evaluates to false. Instead it
should check whether it is less than 5 *or* greater than 7.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 19fe43a
Raw File
Tip revision: 86aea56f14929ff1c05eca1776e9068e907429d5 authored by Christos Gkekas on 08 July 2017, 19:50:21 UTC
apparmor: Fix logical error in verify_header()
Tip revision: 86aea56
check_signature.c
#include <linux/io.h>
#include <linux/export.h>

/**
 *	check_signature		-	find BIOS signatures
 *	@io_addr: mmio address to check
 *	@signature:  signature block
 *	@length: length of signature
 *
 *	Perform a signature comparison with the mmio address io_addr. This
 *	address should have been obtained by ioremap.
 *	Returns 1 on a match.
 */

int check_signature(const volatile void __iomem *io_addr,
			const unsigned char *signature, int length)
{
	while (length--) {
		if (readb(io_addr) != *signature)
			return 0;
		io_addr++;
		signature++;
	}
	return 1;
}
EXPORT_SYMBOL(check_signature);
back to top