Commit Graph

280462 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
5edde07c2a LinuxKPI: 802.11: implement cfg80211_{get,put}_bss
Implement cfg80211_{get,put}_bss currently doing malloc/free bits,
so hopefully the drivers get the calls right.

cfg80211_get_bss() sets up a lookup structure which may also take a
result (first hit wins) and calls ieee80211_scan_iterate() comparing
the various values in the iterator funcion.  Some of the checks are
partially pointless (as it seems the drivers are not interested in
these parts [ANY] but we keep them for documentation purposes should
futher values arise in the future).

We currently only iterate over the first VAP which will do for now.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2022-12-31 01:18:16 +00:00
Bjoern A. Zeeb
b6b352e4c7 LinuxKPI: 802.11: set sta supported legacy rates
When initializing the sta set the per-band supported legacy rates
as some drivers take the information from there.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2022-12-31 00:33:34 +00:00
Alexander V. Chernikov
06e879593a routing: add missed RIB_WUNLOCK in the add_route_flags().
MFC after:	2 weeks
2022-12-30 15:54:06 +00:00
Vladimir Kondratyev
1522062bad hidraw(4): Drop unneeded usb kernel module dependency
HID is not a part of usb subsystem for a while.

MFC after:	2 weeks
2022-12-30 18:24:53 +03:00
Konstantin Belousov
a5ff86646e UFSSUSPEND: unbusy mp in EDADLK case
Reported and tested by:	pho
Fixes:	701b36961c
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-12-30 11:44:20 +02:00
Konstantin Belousov
701b36961c ufs/suspend: deny suspension if the calling process has a file from mp opened for write
Also deny suspension if we cannot check the above condition race-free
because there is more than one thread in the calling process.

PR:	267628, 267630
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37896
2022-12-29 22:55:39 +02:00
Konstantin Belousov
6891270170 ffs_suspend.c: clean up includes
Order includes alphabetically.
Remove unneeded sys/param.h, it is already included by sys/systm.h.

Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37896
2022-12-29 22:55:39 +02:00
Konstantin Belousov
37b9fb1696 Add descrip_check_write_mp() helper
... which verifies that given file table does not have file descriptors
referencing vnodes on the specified mount point.  It is up to the caller
to ensure that the check is not racy.

Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37896
2022-12-29 22:55:39 +02:00
Shteryana Shopova
4ac8f40670 Follow the standard object definition from RFC2578
Use mib-2 throughout the files where applicable

PR:		254231
Reported by:	Michael Proto
Reviewed by:	bz (at) FreeBSD (dot) org
2022-12-29 22:02:27 +02:00
Alexander V. Chernikov
f63825ff21 testing: improve python vnet wrapper.
* Derive jail name from class name and method name, instead of just
method name. This change reduces the chances of different tests
clashing.
 Old: 'jail_test_one'. New: 'pytest:TestExampleSimplest:test_one'
* Simplify vnetX_handler() method signature by skipping obj_map (unused)
 and pipe. The latter can be accessed as the vnet property.
* Add `send_object()` method as a pair to the `wait_object` inside the
 VnetTestTemplate class.
* Add `test_id` property to the BaseTest method. Previously it was
 provided only for the VnetTestTemplate class. This change makes
 the identifier easily accessible for all users.

MFC after:	2 weeks
2022-12-29 19:59:11 +00:00
John Baldwin
7063b9974f ccr: Retire ccr_softc member in struct adapter.
Prior to Conrad's changes to replace session integer IDs with a
pointer to the driver-specific state in commit 1b0909d51a, the
driver had to find the softc pointer from the adapter before it could
locate the ccr_session structure for a completed request.  Since
Conrad's changes, the ccr_session pointer can now be obtained directly
from the crp.  Add a backpoint from ccr_session back to ccr_softc and
use this in place of the ccr_softc member in cxgbe's struct adapter.

Sponsored by:	Chelsio Communications
2022-12-29 11:39:28 -08:00
David E. O'Brien
f3c043bb5f newsyslog.conf: Minor formatting fix 2022-12-28 16:26:51 -08:00
David E. O'Brien
bb6266f279 newsyslog.conf: Sort paths 2022-12-28 16:23:41 -08:00
David E. O'Brien
96c6fba6fd rc.subr: Minor formatting fix for ac102a2a6 2022-12-28 16:00:56 -08:00
David E. O'Brien
43dc1409c1 Restricting xargs to '-n1' is much slower and isn't needed for file(1)
Also note that libc.so.6 is an older version of libc (thus why you'd
want to find files linked against it).
2022-12-28 15:54:29 -08:00
Mateusz Guzik
f45feecfb2 vfs: add vn_getsize
getattr is very expensive and in important cases only gets called to get
the size. This can be optimized with a dedicated routine which obtains
that statistic.

As a step towards that goal make size-only consumers use a dedicated
routine.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D37885
2022-12-28 22:43:49 +00:00
Simon J. Gerraty
e300f328fe Add site.{autodep,gendirdeps}.mk
Allow for site customization to minimize churn in share/mk

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D37895
2022-12-28 12:39:08 -08:00
John Baldwin
d131218534 h_resolv: Fix a buffer overflow in load().
fgetln() returns a pointer to an array of characters that is 'len'
characters long, not 'len + 1'.  While here, overwriting the contents
of the buffer returned by fgetln isn't really safe, so switch to using
getline() instead.

Note that these fixes are a subset of those applied to a
near-identical copy of this function in libc's resolv_test.c in commit
2afeaad315.

Reviewed by:	ngie
Reported by:	CHERI (buffer overflow)
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D37886
2022-12-28 09:39:18 -08:00
Jose Luis Duran
058ac3e806 atf_pytest_wrapper: fix pytest output truncation
Pass `-vv` to pytest in order to always get the full output.
While here, enforce the modeline.

Differential Revision: https://reviews.freebsd.org/D37894
MFC after:	2 weeks
2022-12-28 17:31:14 +00:00
Jose Luis Duran
eaeebfcb38 pytest: silence deprecation warning in the pytest atf wrapper
Convert `pytest.mark` decorator to the `pytest.hookimpl()` one,
 as suggested by the
 https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers

Differential Revision: https://reviews.freebsd.org/D37884
MFC after:	2 weeks
2022-12-28 15:53:48 +00:00
Zhenlei Huang
bd5d9037c5 GEOM: Remove redundant NULL pointer check before g_free()
Reviewed by:	melifaro, pjd, imp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D37779
2022-12-28 23:34:09 +08:00
Zhenlei Huang
f948cb717f wg: Use NET_EPOCH_DRAIN_CALLBACKS macro
Reviewed by:	jhb, kp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D37734
2022-12-28 23:28:15 +08:00
Søren Schmidt
79c6e0b31f Improve and make it more general Rockchip USB2PHY driver.
Add support for Rockchip RK3568.
2022-12-28 03:48:48 +00:00
Søren Schmidt
355cb40c3a Set RK3568 specific pin mux for GMAC1. 2022-12-28 03:00:19 +00:00
Ganbold Tsagaankhuu
db6407438d Add eqos device to Rockchip specific config. 2022-12-28 02:32:06 +00:00
John Baldwin
07be751727 ktls: Post receive errors on partially closed sockets.
If an error such as an invalid record or one whose decryption fails is
detected on a socket that has received a RST then ktls_drop() could
ignore the error since INP_DROPPED could already be set.  In this case
soreceive_generic hangs since it does not return from a KTLS socket
with pending encrypted data unless there is an error (so_error) (this
behavior is to ensure that soreceive_generic doesn't return a
premature EOF when there is pending data still being decrypted).

Note that this was a bug prior to
69542f2682 as tcp_usr_abort would also
have ignored the error in this case.

Reviewed by:	gallatin
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37775
2022-12-27 16:00:17 -08:00
John Baldwin
7a8d62cd04 termcap.small: Don't use -o pipefail.
The command to generate termcap.small doesn't use any pipes, so this
option is not needed.  Using it also breaks cross-building on hosts
where /bin/sh does not support pipefail such as Linux hosts where
/bin/sh is dash.

Reviewed by:	sobomax, imp
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D37865
2022-12-27 10:05:10 -08:00
Wolfram Schneider
433c5a8ae4 do not expect mandoc(1) to terminate in finite time
PR:		266868
2022-12-27 17:04:04 +00:00
Kristof Provost
b079ca8593 Revert "if_ovpn: allow peer lookup by vpn4/vpn6 address"
This reverts commit 92f0cf77db.

This change was incorrect, at least because it uses ovpn_kpeer's tree
for multipbe RB_TREEs.

This is a performance change, not a functional one, so we can revert
this until it can be fixed.

Reported by:	Gert Doering <gert@greenie.muc.de>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-12-26 22:38:10 +01:00
Gleb Smirnoff
5e4ae3061f tests/divert: use PF_DIVERT
Now all Python ports has been patched to support PF_DIVERT, and
Python kinda promises to add support in 3.12 [1].

This reverts commit 322b5b7c16.

[1] https://github.com/python/cpython/pull/96536#issuecomment-1303974686
2022-12-26 12:02:45 -08:00
Mateusz Guzik
829f0bcb5f vfs: add the concept of vnode state transitions
To quote from a comment above vput_final:
<quote>
* XXX Some filesystems pass in an exclusively locked vnode and strongly depend
* on the lock being held all the way until VOP_INACTIVE. This in particular
* happens with UFS which adds half-constructed vnodes to the hash, where they
* can be found by other code.
</quote>

As is there is no mechanism which allows filesystems to denote that a
vnode is fully initialized, consequently problems like the above are
only found the hard way(tm).

Add rudimentary support for state transitions, which in particular allow
to assert the vnode is not legally unlocked until its fate is decided
(either construction finishes or vgone is called to abort it).

The new field lands in a 1-byte hole, thus it does not grow the struct.

Bump __FreeBSD_version to 1400077

Reviewed by:	kib (previous version)
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D37759
2022-12-26 17:35:12 +00:00
Mateusz Guzik
ed1bb25410 mntfs: change mntfs_allocvp API to relock on its own
Reviewed by:	kib
Tested by:	pho
Differential Revision: https://reviews.freebsd.org/D37759
2022-12-26 17:34:49 +00:00
Mateusz Guzik
94267fc907 vfs: use designated initializers for the typename array
While here prefix with v for better consistency with the vnode stuff.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D37759
2022-12-26 17:34:41 +00:00
Mike Karels
4c8a257810 growfs script: fixes
Cannot use single quote in comment in awk script;
add growfs_fstab to Makefile

Fixes:		4a30d7bb373c,d670a8f7c596
2022-12-26 08:51:09 -06:00
Alan Somers
e35cfc606a Add test cases for ping with IP options in the response
MFC after:	1 week
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D37210
2022-12-25 22:59:58 -07:00
Dimitry Andric
526f57bf85 Update CWARNFLAGS in bsd.sys.mk and CWARNEXTRA in kern.mk for clang 15.
MFC after:	3 days
2022-12-25 12:58:22 +01:00
Kirk McKusick
f126d34981 Add -F option to sysctl(8) to display sysctl format.
Also add a test to ensure that it is working correctly.

Submitted by: ota_j.email.ne.jp
Reviewed by:  mckusick
Differential Revision: https://reviews.freebsd.org/D34012
2022-12-24 22:59:00 -08:00
Cheng Cui
57cc27a332 BBLog: improve sysctl variables
Correct the format in sysctl net.inet.tcp.bb.disable_all and
sysctl net.inet.tcp.bb.log_auto_all.
Correct the format and the description in
net.inet.tcp.bb.log_auto_mode.

Reviewed by:		rscheff, tuexen
MFC after:		1 week
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D37776
2022-12-24 22:10:31 +01:00
Vincenzo Maffione
eda8251188 netmap: pkt-gen: fix ifname before cmp in source_hwaddr
In source_hwaddr(), the configured ifname is compared against all
interfaces. However, in main(), the string 'netmap:' is prepended to the
interface string if no explicit type is given. Therefore the ifname will
not match any system interface and the source MAC address is always
empty.

Check for the leading 'netmap:' string and skip past it to match against
system interfaces. Note that 'tap:' and 'pcap:' devices strip the type
string from the ifname in main() so no further work is needed.

MFC after:	7 days
Submitted by:	Brian Poole <brian90013@gmail.com>
2022-12-24 16:06:05 +00:00
Vincenzo Maffione
95fc11577d netmap: monitor: add missing netmap_adapter_put()
MFC after:	7 days
2022-12-24 16:03:14 +00:00
Vincenzo Maffione
92e8b4a630 debug_put_get: don't crash on null pointers
MFC after:	7 days
2022-12-24 15:32:12 +00:00
Vincenzo Maffione
b41818a28a monitor: fix cb restore when monitored adapter unregisters
netmap_monitor_stop() called nm_monitor_none() after the head of
the zero-copy monitors had been reset, thus thinking that there
was nothing left to do.

MFC after:	7 days
2022-12-24 15:28:45 +00:00
Vincenzo Maffione
3da494d324 netmap: drop compatibility FreeBSD code
Netmap users on FreeBSD are not supposed to import code from the
github netmap repository anymore. They should use the code that
is available in the src repo. We can therefore drop the compatibility
code.

MFC after:	7 days
2022-12-24 14:36:31 +00:00
Søren Schmidt
e00774a917 Add support for Rockchip RK3568 SDHCI controller. 2022-12-24 12:38:33 +00:00
Søren Schmidt
571e5792f9 Change probe priority so order is correct. 2022-12-24 12:33:42 +00:00
Vladimir Kondratyev
7c4c5368ae hidraw(4): Replace Giant with bus_topo_lock 2022-12-24 12:51:13 +03:00
Vladimir Kondratyev
68f08e26e2 LinuxKPI: linux/seqlock.h: Fix write_seqcount_(begin|end)
in seqcount_mutex_t case with removal of extraneous mutex lock/unlock
calls and addition of missing critical section.
While here strip one inline wrap layer to reduce code size.

Fixes startup lockup of i915kms after update to drm-kmod v5.12

Reviewed by:	hselasky, bz
MFC after:	1week
Differential Revision:	https://reviews.freebsd.org/D37699
2022-12-24 12:01:20 +03:00
Vladimir Kondratyev
0661cf74e6 hms(4): Disable vendor usage page button support
for all devices except Kensington Slimblade Trackball as it brokes
some other devices like Contour Rollermouse Red

Add a quirk for it as well.

Reported by:	Atte Peltomäki <koston_AT_iki_DOT_fi>
PR:		267922
MFC after:	2 weeks
2022-12-24 12:01:20 +03:00
Vladimir Kondratyev
ab4f740bc5 ums(4): Disable vendor usage page button support
for all devices except Kensington Slimblade Trackball as it brokes
some other devices like Contour Rollermouse Red

Add a quirk for it as well.

Reported by:	Atte Peltomäki <koston_AT_iki_DOT_fi>
PR:		267922
MFC after:	2 weeks
2022-12-24 12:01:20 +03:00
Konstantin Belousov
860399eb86 tmpfs: update changed/modified timestamps for truncates that do not change size
While there, move all error checks into the common place at the start,
and eliminate the 'out' label.

PR:	268528
Analyzed and tested by:	Mark Millard <marklmi@yahoo.com>
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37866
2022-12-24 08:32:48 +02:00