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, Apr 15, 11:10 AM
Unknown Object (File)
Sat, Apr 11, 7:26 PM
Unknown Object (File)
Sat, Apr 11, 10:16 AM
Unknown Object (File)
Tue, Apr 7, 10:51 AM
Unknown Object (File)
Mon, Apr 6, 10:11 PM
Unknown Object (File)
Sun, Apr 5, 4:15 PM
Unknown Object (File)
Thu, Apr 2, 3:15 PM
Unknown Object (File)
Feb 27 2026, 2:44 PM
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.