Page MenuHomeFreeBSD

Fix several leaks of kernel stack data through paddings.
ClosedPublic

Authored by kib on Mar 27 2018, 4:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 30, 6:21 AM
Unknown Object (File)
Nov 27 2024, 2:31 AM
Unknown Object (File)
Nov 21 2024, 9:06 AM
Unknown Object (File)
Nov 19 2024, 5:01 AM
Unknown Object (File)
Nov 13 2024, 8:38 PM
Unknown Object (File)
Nov 11 2024, 9:14 AM
Unknown Object (File)
Nov 11 2024, 7:39 AM
Unknown Object (File)
Oct 1 2024, 4:30 PM
Subscribers

Details

Summary

It is random collection of fixes for issues not yet corrected, reported at https://tsyrklevi.ch/clang_analyzer/freebsd_013017/. Many issues there were already corrected. Most of them are for compat32, old compat32 or affect both primary host ABI and compat32.

The freebsd32_kldstat(), for instance, was already fixed by using malloc(M_ZERO). Patch includes correction to report the supplied version back, which is just pedantic.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 15826

Event Timeline

While bzero is most typical in the kernel, there is some argument for using memset here in that the compiler will likely eliminate it in favor of explicitly zeroing the pads and other untouched regions. I know bde doesn't like this idea and performance doesn't matter here so I have no strong view.

This revision is now accepted and ready to land.Mar 27 2018, 4:28 PM

I agree with brooks - I have a small preference for memset, and have used it in the similar cases I've addressed in the tree.

FWIW today there are more instances of memset than bzero in the kernel.

3494 memset
3273 bzero

3316 bzero\( (adds explicit_bzero and a few others)
2998 memset with non-zero (often 0xff) memsets excluded
3582 memset\(.*, 0, (cases like dm_memset)

This revision was automatically updated to reflect the committed changes.