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)
Thu, Nov 21, 9:06 AM
Unknown Object (File)
Tue, Nov 19, 5:01 AM
Unknown Object (File)
Wed, Nov 13, 8:38 PM
Unknown Object (File)
Mon, Nov 11, 9:14 AM
Unknown Object (File)
Mon, Nov 11, 7:39 AM
Unknown Object (File)
Oct 1 2024, 4:30 PM
Unknown Object (File)
Sep 26 2024, 9:09 AM
Unknown Object (File)
Sep 24 2024, 6:04 AM
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 Not Applicable
Unit
Tests Not Applicable

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.