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
F163220325: D44518.diff
Tue, Jul 21, 4:29 AM
Unknown Object (File)
Mon, Jul 20, 12:26 AM
Unknown Object (File)
Sat, Jul 18, 4:10 PM
Unknown Object (File)
Sat, Jul 18, 7:39 AM
Unknown Object (File)
Sun, Jul 5, 2:35 AM
Unknown Object (File)
Fri, Jun 26, 6:17 PM
Unknown Object (File)
Thu, Jun 25, 4:21 AM
Unknown Object (File)
Sun, Jun 21, 11:23 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.