Commit Graph

253835 Commits

Author SHA1 Message Date
martin a2469ca7a0 Pull up following revision(s) (requested by riastradh in ticket #1920):
tests/lib/libc/sys/t_setrlimit.c: revision 1.8
	tests/lib/libc/sys/t_setrlimit.c: revision 1.9
	sys/kern/exec_subr.c: revision 1.86

t_setrlimit: Verify changing RLIMIT_STACK affects access to stack.
PR kern/57711

exec: Map noaccess part of stack with prot=NONE, maxprot=READ|WRITE.
This way, setrlimit(RLIMT_STACK) can grant READ|WRITE access when
increasing the stack size.
PR kern/57711
2023-11-28 13:00:52 +00:00
martin 981abbb066 Ticket #1919 2023-11-27 19:58:18 +00:00
martin b2f8c0cea7 Pull up following revision(s) (requested by tsutsui in ticket #1919):
external/gpl3/binutils/dist/gas/config/tc-mips.c: revision 1.25

binutils: fix gas that doesn't handle MIPS1 FPR load hazard correctly.
Fixes PR/57680.
2023-11-27 19:57:29 +00:00
martin 4c01858a96 Tickets #1917 and #1918 2023-10-29 16:49:07 +00:00
martin 992ee197fc Ticket #1916 2023-10-26 15:14:28 +00:00
martin d16ec04f8a Pull up following revision(s) (requested by buhrow in ticket #1916):
sys/dev/pci/mpii.c: revision 1.30

Fixes for PR kern/57133:

I can now explain why this assert is firing and have a fix for it.  It is a  regression introduced in R1.22 of mpii.c.

        If a request comes in and the IOC returns a MPII_SCSIIO_STATUS_CHECK_COND condition, after
 a successful transfer, or one that is a recovered error,
 mpii(4) correctly sets the xs->error to XS_SENSE, but incorrectly sets xs->resid to 0 before
 returning the xfer to the upper scsi layers.  Once the upper layers get it, they notice the
 XS_SENSE check condition and because it's a retryable error, they increment xs_requeuecnt, set
 ERESTART and send the xfer request down to the mpii(4) layer again for a retry. What they do
 not do is reset xs->resid equal to xs->datalen.  When the xfer comes down to mpii(4) again, the
 assert happens.  The fix is for the mpii(4) driver to leave xs->resid alone when it encounters
 a MPII_SCSIIO_STATUS_CHECK_COND condition.

This bug affects NetBSD-10, netbsd-9 and netbsd-8.
2023-10-26 15:13:38 +00:00
martin 18d3054374 Tickets #1914 and #1915 2023-10-18 14:46:35 +00:00
martin d82b29ffa0 regen (for ticket #1915) 2023-10-18 14:42:54 +00:00
martin de3774b99a Pull up the following, requested by msaitoh in ticket #1915:
sys/dev/pci/pcidevs			1.1497
	sys/dev/pci/if_wm.c			1.689,1.790-1.791 via patch
	sys/dev/pci/if_wmreg.h			1.120 via patch
	sys/dev/pci/if_wmvar.h			1.51

- Use 12K for packet buffer for jumbo frame on PCH2 and newer.
- Add new workaround for Tiger Lake and newer to avoid packet loss.
- Add I219{V,LM}({22,23}) devices (Raptor Lake).
2023-10-18 14:41:54 +00:00
martin b133c273d8 Pull up the following, requested by msaitoh in ticket #1914:
sys/dev/pci/ixgbe/ix_txrx.c			1.103-1.104
	sys/dev/pci/ixgbe/ixgbe.c			1.334-1.338,
							1.341-1.344 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.90-1.93
	sys/dev/pci/ixgbe/ixgbe_82599.c			1.31-1.32
	sys/dev/pci/ixgbe/ixgbe_api.c			1.29
	sys/dev/pci/ixgbe/ixgbe_bypass.h		1.5
	sys/dev/pci/ixgbe/ixgbe_common.c		1.46-1.47
	sys/dev/pci/ixgbe/ixgbe_common.h		1.18
	sys/dev/pci/ixgbe/ixgbe_dcb.c			1.14-1.15
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c		1.13
	sys/dev/pci/ixgbe/ixgbe_type.h			1.59-1.61
	sys/dev/pci/ixgbe/ixgbe_x540.c			1.24
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.28
	sys/dev/pci/ixgbe/ixv.c				1.187-1.192 via patch

- ixg(4): Add 82599 LS support once again.
- ixg(4): Filter out spurious link up indication more.
- ixg(4): Print DEVICE_CAPS register.
- ixg(4): Fix a bug that the number of queues is unintentionally
  limited to a small number or wrong error message may be printed
  when two devices' number of MSI-X vectors are different.
- Modify error message of wrong TX/RX descriptor size.
- Enable interrupt after setting IFF_RUNNING.
- Fix a bug that changing hw.ix[gv]X.qY.interrupt_rate would change
  all devices all queues default interrupt rate.
- Cleanup the code.
2023-10-18 14:23:15 +00:00
martin 1ac542ce2a Tickets #1911 - #1913 2023-10-13 18:59:15 +00:00
martin 4db01c1fbd Regen for ticket #1913 (Intel 82599 LS and Pericom(Diodes) PCIe switches added) 2023-10-13 18:46:04 +00:00
martin 8f5f91e697 Pull up following revision(s) (requested by msaitoh in ticket #1913):
sys/dev/pci/pcidevs: revision 1.1493
	sys/dev/pci/pcidevs: revision 1.1495

Add Intel 82599 LS.
Add Pericom(Diodes) PCIe switches.
2023-10-13 18:44:59 +00:00
martin b41b8fd635 Pull up following revision(s) (requested by msaitoh in ticket #1912):
sys/dev/pci/ixgbe/if_bypass.c		1.10
	sys/dev/pci/ixgbe/if_fdir.c		1.6 via patch
	sys/dev/pci/ixgbe/if_sriov.c		1.18 via patch
	sys/dev/pci/ixgbe/ix_txrx.c		1.102 via patch
	sys/dev/pci/ixgbe/ixgbe.c		1.333,1.339 via patch
	sys/dev/pci/ixgbe/ixgbe.h		1.89
	sys/dev/pci/ixgbe/ixgbe_api.h		1.17
	sys/dev/pci/ixgbe/ixgbe_common.h	1.17
	sys/dev/pci/ixgbe/ixgbe_bypass.h	1.4
	sys/dev/pci/ixgbe/ixgbe_common.c	1.45
	sys/dev/pci/ixgbe/ixgbe_fdir.h		1.5
	sys/dev/pci/ixgbe/ixgbe_netmap.h	1.3
	sys/dev/pci/ixgbe/ixgbe_netmap.c	1.6
	sys/dev/pci/ixgbe/ixgbe_osdep.c		1.9
	sys/dev/pci/ixgbe/ixgbe_sriov.h		1.6
	sys/dev/pci/ixgbe/ixgbe_type.h		1.58
	sys/dev/pci/ixgbe/ixgbe_x550.c		1.27
	sys/dev/pci/ixgbe/ixv.c			1.186 via patch

ixgbe: Rename some definitions, modify comment. No functional change.
 Apply changes from FreeBSD's ix-3.3.31 and ixv-1.5.32.
    - struct adapter *adapter -> struct ixgbe_softc *sc
    - master -> primary
    - black -> block

ixg(4): Whitespace. No functional change.
2023-10-13 18:32:38 +00:00
martin 09d0842c27 Pull up following revision(s) (requested by abs in ticket #1911):
sys/dev/pci/ahcisata_pci.c: revision 1.71

Add support for ASMEDIA 0x0624
... an AHCI SATA adaptor which identifies itself as an IDE storage device
2023-10-13 18:02:02 +00:00
martin 699d56fcca Regen for ticket #1911 (add ASMEDIA 0x0624 - ASM1062 + JMB575 Port Multiplier) 2023-10-13 17:56:23 +00:00
martin 6324e2d6f4 Pull up following revision(s) (requested by abs in ticket #1911):
sys/dev/pci/pcidevs: revision 1.1496

Add entry for ASMEDIA 0x0624 - ASM1062 + JMB575 Port Multiplier
2023-10-13 17:54:46 +00:00
martin 7c93498fdf Tickets #1909 and #1910 2023-10-08 15:33:07 +00:00
martin a6e5ba7ed9 Pull up following revision(s) (requested by msaitoh in ticket #1910):
sys/dev/pci/if_wm.c: revision 1.785
	sys/dev/pci/if_wm.c: revision 1.786
	sys/dev/pci/if_wm.c: revision 1.787
	sys/dev/pci/if_wm.c: revision 1.788
	sys/dev/pci/if_wm.c: revision 1.789

wm(4): Use SCVPC and HRMPC for 82575 and newer.
  The SCVPC(SerDes/SGMII Code Violation Packet Count) register and the HRMPC
  (Header Redirection Missed Packet Count) register were added in if_wm.c
  rev. 1.776 but the location in the code were incorrect. Fix them.

wm(4): Add some info to some event counters.
 - The difference between the RUC(Rx Undersize) and RFC(Rx Fragment) is whether
   the CRC is valid or not.
 - The difference between the ROC(Rx Oversize) and RJC(Rx Jabber) is whether
   the CRC is valid or not.
 - LENERRS(Length Errors) is for the length/type field <= 1500.

wm(4): the IAC(Interrupt Assertion Count) register is for 82571 and newer.

wm(4): Modify descriptions of flow control related event counters.

wm(4): Replace /* nothing */ to __nothing for evcnt macros
Prevent empty if bodies for !WM_EVENT_COUNTERS.
2023-10-08 15:31:17 +00:00
martin 667be18905 Pull up following revision(s) (requested by msaitoh in ticket #1745):
sys/dev/pci/ixgbe/ixgbe.c		1.327-1.332 via patch
	sys/dev/pci/ixgbe/ixgbe.h		1.87-1.88
	sys/dev/pci/ixgbe/ixv.c 		1.184-1.185
	sys/dev/pci/ixgbe/ix_txrx.c		1.101
	sys/dev/pci/ixgbe/ixgbe_82599.c 	1.30
	sys/dev/pci/ixgbe/ixgbe_vf.c		1.32-1.33
	sys/dev/pci/ixgbe/ixgbe_vf.h		1.18
	sys/dev/pci/ixgbe/ixgbe_mbx.h		1.20
	sys/dev/pci/ixgbe/ixgbe_type.h		1.57

- Reorder some event counters for readability.
- Rename some descriptions of event counters.
- Count Queue Bytes {Transmit, Receive} counter.
- Improve error check in ixgbe_check_mac_link_vf().
- Add new IXGBE_VF_GET_LINK_STATE message support.
  The VF's link state can be forced to down by PF.
- Update FCTRL after writing multicast filter.
- Update comments.
2023-10-08 15:19:31 +00:00
martin 9419e274ec Ticket #1908 2023-10-04 15:18:13 +00:00
martin c8dcfbc8e1 Tickets #1900 - #1907 2023-10-03 10:15:31 +00:00
martin a000b7b4e7 Pull up following revision(s) (requested by lukem in ticket #1907):
libexec/ftpd/version.h: revision 1.80

NetBSD-ftpd 20230930

Update version to "NetBSD-ftpd 20230930" for changes:
- fix uninitialized memory usage in count_users()
- fix pam_set_item call with proper struct passed as PAM_SOCKADDR
2023-10-03 10:14:13 +00:00
martin b598b7776a Pull up following revision(s) (requested by lukem in ticket #1906):
libexec/ftpd/ftpd.c: revision 1.208

pam_set_item PAM_SOCKADDR expects sockaddr_storage structure

Instead, internal struct sockinet was used. Because it's length is shorter
than sockaddr_storage, libpam was copying also memory outside of sockinet
struct.
2023-10-03 10:12:11 +00:00
martin ab49a4af0e Pull up following revision(s) (requested by lukem in ticket #1905):
libexec/ftpd/conf.c: revision 1.65

Fix uninitialized memory usage in count_users()

If the file was previously empty, pids table is not set, the code however used
pids[0] which is uninitialized in this case. In some scenarios it may lead to
propagate garbage value from pids[0] to the file and cause writing outside of
allocated memory.

OK lukem@
2023-10-03 10:10:42 +00:00
martin 3f01b3071b Pull up following revision(s) (requested by lukem in ticket #1904):
libexec/ftpd/ftpcmd.y: revision 1.95

Add missing check_login checks for MLST and MLSD
2023-10-03 10:09:19 +00:00
martin 12c4f25362 Pull up following revision(s) (requested by lukem in ticket #1903):
libexec/ftpd/ftpd.c: revision 1.207
	libexec/ftpd/version.h: revision 1.78

ftpd: improve seteuid error handling

Handle seteuid() failures. Per suggestion by Simon Josefsson.

Consistent logging and fatal exit if uid/gid switching fails.

Log correct errno if dataconn() fails.
2023-10-03 10:07:44 +00:00
martin 54810be7b8 Pull up following revision(s) (requested by lukem in ticket #1902):
libexec/ftpd/ftpd.c: revision 1.206

Treat failed chdir/chroot for guest and chroot accounts as fatal.

Also treat failed set{e,}(u,g}id calls as fatal.

Addresses CVE-2020-7468, via FreeBSD.
2023-10-03 10:05:06 +00:00
martin 57f3d7e432 Pull up following revision(s) (requested by lukem in ticket #1901):
libexec/ftpd/extern.h: revision 1.65
	libexec/ftpd/ftpd.c: revision 1.205

bump sizes
2023-10-03 10:03:24 +00:00
martin 88597528ed Pull up following revision(s) (requested by lukem in ticket #1900):
libexec/ftpd/ftpd.8: revision 1.87
	libexec/ftpd/ftpd.c: revision 1.204

Add -f option to ftpd to stay in foreground with -D.

From nia in PR bin/53221.
2023-10-03 09:54:24 +00:00
martin c86651f48b Tickets #1898 and #1899 2023-10-02 17:41:04 +00:00
martin 22e91ac9f8 Pull up following revision(s) (requested by gutteridge in ticket #1899):
share/examples/wpa_supplicant/wpa_supplicant.conf: revision 1.4

wpa_supplicant.conf: fix connection string for Eduroam
"MSCHAPV2" must have an uppercase "V" in the connection string.

Reported by nebbionegiuseppe at gmail.com in PR misc/57634.
2023-10-02 13:36:06 +00:00
martin 8bea580d3b Pull up following revision(s) (requested by riastradh in ticket #1898):
lib/libpam/modules/pam_krb5/pam_krb5.c: revision 1.32

pam_krb5: Fix PR lib/57631.

Loose ends in the fix for NetBSD-SA2023-006 that weren't caught by
review or, somehow, by my own testing.  Evidently we need automatic
tests for this pam business.
2023-10-02 13:09:01 +00:00
martin d75c34abb3 Ticket #1897 2023-09-15 15:45:19 +00:00
martin f12acc4481 Pull up following revision(s) (requested by rin in ticket #1897):
sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.22
	sys/arch/i386/stand/efiboot/eficpufunc.c: revision 1.1
	sys/arch/i386/stand/efiboot/eficpufunc.h: revision 1.1
	sys/arch/i386/stand/efiboot/eficons.c: revision 1.13
	sys/arch/i386/stand/efiboot/eficons.c: revision 1.14

efiboot/x86: Add serial console support via raw I/O port access

Unfortunately, some (most?) UEFI implementations do not support
com ports by ``Serial I/O Protocol''.
``PNP0501-0'' and friends are not recognized also.

In this case, if user explicitly requires to switch to serial
console by ``consdev'' command, try to use raw I/O port access.

Ugly, but what FreeBSD does, at least.
Proposed as PR port-amd64/57523

efiboot/x86: eficons.c: Explicitly include params.h for howmany()

NFC for -current and netbsd-10, but necessary for netbsd-[89] to
pull up raw IO serial port support (PR port-amd64/57523).
2023-09-15 15:44:20 +00:00
martin 25b8052065 Ticket #1896 2023-09-08 09:10:54 +00:00
martin bb549d4dda Pull up following revision(s) (requested by riastradh in ticket #1896):
lib/libpam/modules/pam_ksu/pam_ksu.c: revision 1.11

pam_ksu(8): Allow homedir access during kuserok.

Otherwise, the default kuserok logic to look at ~targetuser/.k5login
would be blocked by the security measure to thwart NetBSD-SA2023-005.

(There are other ways, e.g. setting SYSTEM-K5LOGIN in /etc/krb5.conf
so the file is /etc/k5login.d/user instead of ~user/.k5login, but
that's not the default configuration and there are plenty of
deployments that rely on ~user/.k5login today.)

I reviewed libkrb5 for homedir access checks.  There are three:
1. krb5_config_parse_file_multi, called only by:
   - verify_krb5_conf -- not relevant
   - krb5_config_parse_file -- not used here as far as I can tell,
     only by libhdb ldap logic and test code in heimdal
   - krb5_set_config_files -- used here only via krb5_init_context,
     which is done at this point
2. plugin_get_hosts in krbhst.c, used to look up hosts for KDC I/O,
   which shouldn't be happening at this point, so this is almost
   certainly unreachable; also it only appears to control whether
   some old plugin API can be used, long after we have read the krb5
   config controlling which plugins are available, so this is
   probably harmless
3. krb5_kuserok, which is the one we want to allow

Note: This will have to be updated again in the next Heimdal update,
which eliminates the global homedir access flag in favour of making
the default per-context homedir access flag conditional on !issuid.
2023-09-08 09:09:56 +00:00
martin d4eab99e7c Ticket #1895 2023-09-06 08:04:43 +00:00
martin 8f46ba3acd Pull up following revision(s) (requested by mrg in ticket #1895):
crypto/external/bsd/openssl/dist/crypto/sparccpuid.S: revision 1.11

fix SPARC v8/v9 detection code.

this code uses a trick where the encoding on both v8 and v9 are
the same, and are not illegal instructions, but that the v9 one
has a detectable difference than v8.

the idea is that we perform a "subcc" (set condition codes) which
sets "%ccr" on v9, which is an unimplemented "%asr2" on v8, then
we read %ccr (v9) or %asr2 (v8), which will always be 0x99 on v9,
and .. is non-trapping but impleentation defined on v8.

for many implementations this returns the value of the %y reg.

as nothing actually sets %y in this path, it remains the value it
was most recently set to by something (anything), and if it just
happens to be 0x99 then the v9 paths will be taken on v8.

fix this by clearing the %y register before the potential read.

fixes PR port-sparc/57594.  tested on ss20 and in qemu.  this
version of the patch has been submitted upstream.
2023-09-06 08:03:45 +00:00
martin 317ec86252 Ticket #1894 2023-09-04 18:00:03 +00:00
martin a6fbedfa1a Pull up following revision(s) (requested by msaitoh in ticket #1894):
sys/dev/pci/if_wmvar.h: revision 1.50
	sys/dev/pci/if_wm.c: revision 1.783,1.784 via patch

Delay sending LINK_STATE_UP to prevent dropping packets on I35[04] and I21[01].

 Some (not all) systems use I35[04] or I21[01] don't send packet soon
after linkup. The MAC send a packet to the PHY and any error is not
observed. This behavior causes a problem that gratuitous ARP and/or
IPv6 DAD packet are silently dropped. To avoid this problem, don't
call mii_pollstat() here which will send LINK_STATE_UP notification
to the upper layer. Instead, mii_pollstat() will be called in
wm_gmii_mediastatus() or mii_tick() will be called in wm_tick().

Note that the similar workaround is in Linux's igb driver though it's
only for I21[01].

OK'd by hikaru@ and knakahara@.

Fix #ifdef WM_DEBUG code in wm_gmii_i82544_{read,write}reg_locked.
2023-09-04 17:57:49 +00:00
martin c9e6c99ebf Tickets #1890 - #1893 2023-08-23 18:26:40 +00:00
martin 3f475198a3 Pull up following revision(s) (requested by kardel in ticket #1893):
sys/net/npf/npf_ruleset.c: revision 1.52

The analysis documented in PR misc/56990 is correct.

Fix by not returning when encountering a ruleset rule.

The code up to now would stop at any group rule.
ruleset rules are marked as group rule and a dynamic rule.
processing is only finished when a result is present AND
we are looking at a plain group rule.
2023-08-23 18:25:04 +00:00
martin 59ab0660c7 Pull up following revision(s) (requested by msaitoh in ticket #1892):
usr.sbin/cpuctl/cpuctl.8: revision 1.21
	usr.sbin/cpuctl/cpuctl.c: revision 1.33

Unless -v is given, ignore EEXIST errors from the IOC_CPU_UCODE_APPLY ioctl()
used to implement "cpuctl ucode N",  which indicates that the microcode
to be loaded already exists in the CPU, and as such, isn't really a
very interesting "error".
2023-08-23 18:10:06 +00:00
martin 66a70b7c05 Pull up following revision(s) (requested by msaitoh in ticket #1891):
sys/dev/pci/ichsmb.c: revision 1.85
	sys/dev/pci/ismt.c: revision 1.11

ichsmb(4),ismt(4): Add Snow Ridge support.
2023-08-23 17:16:13 +00:00
martin e9bf6d89e0 Pull up following revision(s) (requested by msaitoh in ticket #1890):
sys/arch/x86/pci/pci_machdep.c: revision 1.94

Fix detection of availability of MSI/MSI-X on some systems.

Try to find all functions on bus 0, device 0 to find a PCI host bridge.
Some CPU's host bridge is at 0:0.4. Tested by Intel Snow Ridge.
2023-08-23 17:10:57 +00:00
martin 7778d3fefa Tickets #1888 and #1889 2023-08-22 16:22:00 +00:00
martin 42b13f03f8 Pull up following revision(s) (requested by msaitoh in ticket #1889):
sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.
2023-08-22 16:19:57 +00:00
martin e73679de34 Pull up following revision(s) (requested by msaitoh in ticket #1888):
sys/arch/x86/pci/amdzentemp.c: revision 1.20
	sys/arch/x86/pci/amdsmn.c: revision 1.17
	sys/arch/x86/pci/amdzentemp.c: revision 1.19

Add Zen4 Ryzen "Phoenix" support.
Add Zen2 Mendocino APU support.
Add Zen4 Phoenix support.
2023-08-22 16:12:54 +00:00
martin fb943c8e50 Ticket #1887 2023-08-21 12:41:29 +00:00