DragonFlyBSD Kernel Audit
← triage · dashboard
DF-2312

I2CRDWR: no upper-bound validation on nmsgs allows massive kernel allocations (DoS)

Summary

I2CRDWR handler performs no validation on d->nmsgs (uint32_t fully user-controlled). Values up to UINT32_MAX cause kmalloc of up to ~64GB (16*nmsgs for msgs array) and ~32GB (8*nmsgs for usrbufs) with M_WAITOK. These allocations can exhaust kernel memory or hang calling thread indefinitely as allocator waits for memory that will never become available. No integer overflow on LP64 (16*UINT32_MAX < 2^36) but allocation itself unbounded.

Discussion (0)

No comments yet.