diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2020-11-17 16:38:11 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2020-11-17 16:38:11 +0000 |
commit | 7b664158ee91610dffefd9c018d68a311f386908 (patch) | |
tree | cee1c6fce7fb0b3a350e20a16f83cbd344e92317 /sys/arch | |
parent | 2c0851cc1e672d235c5cbe16f36bde8cb4020b86 (diff) |
Avoid accidental truncation of large memory segments.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/loongson/loongson/machdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index fc04f842f80..13475b282dc 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.92 2020/11/17 16:33:44 visa Exp $ */ +/* $OpenBSD: machdep.c,v 1.93 2020/11/17 16:38:10 visa Exp $ */ /* * Copyright (c) 2009, 2010, 2014 Miodrag Vallat. @@ -391,7 +391,7 @@ loongson_efi_setup(void) entry.type != PMON_MEM_SYSTEM_HIGH)) continue; fp = atop(entry.address); - lp = atop(entry.address + (entry.size << 20)); + lp = atop(entry.address + ((uint64_t)entry.size << 20)); if (lp > atop(pfn_to_pad(PG_FRAME)) + 1) lp = atop(pfn_to_pad(PG_FRAME)) + 1; if (fp >= lp) |