diff options
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/amd64/conf/NOTES | 1 | ||||
| -rw-r--r-- | sys/cam/nvme/nvme_da.c | 9 | ||||
| -rw-r--r-- | sys/conf/NOTES | 2 | ||||
| -rw-r--r-- | sys/dev/cxgbe/common/t4_msg.h | 2 | ||||
| -rw-r--r-- | sys/dev/cxgbe/t4_main.c | 27 | ||||
| -rw-r--r-- | sys/dev/e1000/if_em.c | 2 | ||||
| -rw-r--r-- | sys/dev/irdma/icrdma.c | 4 | ||||
| -rw-r--r-- | sys/dev/irdma/irdma_cm.c | 38 | ||||
| -rw-r--r-- | sys/dev/irdma/irdma_hw.c | 132 | ||||
| -rw-r--r-- | sys/dev/irdma/irdma_main.h | 3 | ||||
| -rw-r--r-- | sys/dev/nvme/nvme.h | 18 | ||||
| -rw-r--r-- | sys/dev/nvme/nvme_ctrlr.c | 2 | ||||
| -rw-r--r-- | sys/kern/firmw.S | 2 | ||||
| -rw-r--r-- | sys/kern/kern_prot.c | 112 | ||||
| -rw-r--r-- | sys/modules/agp/Makefile | 1 | ||||
| -rw-r--r-- | sys/net/if.h | 4 | ||||
| -rw-r--r-- | sys/netlink/netlink_snl.h | 27 | ||||
| -rw-r--r-- | sys/netpfil/pf/pf.c | 6 | ||||
| -rw-r--r-- | sys/riscv/conf/GENERIC | 1 | ||||
| -rw-r--r-- | sys/sys/efi-edk2.h | 2 | ||||
| -rw-r--r-- | sys/sys/syscallsubr.h | 2 | ||||
| -rw-r--r-- | sys/vm/vm_object.c | 3 |
22 files changed, 224 insertions, 176 deletions
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index e0a9e1b77d93..d48fd10c0e62 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -172,5 +172,4 @@ options PV_STATS #options KUBSAN # Kernel Undefined Behavior Sanitizer #options KCSAN # Kernel Concurrency Sanitizer #options KASAN # Kernel Address Sanitizer -#options KCSAN # Kernel Concurrency Sanitizer #options KMSAN # Kernel Memory Sanitizer diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 506fce3d99d3..833738cfcb98 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -648,7 +648,6 @@ static void ndasetgeom(struct nda_softc *softc, struct cam_periph *periph) { struct disk *disk = softc->disk; - struct ccb_pathinq cpi; const struct nvme_namespace_data *nsd; const struct nvme_controller_data *cd; uint8_t flbas_fmt, lbads, vwc_present; @@ -667,10 +666,6 @@ ndasetgeom(struct nda_softc *softc, struct cam_periph *periph) vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc); if (vwc_present) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { - disk->d_flags |= DISKFLAG_UNMAPPED_BIO; - softc->unmappedio = 1; - } } static void @@ -944,6 +939,10 @@ ndaregister(struct cam_periph *periph, void *arg) maxio = maxphys; /* for safety */ disk->d_maxsize = maxio; ndasetgeom(softc, periph); + if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { + disk->d_flags |= DISKFLAG_UNMAPPED_BIO; + softc->unmappedio = 1; + } /* * d_ident and d_descr are both far bigger than the length of either diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 3d5f7dd8a71b..8a11f8ec86b1 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1727,7 +1727,7 @@ device ata # Legacy ATA/SATA controllers # PCI ATA chipsets #device ataacard # ACARD #device ataacerlabs # Acer Labs Inc. (ALI) -#device ataamd # American Micro Devices (AMD) +#device ataamd # Advanced Micro Devices (AMD) #device ataati # ATI #device atacenatek # Cenatek #device atacypress # Cypress diff --git a/sys/dev/cxgbe/common/t4_msg.h b/sys/dev/cxgbe/common/t4_msg.h index 214080964fbb..31a52dbb616e 100644 --- a/sys/dev/cxgbe/common/t4_msg.h +++ b/sys/dev/cxgbe/common/t4_msg.h @@ -2478,7 +2478,7 @@ struct cpl_rx_data_ack_core { #define F_RX_DACK_CHANGE V_RX_DACK_CHANGE(1U) struct cpl_rx_phys_addr { - __be32 RSS[2]; + __be32 rss[2]; __be32 op_to_tid; __be32 pci_rlx_order_to_len; __be64 phys_addr; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 15b3fd94fa54..5e02b47da8d9 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2817,7 +2817,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS | \ - IFCAP_HWRXTSTMP | IFCAP_MEXTPG) + IFCAP_HWRXTSTMP | IFCAP_MEXTPG | IFCAP_NV) #define T4_CAP_ENABLE (T4_CAP) static void @@ -3065,7 +3065,7 @@ cxgbe_ioctl(if_t ifp, unsigned long cmd, caddr_t data) struct port_info *pi = vi->pi; struct adapter *sc = pi->adapter; struct ifreq *ifr = (struct ifreq *)data; - uint32_t mask; + uint32_t mask, mask2; switch (cmd) { case SIOCSIFMTU: @@ -3124,12 +3124,24 @@ cxgbe_ioctl(if_t ifp, unsigned long cmd, caddr_t data) end_synchronized_op(sc, 0); break; + case SIOCGIFCAPNV: + break; + case SIOCSIFCAPNV: case SIOCSIFCAP: rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4cap"); if (rc) return (rc); - mask = ifr->ifr_reqcap ^ if_getcapenable(ifp); + if (cmd == SIOCSIFCAPNV) { + const struct siocsifcapnv_driver_data *ifr_nv = + (struct siocsifcapnv_driver_data *)data; + + mask = ifr_nv->reqcap ^ if_getcapenable(ifp); + mask2 = ifr_nv->reqcap2 ^ if_getcapenable2(ifp); + } else { + mask = ifr->ifr_reqcap ^ if_getcapenable(ifp); + mask2 = 0; + } if (mask & IFCAP_TXCSUM) { if_togglecapenable(ifp, IFCAP_TXCSUM); if_togglehwassist(ifp, CSUM_TCP | CSUM_UDP | CSUM_IP); @@ -3264,6 +3276,9 @@ cxgbe_ioctl(if_t ifp, unsigned long cmd, caddr_t data) CSUM_INNER_IP_TSO); } + MPASS(mask2 == 0); + (void)mask2; + #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); #endif @@ -7194,11 +7209,10 @@ vi_full_init(struct vi_info *vi) { struct adapter *sc = vi->adapter; struct sge_rxq *rxq; - int rc, i, j; + int rc, i, j, extra; int hashconfig = rss_gethashconfig(); #ifdef RSS int nbuckets = rss_getnumbuckets(); - int extra; #endif ASSERT_SYNCHRONIZED_OP(sc); @@ -7255,7 +7269,6 @@ vi_full_init(struct vi_info *vi) vi->hashen = hashconfig_to_hashen(hashconfig); -#ifdef RSS /* * We may have had to enable some hashes even though the global config * wants them disabled. This is a potential problem that must be @@ -7289,7 +7302,7 @@ vi_full_init(struct vi_info *vi) CH_ALERT(vi, "UDP/IPv4 4-tuple hashing forced on.\n"); if (extra & RSS_HASHTYPE_RSS_UDP_IPV6) CH_ALERT(vi, "UDP/IPv6 4-tuple hashing forced on.\n"); -#endif + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, vi->rss[0], 0, 0); if (rc != 0) { diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index bc841ba87ceb..7d7655a7ae6f 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3638,7 +3638,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) bus_addr = txr->tx_paddr; /* Clear checksum offload context. */ - offp = (caddr_t)&txr->csum_flags; + offp = (caddr_t)txr + offsetof(struct tx_ring, csum_flags); endp = (caddr_t)(txr + 1); bzero(offp, endp - offp); diff --git a/sys/dev/irdma/icrdma.c b/sys/dev/irdma/icrdma.c index 576a185b013f..a4f3904a820c 100644 --- a/sys/dev/irdma/icrdma.c +++ b/sys/dev/irdma/icrdma.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2021 - 2023 Intel Corporation + * Copyright (c) 2021 - 2025 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -52,7 +52,7 @@ /** * Driver version */ -char irdma_driver_version[] = "1.2.36-k"; +char irdma_driver_version[] = "1.2.37-k"; /** * irdma_init_tunable - prepare tunables diff --git a/sys/dev/irdma/irdma_cm.c b/sys/dev/irdma/irdma_cm.c index d4d4f328fb43..f3ca761b32f6 100644 --- a/sys/dev/irdma/irdma_cm.c +++ b/sys/dev/irdma/irdma_cm.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2023 Intel Corporation + * Copyright (c) 2015 - 2025 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -1683,31 +1683,6 @@ irdma_get_vlan_ipv4(struct iw_cm_id *cm_id, u32 *addr) return vlan_id; } -static int -irdma_manage_qhash_wait(struct irdma_pci_f *rf, struct irdma_cm_info *cm_info) -{ - struct irdma_cqp_request *cqp_request = cm_info->cqp_request; - int cnt = rf->sc_dev.hw_attrs.max_cqp_compl_wait_time_ms * CQP_TIMEOUT_THRESHOLD; - u32 ret_val; - - if (!cqp_request) - return -ENOMEM; - do { - irdma_cqp_ce_handler(rf, &rf->ccq.sc_cq); - mdelay(1); - } while (!READ_ONCE(cqp_request->request_done) && --cnt); - - ret_val = cqp_request->compl_info.op_ret_val; - irdma_put_cqp_request(&rf->cqp, cqp_request); - if (cnt) { - if (!ret_val) - return 0; - return -EINVAL; - } - - return -ETIMEDOUT; -} - /** * irdma_add_mqh_ifa_cb - Adds multiple qhashes for IPv4/IPv6 * @arg: Calback argument structure from irdma_add_mqh @@ -1771,16 +1746,7 @@ irdma_add_mqh_ifa_cb(void *arg, struct ifaddr *ifa, u_int count) irdma_iw_get_vlan_prio(child_listen_node->loc_addr, cm_info->user_pri, cm_info->ipv4); - ret = irdma_manage_qhash(iwdev, cm_info, - IRDMA_QHASH_TYPE_TCP_SYN, - IRDMA_QHASH_MANAGE_TYPE_ADD, - NULL, false); - if (ret) { - kfree(child_listen_node); - return ret; - } - /* wait for qhash finish */ - ret = irdma_manage_qhash_wait(iwdev->rf, cm_info); + ret = irdma_add_qhash_wait_no_lock(iwdev, cm_info); if (ret) { kfree(child_listen_node); return ret; diff --git a/sys/dev/irdma/irdma_hw.c b/sys/dev/irdma/irdma_hw.c index 05004b1ccc83..64c05b8663e0 100644 --- a/sys/dev/irdma/irdma_hw.c +++ b/sys/dev/irdma/irdma_hw.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2023 Intel Corporation + * Copyright (c) 2015 - 2025 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -2581,35 +2581,22 @@ irdma_send_syn_cqp_callback(struct irdma_cqp_request *cqp_request) } /** - * irdma_manage_qhash - add or modify qhash + * irdma_qhash_info_prepare - fill info for qhash op * @iwdev: irdma device + * @cqp_info: cqp info * @cminfo: cm info for qhash * @etype: type (syn or quad) * @mtype: type of qhash - * @cmnode: cmnode associated with connection - * @wait: wait for completion */ -int -irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo, - enum irdma_quad_entry_type etype, - enum irdma_quad_hash_manage_type mtype, void *cmnode, - bool wait) +static void +irdma_qhash_info_prepare(struct irdma_device *iwdev, + struct cqp_cmds_info *cqp_info, + struct irdma_cm_info *cminfo, + enum irdma_quad_entry_type etype, + enum irdma_quad_hash_manage_type mtype) { struct irdma_qhash_table_info *info; - struct irdma_cqp *iwcqp = &iwdev->rf->cqp; - struct irdma_cqp_request *cqp_request; - struct cqp_cmds_info *cqp_info; - struct irdma_cm_node *cm_node = cmnode; - int status; - - cqp_request = irdma_alloc_and_get_cqp_request(iwcqp, wait); - if (!cqp_request) - return -ENOMEM; - cminfo->cqp_request = cqp_request; - if (!wait) - atomic_inc(&cqp_request->refcnt); - cqp_info = &cqp_request->info; info = &cqp_info->in.u.manage_qhash_table_entry.info; memset(info, 0, sizeof(*info)); info->vsi = &iwdev->vsi; @@ -2641,6 +2628,105 @@ irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo, info->src_ip[2] = cminfo->rem_addr[2]; info->src_ip[3] = cminfo->rem_addr[3]; } + cqp_info->cqp_cmd = IRDMA_OP_MANAGE_QHASH_TABLE_ENTRY; + cqp_info->post_sq = 1; +} + +/** + * irdma_add_qhash_wait_no_lock - add qhash, blocking w/o lock + * @iwdev: irdma device + * @cminfo: cm info for qhash + */ +int +irdma_add_qhash_wait_no_lock(struct irdma_device *iwdev, + struct irdma_cm_info *cminfo) +{ + struct irdma_qhash_table_info *info; + struct irdma_cqp *iwcqp = &iwdev->rf->cqp; + struct irdma_cqp_request *cqp_request; + struct cqp_cmds_info *cqp_info; + int cnt = iwdev->rf->sc_dev.hw_attrs.max_cqp_compl_wait_time_ms * CQP_TIMEOUT_THRESHOLD; + int status; + int ret_val; + + cqp_request = irdma_alloc_and_get_cqp_request(iwcqp, false); + if (!cqp_request) + return -ENOMEM; + + cqp_info = &cqp_request->info; + info = &cqp_info->in.u.manage_qhash_table_entry.info; + irdma_qhash_info_prepare(iwdev, cqp_info, cminfo, IRDMA_QHASH_TYPE_TCP_SYN, + IRDMA_QHASH_MANAGE_TYPE_ADD); + if (info->ipv4_valid) + irdma_debug(&iwdev->rf->sc_dev, IRDMA_DEBUG_CM, + "ADD caller: %pS loc_port=0x%04x rem_port=0x%04x loc_addr=%x rem_addr=%x mac=%x:%x:%x:%x:%x:%x, vlan_id=%d\n", + __builtin_return_address(0), info->src_port, + info->dest_port, info->src_ip[0], info->dest_ip[0], + info->mac_addr[0], info->mac_addr[1], + info->mac_addr[2], info->mac_addr[3], + info->mac_addr[4], info->mac_addr[5], + cminfo->vlan_id); + else + irdma_debug(&iwdev->rf->sc_dev, IRDMA_DEBUG_CM, + "ADD caller: %pS loc_port=0x%04x rem_port=0x%04x loc_addr=%x:%x:%x:%x rem_addr=%x:%x:%x:%x mac=%x:%x:%x:%x:%x:%x, vlan_id=%d\n", + __builtin_return_address(0), info->src_port, + info->dest_port, IRDMA_PRINT_IP6(info->src_ip), + IRDMA_PRINT_IP6(info->dest_ip), info->mac_addr[0], + info->mac_addr[1], info->mac_addr[2], + info->mac_addr[3], info->mac_addr[4], + info->mac_addr[5], cminfo->vlan_id); + + cqp_info->in.u.manage_qhash_table_entry.cqp = &iwdev->rf->cqp.sc_cqp; + cqp_info->in.u.manage_qhash_table_entry.scratch = (uintptr_t)cqp_request; + status = irdma_handle_cqp_op(iwdev->rf, cqp_request); + if (status) { + irdma_put_cqp_request(iwcqp, cqp_request); + irdma_dev_warn(&iwdev->ibdev, "manage_qhash cqp op failure %d\n", status); + return status; + } + + do { + irdma_cqp_ce_handler(iwdev->rf, &iwdev->rf->ccq.sc_cq); + mdelay(1); + } while (!READ_ONCE(cqp_request->request_done) && --cnt); + + ret_val = cqp_request->compl_info.op_ret_val; + status = (cnt) ? ret_val : -ETIMEDOUT; + + irdma_put_cqp_request(iwcqp, cqp_request); + + return status; +} + +/** + * irdma_manage_qhash - add or modify qhash + * @iwdev: irdma device + * @cminfo: cm info for qhash + * @etype: type (syn or quad) + * @mtype: type of qhash + * @cmnode: cmnode associated with connection + * @wait: wait for completion + */ +int +irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo, + enum irdma_quad_entry_type etype, + enum irdma_quad_hash_manage_type mtype, void *cmnode, + bool wait) +{ + struct irdma_qhash_table_info *info; + struct irdma_cqp *iwcqp = &iwdev->rf->cqp; + struct irdma_cqp_request *cqp_request; + struct cqp_cmds_info *cqp_info; + struct irdma_cm_node *cm_node = cmnode; + int status; + + cqp_request = irdma_alloc_and_get_cqp_request(iwcqp, wait); + if (!cqp_request) + return -ENOMEM; + + cqp_info = &cqp_request->info; + info = &cqp_info->in.u.manage_qhash_table_entry.info; + irdma_qhash_info_prepare(iwdev, cqp_info, cminfo, etype, mtype); if (cmnode) { cqp_request->callback_fcn = irdma_send_syn_cqp_callback; cqp_request->param = cmnode; @@ -2671,8 +2757,6 @@ irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo, cqp_info->in.u.manage_qhash_table_entry.cqp = &iwdev->rf->cqp.sc_cqp; cqp_info->in.u.manage_qhash_table_entry.scratch = (uintptr_t)cqp_request; - cqp_info->cqp_cmd = IRDMA_OP_MANAGE_QHASH_TABLE_ENTRY; - cqp_info->post_sq = 1; status = irdma_handle_cqp_op(iwdev->rf, cqp_request); if (status && cm_node && !wait) irdma_rem_ref_cm_node(cm_node); diff --git a/sys/dev/irdma/irdma_main.h b/sys/dev/irdma/irdma_main.h index 5b292ceafea8..9181f3b70463 100644 --- a/sys/dev/irdma/irdma_main.h +++ b/sys/dev/irdma/irdma_main.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2023 Intel Corporation + * Copyright (c) 2015 - 2025 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -563,6 +563,7 @@ int irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo, enum irdma_quad_entry_type etype, enum irdma_quad_hash_manage_type mtype, void *cmnode, bool wait); +int irdma_add_qhash_wait_no_lock(struct irdma_device *iwdev, struct irdma_cm_info *cminfo); void irdma_receive_ilq(struct irdma_sc_vsi *vsi, struct irdma_puda_buf *rbuf); void irdma_free_sqbuf(struct irdma_sc_vsi *vsi, void *bufp); void irdma_free_qp_rsrc(struct irdma_qp *iwqp); diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index c8eba3df9c2a..61e4aa8cb94b 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -29,15 +29,13 @@ #ifndef __NVME_H__ #define __NVME_H__ -#ifdef _KERNEL -#include <sys/types.h> -#endif - #include <sys/param.h> -#include <sys/endian.h> -#ifndef _KERNEL +#ifdef _KERNEL +#include <sys/systm.h> +#else #include <stdbool.h> #endif +#include <sys/endian.h> struct sbuf; @@ -1540,8 +1538,7 @@ enum nvme_log_page { /* 0xC0-0xFF - vendor specific */ /* - * The following are Intel Specific log pages, but they seem - * to be widely implemented. + * The following are Intel Specific log pages for older models. */ INTEL_LOG_READ_LAT_LOG = 0xc1, INTEL_LOG_WRITE_LAT_LOG = 0xc2, @@ -1550,7 +1547,7 @@ enum nvme_log_page { INTEL_LOG_DRIVE_MKT_NAME = 0xdd, /* - * HGST log page, with lots ofs sub pages. + * HGST log page, with lots of sub pages. */ HGST_INFO_LOG = 0xc1, }; @@ -1910,7 +1907,6 @@ void nvme_sc_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf); void nvme_strvis(uint8_t *dst, const uint8_t *src, int dstlen, int srclen); #ifdef _KERNEL -#include <sys/systm.h> #include <sys/disk.h> struct bio; @@ -2194,7 +2190,7 @@ void nvme_namespace_data_swapbytes(struct nvme_namespace_data *s __unused) s->anagrpid = le32toh(s->anagrpid); s->nvmsetid = le16toh(s->nvmsetid); s->endgid = le16toh(s->endgid); - for (unsigned i = 0; i < nitems(s->lbaf); i++) + for (unsigned int i = 0; i < nitems(s->lbaf); i++) s->lbaf[i] = le32toh(s->lbaf[i]); #endif } diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 41542d24c107..1ad4735cbef8 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -907,7 +907,7 @@ again: size = sizeof(struct nvme_hmb_desc) * ctrlr->hmb_nchunks; err = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), - 16, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ctrlr->hmb_desc_tag); if (err != 0) { nvme_printf(ctrlr, "HMB desc tag create failed %d\n", err); diff --git a/sys/kern/firmw.S b/sys/kern/firmw.S index cd808d4a9396..1d74f17e449e 100644 --- a/sys/kern/firmw.S +++ b/sys/kern/firmw.S @@ -35,7 +35,7 @@ #define FIRMW_START(S) __CONCAT(_binary_, __CONCAT(S, _start)) #define FIRMW_END(S) __CONCAT(_binary_, __CONCAT(S, _end)) - .section rodata, "a", %progbits + .section .rodata, "a", %progbits .globl FIRMW_START(FIRMW_SYMBOL) .type FIRMW_START(FIRMW_SYMBOL), %object FIRMW_START(FIRMW_SYMBOL): diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 8021beed90e8..34d68927be71 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -526,44 +526,44 @@ gidp_cmp(const void *p1, const void *p2) } /* - * Final storage for supplementary groups will be returned via 'groups'. - * '*groups' must be NULL on input, and if not equal to 'smallgroups' - * on output, must be freed (M_TEMP) *even if* an error is returned. + * 'smallgroups' must be an (uninitialized) array of length CRED_SMALLGROUPS_NB. + * Always sets 'sc_supp_groups', either to a valid kernel-space groups array + * (which may or may not be 'smallgroups'), or NULL if SETCREDF_SUPP_GROUPS was + * not specified, or a buffer containing garbage on copyin() failure. In the + * last two cases, 'sc_supp_groups_nb' is additionally set to 0 as a security + * measure. 'sc_supp_groups' must be freed (M_TEMP) if not equal to + * 'smallgroups' even on failure. */ static int kern_setcred_copyin_supp_groups(struct setcred *const wcred, - const u_int flags, gid_t *const smallgroups, gid_t **const groups) + const u_int flags, gid_t *const smallgroups) { - MPASS(*groups == NULL); + gid_t *groups; + int error; - if (flags & SETCREDF_SUPP_GROUPS) { - int error; + if ((flags & SETCREDF_SUPP_GROUPS) == 0) { + wcred->sc_supp_groups_nb = 0; + wcred->sc_supp_groups = NULL; + return (0); + } - /* - * Check for the limit for number of groups right now in order - * to limit the amount of bytes to copy. - */ - if (wcred->sc_supp_groups_nb > ngroups_max) - return (EINVAL); + /* + * Check the number of groups' limit right now in order to limit the + * amount of bytes to copy. + */ + if (wcred->sc_supp_groups_nb > ngroups_max) + return (EINVAL); - /* - * Since we are going to be copying the supplementary groups - * from userland, make room also for the effective GID right - * now, to avoid having to allocate and copy again the - * supplementary groups. - */ - *groups = wcred->sc_supp_groups_nb <= CRED_SMALLGROUPS_NB ? - smallgroups : malloc(wcred->sc_supp_groups_nb * - sizeof(*groups), M_TEMP, M_WAITOK); + groups = wcred->sc_supp_groups_nb <= CRED_SMALLGROUPS_NB ? + smallgroups : malloc(wcred->sc_supp_groups_nb * sizeof(gid_t), + M_TEMP, M_WAITOK); - error = copyin(wcred->sc_supp_groups, *groups, - wcred->sc_supp_groups_nb * sizeof(*groups)); - if (error != 0) - return (error); - wcred->sc_supp_groups = *groups; - } else { + error = copyin(wcred->sc_supp_groups, groups, + wcred->sc_supp_groups_nb * sizeof(gid_t)); + wcred->sc_supp_groups = groups; + if (error != 0) { wcred->sc_supp_groups_nb = 0; - wcred->sc_supp_groups = NULL; + return (error); } return (0); @@ -578,7 +578,6 @@ user_setcred(struct thread *td, const u_int flags, struct setcred *const wcred) void *umac; #endif gid_t smallgroups[CRED_SMALLGROUPS_NB]; - gid_t *groups = NULL; int error; /* @@ -602,8 +601,7 @@ user_setcred(struct thread *td, const u_int flags, struct setcred *const wcred) * alternative for 32-bit compatibility as 'gid_t' has the same size * everywhere. */ - error = kern_setcred_copyin_supp_groups(wcred, flags, smallgroups, - &groups); + error = kern_setcred_copyin_supp_groups(wcred, flags, smallgroups); if (error != 0) goto free_groups; @@ -616,7 +614,7 @@ user_setcred(struct thread *td, const u_int flags, struct setcred *const wcred) } #endif - error = kern_setcred(td, flags, wcred, groups); + error = kern_setcred(td, flags, wcred); #ifdef MAC if (wcred->sc_label != NULL) @@ -624,8 +622,8 @@ user_setcred(struct thread *td, const u_int flags, struct setcred *const wcred) #endif free_groups: - if (groups != smallgroups) - free(groups, M_TEMP); + if (wcred->sc_supp_groups != smallgroups) + free(wcred->sc_supp_groups, M_TEMP); return (error); } @@ -654,24 +652,18 @@ sys_setcred(struct thread *td, struct setcred_args *uap) /* * CAUTION: This function normalizes groups in 'wcred'. - * - * If 'preallocated_groups' is non-NULL, it must be an already allocated array - * of size 'wcred->sc_supp_groups_nb' containing the supplementary groups, and - * 'wcred->sc_supp_groups' then must point to it. */ int kern_setcred(struct thread *const td, const u_int flags, - struct setcred *const wcred, gid_t *preallocated_groups) + struct setcred *const wcred) { struct proc *const p = td->td_proc; - struct ucred *new_cred, *old_cred, *to_free_cred; + struct ucred *new_cred, *old_cred, *to_free_cred = NULL; struct uidinfo *uip = NULL, *ruip = NULL; #ifdef MAC void *mac_set_proc_data = NULL; bool proc_label_set = false; #endif - gid_t *groups = NULL; - gid_t smallgroups[CRED_SMALLGROUPS_NB]; int error; bool cred_set = false; @@ -683,32 +675,18 @@ kern_setcred(struct thread *const td, const u_int flags, * Part 1: We allocate and perform preparatory operations with no locks. */ - if (flags & SETCREDF_SUPP_GROUPS) { - if (wcred->sc_supp_groups_nb > ngroups_max) + if ((flags & SETCREDF_SUPP_GROUPS) != 0 && + wcred->sc_supp_groups_nb > ngroups_max) return (EINVAL); - if (preallocated_groups != NULL) { - groups = preallocated_groups; - MPASS(preallocated_groups == wcred->sc_supp_groups); - } else { - if (wcred->sc_supp_groups_nb <= CRED_SMALLGROUPS_NB) - groups = smallgroups; - else - groups = malloc(wcred->sc_supp_groups_nb * - sizeof(*groups), M_TEMP, M_WAITOK); - memcpy(groups, wcred->sc_supp_groups, - wcred->sc_supp_groups_nb * sizeof(*groups)); - } - } if (flags & SETCREDF_MAC_LABEL) { #ifdef MAC error = mac_set_proc_prepare(td, wcred->sc_label, &mac_set_proc_data); if (error != 0) - goto free_groups; + return (error); #else - error = ENOTSUP; - goto free_groups; + return (ENOTSUP); #endif } @@ -734,8 +712,10 @@ kern_setcred(struct thread *const td, const u_int flags, * Output the raw supplementary groups array for better * traceability. */ - AUDIT_ARG_GROUPSET(groups, wcred->sc_supp_groups_nb); - groups_normalize(&wcred->sc_supp_groups_nb, groups); + AUDIT_ARG_GROUPSET(wcred->sc_supp_groups, + wcred->sc_supp_groups_nb); + groups_normalize(&wcred->sc_supp_groups_nb, + wcred->sc_supp_groups); } /* @@ -776,7 +756,7 @@ kern_setcred(struct thread *const td, const u_int flags, */ if (flags & SETCREDF_SUPP_GROUPS) crsetgroups_internal(new_cred, wcred->sc_supp_groups_nb, - groups); + wcred->sc_supp_groups); if (flags & SETCREDF_GID) change_egid(new_cred, wcred->sc_gid); if (flags & SETCREDF_RGID) @@ -863,9 +843,7 @@ unlock_finish: uifree(uip); if (ruip != NULL) uifree(ruip); -free_groups: - if (groups != preallocated_groups && groups != smallgroups) - free(groups, M_TEMP); /* Deals with 'groups' being NULL. */ + return (error); } diff --git a/sys/modules/agp/Makefile b/sys/modules/agp/Makefile index d27a78b7e437..f24f05f28407 100644 --- a/sys/modules/agp/Makefile +++ b/sys/modules/agp/Makefile @@ -36,6 +36,7 @@ EXPORT_SYMS+= intel_gtt_clear_range \ intel_gtt_install_pte \ intel_gtt_get \ intel_gtt_chipset_flush \ + intel_gtt_read_pte \ intel_gtt_unmap_memory \ intel_gtt_map_memory \ intel_gtt_insert_sg_entries \ diff --git a/sys/net/if.h b/sys/net/if.h index d54190f6ccf8..0bbd9906f5cf 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -253,8 +253,8 @@ struct if_data { #define IFCAP_B_VXLAN_HWCSUM 29 /* can do IFCAN_HWCSUM on VXLANs */ #define IFCAP_B_VXLAN_HWTSO 30 /* can do IFCAP_TSO on VXLANs */ #define IFCAP_B_TXTLS_RTLMT 31 /* can do TLS with rate limiting */ -#define IFCAP_B_RXTLS4 32 /* can to TLS receive for TCP */ -#define IFCAP_B_RXTLS6 33 /* can to TLS receive for TCP6 */ +#define IFCAP_B_RXTLS4 32 /* can do TLS receive for TCP */ +#define IFCAP_B_RXTLS6 33 /* can do TLS receive for TCP6 */ #define IFCAP_B_IPSEC_OFFLOAD 34 /* inline IPSEC offload */ #define __IFCAP_B_SIZE 35 diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 57f7e1e29d08..1e560e029718 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -1082,6 +1082,7 @@ snl_init_writer(struct snl_state *ss, struct snl_writer *nw) static inline bool snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) { + void *new_base; uint32_t new_size = nw->size * 2; while (new_size < nw->size + sz) @@ -1090,23 +1091,27 @@ snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) if (nw->error) return (false); - if (snl_allocz(nw->ss, new_size) == NULL) { + new_base = snl_allocz(nw->ss, new_size); + if (new_base == NULL) { nw->error = true; return (false); } - nw->size = new_size; - void *new_base = nw->ss->lb->base; - if (new_base != nw->base) { - memcpy(new_base, nw->base, nw->offset); - if (nw->hdr != NULL) { - int hdr_off = (char *)(nw->hdr) - nw->base; + if (new_base == nw->ss->lb->base) { + /* Claim the entire linear buffer. */ + nw->size = nw->ss->lb->size; + nw->ss->lb->offset = nw->ss->lb->size; + } else + nw->size = new_size; - nw->hdr = (struct nlmsghdr *) - (void *)((char *)new_base + hdr_off); - } - nw->base = (char *)new_base; + memcpy(new_base, nw->base, nw->offset); + if (nw->hdr != NULL) { + int hdr_off = (char *)(nw->hdr) - nw->base; + + nw->hdr = (struct nlmsghdr *) + (void *)((char *)new_base + hdr_off); } + nw->base = (char *)new_base; return (true); } diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5e919e35b07b..74d2182fe77b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7396,7 +7396,11 @@ pf_sctp_track(struct pf_kstate *state, struct pf_pdesc *pd, } if (src->scrub != NULL) { - if (src->scrub->pfss_v_tag == 0) + /* + * Allow tags to be updated, in case of retransmission of + * INIT/INIT_ACK chunks. + **/ + if (src->state <= SCTP_COOKIE_WAIT) src->scrub->pfss_v_tag = pd->hdr.sctp.v_tag; else if (src->scrub->pfss_v_tag != pd->hdr.sctp.v_tag) return (PF_DROP); diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 36e3fcd41970..b645cd3499cb 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -31,6 +31,7 @@ options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support +options FIB_ALGO # Modular fib lookups options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging options TCP_RFC7413 # TCP Fast Open diff --git a/sys/sys/efi-edk2.h b/sys/sys/efi-edk2.h index b27b26bd613c..d591c253a3e0 100644 --- a/sys/sys/efi-edk2.h +++ b/sys/sys/efi-edk2.h @@ -72,7 +72,7 @@ typedef void VOID; /* * Note: the EDK2 code assumed #pragma packed works and PACKED is a * workaround for some old toolchain issues for EDK2 that aren't - * relevent to FreeBSD. + * relevant to FreeBSD. */ #define PACKED diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 350e4073604e..4ddd2eba25c8 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -326,7 +326,7 @@ int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, int kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct mbuf *control, enum uio_seg segflg); int kern_setcred(struct thread *const td, const u_int flags, - struct setcred *const wcred, gid_t *preallocated_groups); + struct setcred *const wcred); int kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups); int kern_setitimer(struct thread *, u_int, struct itimerval *, struct itimerval *); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 5b4517d2bf0c..413ba5459e3d 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1988,7 +1988,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, ("vm_object_page_remove: illegal options for object %p", object)); if (object->resident_page_count == 0) - return; + goto remove_pager; vm_object_pip_add(object, 1); vm_page_iter_limit_init(&pages, object, end); again: @@ -2061,6 +2061,7 @@ wired: } vm_object_pip_wakeup(object); +remove_pager: vm_pager_freespace(object, start, (end == 0 ? object->size : end) - start); } |
