Bug 277655 - random() scheduled to be removed for 15.0-RELEASE
Summary: random() scheduled to be removed for 15.0-RELEASE
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-12 20:16 UTC by Henrich Hartzer
Modified: 2024-06-08 04:58 UTC (History)
2 users (show)

See Also:


Attachments
sys/netinet/cc switch from random() to prng32() (3.03 KB, patch)
2024-03-18 21:20 UTC, Henrich Hartzer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henrich Hartzer 2024-03-12 20:16:57 UTC
I see random() mentioned in man pages and /usr/include/sys/libkern.h on 14.0-RELEASE. It was slated for removal with 14.0-RELEASE. However, it looks like it was not removed.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2024-03-17 14:08:58 UTC
Where did you see that it would be removed?
Comment 3 Ed Maste freebsd_committer freebsd_triage 2024-03-18 20:03:29 UTC
oh, random(9), not random(3)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-03-18 20:04:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f50322c1dcfe369ad73e1123541d18fc431384f6

commit f50322c1dcfe369ad73e1123541d18fc431384f6
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-03-18 20:02:08 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-03-18 20:03:49 +0000

    random(9): bump removal to FreeBSD 15.0

    It has not yet been removed, and still has some in-tree consumers.

    PR:             277655
    Sponsored by:   The FreeBSD Foundation

 share/man/man9/random.9 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 5 Henrich Hartzer 2024-03-18 20:10:15 UTC
Thank you! Is there another issue tracking what consumers still exist?
Comment 6 Ed Maste freebsd_committer freebsd_triage 2024-03-18 20:19:40 UTC
There is no other issue for tracking that I'm aware of.

A grep turns up instances in:

sys/contrib/libsodium/src/libsodium/randombytes/randombytes.c
sys/contrib/openzfs/tests/zfs-tests/cmd/btree_test.c
sys/contrib/openzfs/tests/zfs-tests/cmd/file/file_trunc.c
sys/contrib/openzfs/tests/zfs-tests/cmd/readmmap.c
sys/contrib/openzfs/tests/zfs-tests/cmd/rm_lnkcnt_zero_file.c
sys/contrib/openzfs/tests/zfs-tests/cmd/xattrtest.c
sys/dev/al_eth/al_eth.c
sys/dev/bce/if_bcereg.h
sys/dev/hpt27xx/hpt27xx_os_bsd.c
sys/dev/hptmv/entry.c
sys/dev/hptnr/hptnr_os_bsd.c
sys/dev/hptrr/hptrr_os_bsd.c
sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c
sys/dev/mlx5/mlx5_core/mlx5_vsc.c
sys/dev/random/unit_test.c
sys/dev/syscons/dragon/dragon_saver.c
sys/dev/syscons/fire/fire_saver.c
sys/dev/syscons/plasma/plasma_saver.c
sys/dev/syscons/rain/rain_saver.c
sys/dev/syscons/snake/snake_saver.c
sys/dev/syscons/star/star_saver.c
sys/dev/syscons/warp/warp_saver.c
sys/geom/multipath/g_multipath.c
sys/kern/kern_fail.c
sys/kern/kern_synch.c
sys/kern/subr_fattime.c
sys/kern/subr_stats.c
sys/net/altq/altq_classq.h
sys/netgraph/ng_pipe.c
sys/netinet/cc/cc_cdg.c
sys/netinet/cc/cc_chd.c
sys/netinet/cc/cc_hd.c
sys/netinet/igmp_var.h
sys/netpfil/ipfw/dn_aqm_pie.h
sys/netpfil/ipfw/dn_sched_fq_codel.c
sys/netpfil/ipfw/dn_sched_fq_pie.c
sys/netpfil/ipfw/ip_dn_io.c
sys/netpfil/ipfw/ip_fw2.c
sys/netpfil/ipfw/test/test_dn_heap.c
sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
sys/tests/fib_lookup/fib_lookup.c
sys/vm/memguard.c
Comment 7 Henrich Hartzer 2024-03-18 21:20:07 UTC
Created attachment 249283 [details]
sys/netinet/cc switch from random() to prng32()
Comment 8 Henrich Hartzer 2024-03-18 21:21:00 UTC
I see, thank you! I drafted up a quick patch for sys/netinet/cc/. It's untested and I don't understand all of the implications of the changes.

If it's worth reviewing, where should I submit it?
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-03-22 13:33:17 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=466e0dc5ce78da69c14dd993d12ef21a62deca5b

commit 466e0dc5ce78da69c14dd993d12ef21a62deca5b
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-03-18 20:02:08 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-03-22 13:30:31 +0000

    random(9): bump removal to FreeBSD 15.0

    It has not yet been removed, and still has some in-tree consumers.

    PR:             277655
    Sponsored by:   The FreeBSD Foundation

    (cherry picked from commit f50322c1dcfe369ad73e1123541d18fc431384f6)

 share/man/man9/random.9 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 10 Henrich Hartzer 2024-04-05 23:49:52 UTC
Might it be possible for you or someone else to review my patch?

If I should submit it through another avenue, please let me know!
Comment 11 Henrich Hartzer 2024-06-08 04:58:21 UTC
A modified version of my patch was merged. I updated the title to track the random() removal for 15.0. Still lots of random() calls being made.