Page MenuHomeFreeBSD

hvsock: Use zfree(9) instead of non-standard bzero(3)
AcceptedPublic

Authored by freebsd_igalic.co on Mar 26 2024, 10:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 12, 5:28 PM
Unknown Object (File)
Wed, Aug 12, 5:28 PM
Unknown Object (File)
Wed, Aug 12, 5:28 PM
Unknown Object (File)
Sat, Aug 8, 11:50 AM
Unknown Object (File)
Fri, Aug 7, 4:22 AM
Unknown Object (File)
Thu, Aug 6, 1:33 PM
Unknown Object (File)
Tue, Aug 4, 2:49 AM
Unknown Object (File)
Mon, Aug 3, 1:59 AM
Subscribers

Details

Reviewers
glebius
whu
Summary

bzero(3) is a non-standard function.
instead of bzero(3)+free(9), use our equally non-standard zfree(9),
which does this in one go.

Sponsored by: FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56796
Build 53684: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 27 2024, 12:16 AM

P.S. It is worth documenting why do we want to zero it. What's special about info in this socket's pcb? Any idea?

zlei added inline comments.
sys/dev/hyperv/hvsock/hv_sock.c
387

I think the bzero() can be safely removed.
CC the author @whu .

sys/dev/hyperv/hvsock/hv_sock.c
387

Unless the pcb contains some sensitive information, e.g., private key, user credential, entropy etc.