Re: [PATCH] ARM: Ignore memory tags with invalid data

From: Corey Minyard
Date: Tue Jan 22 2008 - 09:34:29 EST


Ben Dooks wrote:
On Mon, Jan 21, 2008 at 10:05:56PM -0600, Corey Minyard wrote:
From: Corey Minyard <minyard@xxxxxxx>

The DNS-323 system has several bogus memory entries in the tag table,
and it caused the system to crash at startup. Ignore tag entries that
are obviously bogus.

This should have gone to the linux-arm-kernel mailing list as well,
so that all the people interested in ARM can see it as soon as
possible. See linux-arm-kernel@xxxxxxxxxxxxxxxxxxxxxx
You have to be a member to post, and I'm not a member. I guess I'll join, though it seems somewhat pointless for a single patch.

The only suggestion I could think of would to be change to having
an check_tag_mem32() function, or put each check on its own line
to make it easier to read what each check is doing.

ie:
if (meminfo.nr_banks >= NR_BANKS ||
tag->u.mem.size & ~PAGE_MASK || /* size is unaligned */
tag->u.mem.size == 0 || /* no memory here */
tag->u.mem.start & ~PAGE_MASK) /* start is unaligned */ {

(even without the comments it makes it easier to see what each test
is.
That's fine, it is easier to read.

Thanks,

-corey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/