Page MenuHomeFreeBSD

Fix integer truncation bug in malloc(9)
ClosedPublic

Authored by rstone on Mar 21 2015, 12:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 10, 8:40 AM
Unknown Object (File)
Tue, Jan 7, 6:33 PM
Unknown Object (File)
Jan 1 2025, 1:47 AM
Unknown Object (File)
Dec 14 2024, 4:22 PM
Unknown Object (File)
Dec 12 2024, 2:06 AM
Unknown Object (File)
Dec 2 2024, 12:29 AM
Unknown Object (File)
Nov 27 2024, 12:40 AM
Unknown Object (File)
Nov 23 2024, 9:12 AM
Subscribers

Details

Summary

A couple of internal functions used by malloc(9) and uma truncated
a size_t down to an int. This could cause any number of issues
(e.g. indefinite sleeps, memory corruption) if any kernel
subsystem tried to allocate 2GB or more through malloc. zfs would
attempt such an allocation when run on a system with 2TB or more
of RAM.

Note to self: When this is MFCed, sparc64 needs the same fix.

Reported by: Michael Fuckner <michael@fuckner.net>
Tested by: Michael Fuckner <michael@fuckner.net>
MFC after: 2 weeks

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

rstone retitled this revision from to Fix integer truncation bug in malloc(9).
rstone edited the test plan for this revision. (Show Details)
rstone updated this object.

This patch looks fine. I don't see any reason not to commit it.

kib added a reviewer: kib.
kib added a subscriber: kib.

I used the previous version of the patch on the same 3Tb machine.

This revision is now accepted and ready to land.Mar 28 2015, 11:47 PM
rstone updated this revision to Diff 4572.

Closed by commit rS280957 (authored by @rstone).