FreeBSD/src 40e52e0lib/libc/stdlib system.c

system(3): Unwrap execve()

There is no need to call execl(), which will allocate an array and copy
our arguments into it, when we can use a static array and call execve()
directly.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55648
DeltaFile
+3-1lib/libc/stdlib/system.c
+3-11 files

FreeBSD/ports 697d264textproc/libxml2 distinfo Makefile, textproc/libxml2/files xmllint.1 xmlcatalog.1

textproc/libxml2: update to 2.15.2

Changelog: https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.15.2/NEWS
(cherry picked from commit 0734d7476a36a67f16580afb65b79375a3ae9fc9)
DeltaFile
+3-5textproc/libxml2/distinfo
+3-3textproc/libxml2/files/xmllint.1
+1-4textproc/libxml2/Makefile
+2-2textproc/libxml2/files/xmlcatalog.1
+1-1textproc/libxml2/pkg-plist
+10-155 files

FreeBSD/ports b77bc6cnet-im/flare distinfo Makefile.crates

net-im/flare: update to 0.18.8

Changelog: https://gitlab.com/schmiddi-on-mobile/flare/-/releases/0.18.8

While here, use databases/sqlcipher instead of bundled

PR: 293450
Approved by: nxjoseph (maintainer)
DeltaFile
+313-275net-im/flare/distinfo
+155-136net-im/flare/Makefile.crates
+6-4net-im/flare/Makefile
+474-4153 files

FreeBSD/ports 0734d74textproc/libxml2 distinfo Makefile, textproc/libxml2/files xmllint.1 xmlcatalog.1

textproc/libxml2: update to 2.15.2

Changelog: https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.15.2/NEWS
DeltaFile
+3-5textproc/libxml2/distinfo
+3-3textproc/libxml2/files/xmllint.1
+1-5textproc/libxml2/Makefile
+2-2textproc/libxml2/files/xmlcatalog.1
+1-1textproc/libxml2/pkg-plist
+10-165 files

FreeBSD/src 8e61067sys/dev/ichwd i6300esbwd.c

ichwd: address unused function warning by marking as __unused

Reported by:    markj, bz
Approved by:    markj (mentor)
Fixes:  2b74ff5fceb6 ("ichwd: introduce i6300esbwd watch dog driver")
Differential Revision: https://reviews.freebsd.org/D52476

(cherry picked from commit 3449a3abab892a0a1124ee4edbc10d6d28b87af3)
DeltaFile
+1-1sys/dev/ichwd/i6300esbwd.c
+1-11 files

FreeBSD/src ba5f771usr.sbin/lpr/lpd lpd.c lpd.8

lpd: Add timeout option

Set a 120-second receive timeout on all client connections, and add a
command-line option to change that value.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55400

(cherry picked from commit 56fbfd1ecdc78fc99b3a2e381c355ce8980de39d)
DeltaFile
+20-12usr.sbin/lpr/lpd/lpd.c
+7-1usr.sbin/lpr/lpd/lpd.8
+27-132 files

FreeBSD/src c746013usr.sbin/lpr/lpd lpd.c lpd.8

lpd: Add -F flag to prevent daemonizing

This is necessary for use with supervision, e.g. runit.

I chose -F simply because that is what the folks at LPRng use.

Approved by:            pfg, gad, ngie
Differential Revision:  https://reviews.freebsd.org/D29566

(cherry picked from commit 3c6366067036d4573528309a0a4d3b52e2a76ae7)
DeltaFile
+16-8usr.sbin/lpr/lpd/lpd.c
+11-0usr.sbin/lpr/lpd/lpd.8
+27-82 files

FreeBSD/src d326556usr.sbin/lpr/lpd lpd.8

lpd: Update SYNOPSIS with new flag

Reported by:    0mp

(cherry picked from commit cebcca89f1b059438cc329bde4d8ad254a303623)
DeltaFile
+1-1usr.sbin/lpr/lpd/lpd.8
+1-11 files

FreeBSD/src 88dc56ausr.sbin/lpr/lpd recvjob.c

lpd: Improve robustness

* Check for integer overflow when receiving file sizes.

* Check for buffer overflow when receiving file names, and fully
  validate the names.

* Check for integer overflow when checking for available disk space.

* Check for I/O errors when sending status codes.

* Enforce one job per connection and one control file per job (see
  code comments for additional details).

* Simplify readfile(), avoiding constructs vulnerable to integer
  overflow.

* Don't delete files we didn't create.


    [11 lines not shown]
DeltaFile
+189-102usr.sbin/lpr/lpd/recvjob.c
+189-1021 files

FreeBSD/src 9711a6dusr.sbin/lpr/lpd recvjob.c

lpr: Remove trailing semicolon

Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654
(cherry picked from commit 365348f66a47df247b5289b8a86fb20b36d778c1)
DeltaFile
+1-1usr.sbin/lpr/lpd/recvjob.c
+1-11 files

FreeBSD/src 1afa6f9usr.sbin/lpr/lpd lpd.8

lpd.8: Chase Dd-- took old value when merging

(cherry picked from commit 56b0f5f360b6039c6a696aa241aaa02a16ff6a0a)
DeltaFile
+1-1usr.sbin/lpr/lpd/lpd.8
+1-11 files

FreeBSD/src c1788a9lib/libc/stdlib system.3

system(3): Clarify return values

Our manual page currently states that system() will return 127 if it
fails to execute the shell.  The actual return value is, to quote POSIX,
“as if the command language interpreter had terminated using exit(127)
or _exit(127)”.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, kevans
Differential Revision:  https://reviews.freebsd.org/D55483

(cherry picked from commit 7305604b29d3db29c9bb5de6e7a25829fb541d1e)
DeltaFile
+5-3lib/libc/stdlib/system.3
+5-31 files

FreeBSD/src 041065eusr.sbin/lpr/lpd lpd.c lpd.8

lpd: Add timeout option

Set a 120-second receive timeout on all client connections, and add a
command-line option to change that value.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55400

(cherry picked from commit 56fbfd1ecdc78fc99b3a2e381c355ce8980de39d)
DeltaFile
+20-12usr.sbin/lpr/lpd/lpd.c
+7-1usr.sbin/lpr/lpd/lpd.8
+27-132 files

FreeBSD/src 60f5fc3usr.sbin/lpr/lpd recvjob.c

lpd: Improve robustness

* Check for integer overflow when receiving file sizes.

* Check for buffer overflow when receiving file names, and fully
  validate the names.

* Check for integer overflow when checking for available disk space.

* Check for I/O errors when sending status codes.

* Enforce one job per connection and one control file per job (see
  code comments for additional details).

* Simplify readfile(), avoiding constructs vulnerable to integer
  overflow.

* Don't delete files we didn't create.


    [11 lines not shown]
DeltaFile
+189-102usr.sbin/lpr/lpd/recvjob.c
+189-1021 files

FreeBSD/src 8328057lib/libc/stdlib system.3

system(3): Clarify return values

Our manual page currently states that system() will return 127 if it
fails to execute the shell.  The actual return value is, to quote POSIX,
“as if the command language interpreter had terminated using exit(127)
or _exit(127)”.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, kevans
Differential Revision:  https://reviews.freebsd.org/D55483

(cherry picked from commit 7305604b29d3db29c9bb5de6e7a25829fb541d1e)
DeltaFile
+5-3lib/libc/stdlib/system.3
+5-31 files

FreeBSD/src 3d7774dlib/libc/tests/stdlib system_test.c Makefile

system(3): Write our own tests

Replace the somewhat perfunctory NetBSD tests with our own.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, kevans
Differential Revision:  https://reviews.freebsd.org/D55482

(cherry picked from commit 7a1ade5109ac57d1f59eaa75b5d0f13fabecf6ba)
DeltaFile
+164-0lib/libc/tests/stdlib/system_test.c
+2-1lib/libc/tests/stdlib/Makefile
+166-12 files

FreeBSD/src f413ebdusr.sbin/lpr/lpd lpd.c lpd.8

lpd: Add timeout option

Set a 120-second receive timeout on all client connections, and add a
command-line option to change that value.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55400

(cherry picked from commit 56fbfd1ecdc78fc99b3a2e381c355ce8980de39d)
DeltaFile
+20-12usr.sbin/lpr/lpd/lpd.c
+7-1usr.sbin/lpr/lpd/lpd.8
+27-132 files

FreeBSD/src cc54590usr.sbin/lpr/lpd recvjob.c

lpd: Improve robustness

* Check for integer overflow when receiving file sizes.

* Check for buffer overflow when receiving file names, and fully
  validate the names.

* Check for integer overflow when checking for available disk space.

* Check for I/O errors when sending status codes.

* Enforce one job per connection and one control file per job (see
  code comments for additional details).

* Simplify readfile(), avoiding constructs vulnerable to integer
  overflow.

* Don't delete files we didn't create.


    [11 lines not shown]
DeltaFile
+189-102usr.sbin/lpr/lpd/recvjob.c
+189-1021 files

FreeBSD/src 99eed0blib/libc/stdlib system.c, lib/libc/tests/stdlib system_test.c

system(3): Fix null case

Our manual page states that if given a null pointer, system() returns
non-zero if the shell is available and zero if it is not.  This is
consistent with the C standard's description of system(), but it is not
what we actually do.  What we actually do is always return non-zero, as
required by POSIX.

As the POSIX rationale explains, implementing the logic required by the
C standard does not violate POSIX, since a conforming system always has
a shell, therefore the logic will always return non-zero.

Since our libc is commonly used in non-conforming situations such as
chroots or thin jails, we should implement the full logic required by
the C standard.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    obiwac, bnovkov, kevans

    [3 lines not shown]
DeltaFile
+10-0lib/libc/tests/stdlib/system_test.c
+1-1lib/libc/stdlib/system.c
+11-12 files

FreeBSD/src 47bd3d4lib/libc/stdlib system.3

system(3): Clarify return values

Our manual page currently states that system() will return 127 if it
fails to execute the shell.  The actual return value is, to quote POSIX,
“as if the command language interpreter had terminated using exit(127)
or _exit(127)”.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, kevans
Differential Revision:  https://reviews.freebsd.org/D55483

(cherry picked from commit 7305604b29d3db29c9bb5de6e7a25829fb541d1e)
DeltaFile
+5-3lib/libc/stdlib/system.3
+5-31 files

FreeBSD/src 1ea0da8lib/libc/stdlib system.c

system(3): Improve signal handling

Ignore SIGINT and SIGQUIT and block SIGCHLD, as POSIX requires.

To deal with the concurrency problem described in POSIX, we keep track
of the count of concurrent invocations.  We ignore and block signals
only when the counter was zero before we incremented it, and restore
them only when the counter reaches zero after we decrement it.

Note that this does not address the issue of thread cancellation.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, sef, kevans
Differential Revision:  https://reviews.freebsd.org/D55471

(cherry picked from commit 6e589e6e8e64793adb437c561ec084dbb6ad1ced)
DeltaFile
+76-46lib/libc/stdlib/system.c
+76-461 files

FreeBSD/ports b39a342sysutils/cpupdate distinfo Makefile

sysutils/cpupdate: minor update

Update Intel Pack upto microcode-20260227 and
platomav/CPUMicrocodes upto r348. Bump PORTREVISION.
DeltaFile
+5-5sysutils/cpupdate/distinfo
+4-4sysutils/cpupdate/Makefile
+9-92 files

FreeBSD/ports 7dd85delang/cbqn pkg-descr

lang/cbqn: Update pkg-descr

PR:             293247
Reported by:    mew14930xvi <mew14930xvi at inbox.lv>
Approved by:    lwhsu (mentor, implicitly)
DeltaFile
+3-1lang/cbqn/pkg-descr
+3-11 files

FreeBSD/ports 53c1ad8Mk bsd.port.mk

bsd.port.mk: run pkg-create with MAKE_JOB_NUMBER threads

Following the same as https://reviews.freebsd.org/D53053
in the src tree.

Reviewed by:    portmgr (bapt)
Approved by:    lwhsu (mentor, implicitly)
Differential Revision:  https://reviews.freebsd.org/D55232
DeltaFile
+1-1Mk/bsd.port.mk
+1-11 files

FreeBSD/ports ca48aafdevel/py-proxmoxer distinfo Makefile

devel/py-proxmoxer: Update 2.2.0 => 2.3.0

Changelog:
https://github.com/proxmoxer/proxmoxer/releases/tag/2.3.0

PR:     293578
DeltaFile
+3-3devel/py-proxmoxer/distinfo
+1-1devel/py-proxmoxer/Makefile
+4-42 files

FreeBSD/src a34f42bsys/amd64/include vmm_instruction_emul.h vmm.h, sys/amd64/vmm vmm_ioport.c vmm_instruction_emul.c

vmm: Support INOUT manual decode.

The inout instruction in AMD SVM requires DecodeAssist feature to decode the
segment override prefix. However, without that feature, we are still
able to decode by fetching the instruction directly.

Approved by:    markj (mentor)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51256

(cherry picked from commit c18c521c79b6160ce43bb2ca4c2eb42ccf7e6e57)
DeltaFile
+53-37sys/amd64/vmm/amd/svm.c
+40-0sys/amd64/vmm/vmm_ioport.c
+10-24sys/amd64/vmm/vmm_instruction_emul.c
+25-0sys/amd64/include/vmm_instruction_emul.h
+2-0sys/amd64/include/vmm.h
+2-0sys/amd64/vmm/intel/vmx.c
+132-616 files

FreeBSD/ports a440abamultimedia/libbluray pkg-plist

multimedia/libbluray: Fix build

Fix build if non-default option JAVA disabled - default build:
restore %%JAVA%% in plist.

PR:             293577
Approved by:    portmgr (blanket - fix build)
Fixes:          a45aee313be6 (Update to 1.4.1)
DeltaFile
+2-2multimedia/libbluray/pkg-plist
+2-21 files

FreeBSD/ports 81d745dsysutils/auto-admin distinfo Makefile

sysutils/auto-admin: Update to 0.8.4.24

auto-update-system:
    Don't use -DBATCH, user may need to accept license
auto-chromium+widevine-install:
    Tag linux-widevine-cdm as install-from-source so
    auto-update-system can update it automatically.
DeltaFile
+3-3sysutils/auto-admin/distinfo
+2-2sysutils/auto-admin/Makefile
+5-52 files

FreeBSD/ports 35a97a9devel/py-python-gitlab distinfo Makefile

devel/py-python-gitlab: Update 8.0.0 => 8.1.0

Changelog:
https://github.com/python-gitlab/python-gitlab/releases/tag/v8.1.0

PR:     293573
DeltaFile
+3-3devel/py-python-gitlab/distinfo
+1-1devel/py-python-gitlab/Makefile
+4-42 files

FreeBSD/src 4bac180sys/kern subr_smp.c

smp: Use bitwise operation to count cpu number

Previously, we iterated over all CPUs using CPU_FOREACH and checked
individual bits to count valid CPUs. Refactor this to use a bitwise AND
and popcount to count the number of enabled bits directly.

Approved by:    markj (mentor)
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D54474

(cherry picked from commit e387d9438ba0258b88ebe03ef139bc6fd70b5a46)
DeltaFile
+3-5sys/kern/subr_smp.c
+3-51 files