[Midnightbsd-cvs] [MidnightBSD/src] 02c17d: bsdiff: Use mmap instead of malloc
Cy Schubert
noreply at github.com
Wed Dec 31 13:31:18 EST 2025
Branch: refs/heads/master
Home: https://github.com/MidnightBSD/src
Commit: 02c17d83244558dfb371739472a59789dd4dbe06
https://github.com/MidnightBSD/src/commit/02c17d83244558dfb371739472a59789dd4dbe06
Author: Ricardo Branco <rbranco at suse.de>
Date: 2025-12-31 (Wed, 31 Dec 2025)
Changed paths:
M usr.bin/bsdiff/bsdiff/bsdiff.c
M usr.bin/bsdiff/bspatch/bspatch.c
Log Message:
-----------
bsdiff: Use mmap instead of malloc
Note: This follows the current style of the bsdiff.c and bspatch.c
files, which is rather far from style(9).
Reviewed by: imp, cpervica
Pull Request: https://github.com/freebsd/freebsd-src/pull/1076
Commit: 6f4b808fa782c1225ca763c2954c4112c2081e42
https://github.com/MidnightBSD/src/commit/6f4b808fa782c1225ca763c2954c4112c2081e42
Author: Dag-Erling Smørgrav <des at FreeBSD.org>
Date: 2025-12-31 (Wed, 31 Dec 2025)
Changed paths:
M sys/kern/kern_fork.c
M sys/kern/kern_proc.c
Log Message:
-----------
proc: Fix proc_init / proc_dtor ordering issues
* Move the initialization of p_ktr into proc_init() and make the check
in proc_dtor() unconditional. Prior to this, it was possible to fail
and invoke proc_dtor() after the first thread had been created (which
was the condition for checking p_ktr in proc_dtor()) but before p_ktr
had been initialized.
* Move the p_klist initialization in fork1() past the last possible
failure point so we don't have to free it on failure. We didn't,
which meant we were leaking a knlist every time we failed to fork
due to hitting the resource limit.
PR: 291470
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54215
(cherry picked from commit 026d962ef14dafe19fa73361bea6dcc95f141dfa)
Commit: ab191d9650b72724e0f3c93159847d9313199582
https://github.com/MidnightBSD/src/commit/ab191d9650b72724e0f3c93159847d9313199582
Author: Dag-Erling Smørgrav <des at FreeBSD.org>
Date: 2025-12-31 (Wed, 31 Dec 2025)
Changed paths:
M sys/kern/kern_jail.c
M sys/kern/vfs_syscalls.c
Log Message:
-----------
vfs: Let prison_enforce_statfs zero the fsid
Currently, we unconditionally zero the fsid before returning a struct
statfs to a jailed process. Move this into prison_enforce_statfs() so
it only happens if enforce_statfs is greater than 1, or enforce_statfs
is 1 but the mountpoint is outside the jail.
PR: 291301
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54214
(cherry picked from commit d4f25d0c7957f0f1960028eec82625c2d6405537)
Commit: a1b21df0648f99c4eb111ff474dab273bca49ee3
https://github.com/MidnightBSD/src/commit/a1b21df0648f99c4eb111ff474dab273bca49ee3
Author: Gordon Tetlow <gordon at FreeBSD.org>
Date: 2025-12-31 (Wed, 31 Dec 2025)
Changed paths:
M lib/libc/stdtime/strptime.3
M lib/libc/stdtime/strptime.c
Log Message:
-----------
libc: Add "Z" as TZ designator for strptime.
ISO 8601 allows use of "Z" as the time zone designator. Update the
strptime parser to allow this usage.
While we are at it, update the manpage to reflect that both UTC and Z
are now valid options.
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D53083
(cherry picked from commit 79e57ea662d92ffcbe7d65854a284aefac6a332d)
Commit: 210bee669cc4fc960dc7a38f805d1c063445183e
https://github.com/MidnightBSD/src/commit/210bee669cc4fc960dc7a38f805d1c063445183e
Author: Lexi Winter <ivy at FreeBSD.org>
Date: 2025-12-31 (Wed, 31 Dec 2025)
Changed paths:
M lib/libc/inet/inet_net_ntop.c
M lib/libc/inet/inet_net_pton.c
M lib/libc/tests/net/Makefile
A lib/libc/tests/net/inet_net_test.cc
Log Message:
-----------
libc: Import OpenBSD's inet_net_{ntop,pton}
Our versions of these functions (originally taken from BIND) simply
don't work correctly for AF_INET6. These were removed from BIND itself
quite a while ago, but OpenBSD has made several fixes in the mean time,
so import their code.
Add tests for both functions.
PR: 289198
Reported by: Nico Sonack <nsonack at herrhotzenplotz.de>
MFC after: 1 week
Reviewed by: des
Obtained from: OpenBSD (lib/libc/net)
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52629
(cherry picked from commit 8f4a0d2f7b96099001dbc51e06114df1a0e6d291)
inet_net_test: Compare pointers against nullptr
GCC does not like passing NULL (__null) to std::ostringstream::operator<<
inside of ATF_REQUIRE_EQ:
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_ntop_invalid::body() const':
lib/libc/tests/net/inet_net_test.cc:306:9: error: passing NULL to non-pointer argument 1 of 'std::__1::basic_ostream<_CharT, _Traits>& std::__1::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::__1::char_traits<char>]' [-Werror=conversion-null]
306 | ATF_REQUIRE_EQ(ret, NULL);
| ^~~~~~~~~~~~~~
In file included from /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/sstream:317,
from /usr/obj/.../amd64.amd64/tmp/usr/include/atf-c++/macros.hpp:29,
from /usr/obj/.../amd64.amd64/tmp/usr/include/atf-c++.hpp:29,
from lib/libc/tests/net/inet_net_test.cc:33:
/usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__ostream/basic_ostream.h:338:81: note: declared here
338 | basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long __n) {
| ~~~~~^~~
...
Fixes: 8f4a0d2f7b96 ("libc: Import OpenBSD's inet_net_{ntop,pton}")
(cherry picked from commit aa358ce3ca8e1fcfb305025fd00beb2a119c7c77)
inet_net_test: Use int to hold expected return values from inet_net_pton
GCC warns about the sign mismatch in comparisons:
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_inet4::body() const':
lib/libc/tests/net/inet_net_test.cc:86:17: error: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Werror=sign-compare]
86 | ATF_REQUIRE_EQ(bits, addr.bits);
| ^~~~~~~~~~~~~~
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_inet6::body() const':
lib/libc/tests/net/inet_net_test.cc:205:17: error: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Werror=sign-compare]
205 | ATF_REQUIRE_EQ(bits, addr.bits);
| ^~~~~~~~~~~~~~
Fixes: 8f4a0d2f7b96 ("libc: Import OpenBSD's inet_net_{ntop,pton}")
(cherry picked from commit e1aeb58cbbc3839db93ec38ce491b7b9383d5649)
(cherry picked from commit b4871be3490de56975777079c1767d1fd346ac7a)
Commit: 027622b9147761159106adba9fda3e1bb46de25c
https://github.com/MidnightBSD/src/commit/027622b9147761159106adba9fda3e1bb46de25c
Author: Gordon Bergling <gbe at FreeBSD.org>
Date: 2025-12-31 (Wed, 31 Dec 2025)
Changed paths:
M sys/kern/subr_kdb.c
Log Message:
-----------
kdb: Fix a typo in a source code comment
- s/th/the/
(cherry picked from commit 0a53e6d8bc0b3a6332e228993d040fbf38f652fb)
Commit: dc3359cc1488245781fd982464120350c04e7ce8
https://github.com/MidnightBSD/src/commit/dc3359cc1488245781fd982464120350c04e7ce8
Author: Cy Schubert <cy at FreeBSD.org>
Date: 2025-12-31 (Wed, 31 Dec 2025)
Changed paths:
M sys/netpfil/ipfilter/netinet/ip_htable.c
Log Message:
-----------
ipfilter: Plug ip_htable kernel information leak
ipf_htable_stats_get() constructs an iphtstat_t on the stack and only
initializes select fields before copying the entire structure to
userland. The trailing padding array iphs_pad[16] is never initialized,
so ~128 bytes of uninitialized kernel stack memory can be leaked to user
space on each call. This is a classic information disclosure
vulnerability that can reveal pointers and other sensitive data.
We fix this by zeroing out the data structure prior to use.
Reported by: Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D53275
(cherry picked from commit 0d589ecbc7aa916537fd21c0344919491cfcb293)
Compare: https://github.com/MidnightBSD/src/compare/b8a926bd4021...dc3359cc1488
To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications
More information about the Midnightbsd-cvs
mailing list