Page MenuHomeFreeBSD

Potential integer overflowing expression
ClosedPublic

Authored by bret_ketchum_dell.com on Aug 21 2020, 11:37 AM.
Tags
None
Referenced Files
F132754835: D26141.id.diff
Sun, Oct 19, 4:22 PM
F132754831: D26141.id76053.diff
Sun, Oct 19, 4:22 PM
F132754830: D26141.id76055.diff
Sun, Oct 19, 4:22 PM
Unknown Object (File)
Sun, Oct 19, 2:04 AM
Unknown Object (File)
Sep 5 2025, 1:34 AM
Unknown Object (File)
Sep 5 2025, 1:33 AM
Unknown Object (File)
Sep 5 2025, 1:12 AM
Unknown Object (File)
Sep 5 2025, 1:11 AM
Subscribers

Details

Summary

Coverity has identified the line in this change as "Potential integer overflowing expression" due to the variable i declared as an int and used in an expression with vm_paddr_t, a 64bit variable.

This change has very little effect as when this line is execute nkpt is small and phys_addr is a the beginning of physical memory. But there is no explicit protection that the above is true.

Test Plan

A kernel with this change boots reliably.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
sys/amd64/amd64/pmap.c
2114 ↗(On Diff #76053)

Per style(9) there should be no space in (vm_paddr_t)i.

This revision is now accepted and ready to land.Aug 21 2020, 1:56 PM