Linux 6.18.58
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.18.58 kernel.
All users of the 6.18 kernel series must upgrade.
The updated 6.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.18.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/riscv/kernel/patch.c | 21 +- arch/x86/kvm/x86.h | 4 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 + drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 10 + drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 45 ++++++ drivers/gpu/drm/xe/xe_i2c.c | 5 drivers/infiniband/hw/erdma/erdma_main.c | 4 drivers/infiniband/hw/erdma/erdma_verbs.c | 18 +- drivers/md/dm-integrity.c | 55 +++++++ drivers/net/ethernet/intel/iavf/iavf.h | 11 + drivers/net/ethernet/intel/iavf/iavf_main.c | 85 +++++++++--- drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 111 +++++++++++++-- drivers/net/ethernet/microsoft/mana/mana_bpf.c | 8 - drivers/net/ethernet/microsoft/mana/mana_en.c | 26 +-- drivers/net/ethernet/xilinx/xilinx_axienet.h | 7 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 51 +++++-- drivers/net/wireless/ath/ath9k/wmi.c | 16 -- drivers/net/wireless/ath/ath9k/wmi.h | 1 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 9 + drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 23 +++ drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 6 drivers/pci/controller/dwc/pcie-designware.c | 31 ++++ drivers/scsi/ch.c | 30 +--- drivers/spi/spi-mpc52xx.c | 26 ++- drivers/ufs/core/ufs-mcq.c | 35 +++- drivers/ufs/core/ufshcd.c | 37 ++--- drivers/usb/gadget/function/f_hid.c | 4 drivers/usb/misc/iowarrior.c | 74 +++------- fs/fat/dir.c | 44 +++++- fs/nfsd/nfs4proc.c | 2 fs/smb/client/inode.c | 27 +++ fs/smb/server/smb2pdu.c | 2 fs/xfs/libxfs/xfs_attr_leaf.c | 22 +++ fs/xfs/libxfs/xfs_attr_leaf.h | 3 fs/xfs/libxfs/xfs_da_btree.c | 53 +++++-- fs/xfs/libxfs/xfs_da_btree.h | 2 fs/xfs/xfs_attr_inactive.c | 95 ++++++++----- include/linux/damon.h | 1 include/linux/kernel_read_file.h | 1 include/linux/skmsg.h | 14 - include/net/bluetooth/rfcomm.h | 1 include/net/mana/mana.h | 4 io_uring/io_uring.c | 12 - io_uring/kbuf.c | 6 io_uring/memmap.c | 29 +--- io_uring/memmap.h | 6 io_uring/register.c | 15 +- io_uring/zcrx.c | 4 kernel/kexec_handover.c | 2 kernel/module/main.c | 17 +- kernel/sched/ext.c | 29 +++- kernel/sched/sched.h | 5 mm/damon/core.c | 24 ++- mm/mremap.c | 38 +++-- mm/vma.c | 21 ++ mm/vma.h | 7 net/bluetooth/rfcomm/core.c | 134 +++++++++++++------ net/ipv4/tcp_bpf.c | 17 ++ net/ipv6/ip6_gre.c | 7 net/rose/af_rose.c | 44 +++++- net/rose/rose_timer.c | 5 security/integrity/ima/ima.h | 6 security/integrity/ima/ima_appraise.c | 16 -- security/integrity/ima/ima_main.c | 30 ++-- security/integrity/ima/ima_policy.c | 3 security/ipe/hooks.c | 1 security/selinux/hooks.c | 5 security/selinux/selinuxfs.c | 27 --- tools/testing/vma/vma.c | 4 70 files changed, 1093 insertions(+), 459 deletions(-)
Ahmed Abdelhaleem Ahmed (1):
scsi: ch: Do not keep references to data transfer element devices
Bart Van Assche (2):
scsi: ufs: core: Move an assignment in ufshcd_mcq_process_cqe()
scsi: ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()
Bernard Pidoux (1):
rose: hold a reference on incoming sockets queued for accept()
Cheng Xu (1):
RDMA/erdma: Use IRQ-safe XArray helpers for QP and CQ tables
Chris J Arges (1):
ima: Fix stack-out-of-bounds in is_bprm_creds_for_exec()
Coiby Xu (1):
ima: Access decompressed kernel module to verify appended signature
Corinna Vinschen (1):
iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
Daehyeon Ko (1):
ip6_gre: remove obsolete ERSPAN PMTU update
Ethan Tidmore (1):
usb: gadget: f_hid: Add missing error code
Fan Wu (1):
drm/xe/i2c: cancel the client work on remove
Frank Sorenson (1):
cifs: fix time_last_write stamp placement in setattr/truncate paths
Greg Kroah-Hartman (1):
Linux 6.18.58
Hamza Mahfooz (1):
net: mana: reserve RX buffer headroom to fix forwarding performance
Hengyu Liang (1):
io_uring: do not charge the SQ/CQ rings to RLIMIT_MEMLOCK
Ilan Dudnik (1):
ksmbd: fix heap out-of-bounds write in krb5_authenticate()
Jens Axboe (1):
io_uring/kbuf: don't charge provided buffer rings to RLIMIT_MEMLOCK
Jinu Kim (1):
KVM: x86: Use active memslots for the per-vCPU MMIO cache
Johan Hovold (2):
spi: mpc52xx: clean up interrupt handling
USB: iowarrior: fix use-after-free on disconnect race
Jose Ignacio Tornos Martinez (1):
iavf: send MAC change request synchronously
Long Li (3):
xfs: factor out xfs_attr3_node_entry_remove
xfs: factor out xfs_attr3_leaf_init
xfs: close crash window in attr dabtree inactivation
Lorenzo Stoakes (ARM) (2):
mm/mremap: fix locked_vm leak by splitting VMA for MREMAP_DONTUNMAP mm/mremap: fix locked_vm leak from MREMAP_DONTUNMAP self-merge
Lubos Rendek (1):
nfsd: fix all-zero stateid in CB_OFFLOAD for async COPY
Manivannan Sadhasivam (2):
PCI: dwc: Return -ENODEV from dw_pcie_wait_for_link() if device is not found
PCI: dwc: Return -EIO from dw_pcie_wait_for_link() if device is not active
Mario Limonciello (1):
drm/amd: Create a device link between APU display and XHCI devices
Matteo Croce (1):
fat: stop reading directory entries past the end-of-directory marker
Mattia Meleleo (1):
bpf, sockmap: Account for receive queue in FIONREAD without a verdict program
Mikhail Gavrilov (1):
Bluetooth: RFCOMM: connect the session socket without rfcomm_mutex
Mikulas Patocka (2):
dm-integrity: fix NULL pointer dereference when the 'R' flag is used
dm-integrity: validate the superblock on resume
Oliver Neukum (1):
usb: iowarrior: remove inherent race with minor number
Peter Wang (1):
scsi: ufs: core: Add debug log for MCQ command timeout
Pratyush Yadav (1):
kho: free chunks using free_page() instead of kfree()
Sean Wang (1):
wifi: mt76: connac: tolerate inactive BSS deactivation
SeongJae Park (2):
mm/damon/core: cancel damos_walk() before damon_ctx->kdamond reset mm/damon/core: fix damos_walk() vs kdamond_fn() exit race
Stanley Jhu (2):
scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ
scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock()
Stephen Smalley (1):
selinux: allow multiple opens of /sys/fs/selinux/policy
Suraj Gupta (1):
net: xilinx: axienet: Free outstanding DMA buffers on dmaengine stop
Tejun Heo (1):
sched_ext: Fix CPU hotplug hang when a dying CPU's tasks sit in the BPF scheduler
Toke Høiland-Jørgensen (1):
wifi: atk9k: Revert "wifi: ath9k: reject short WMI command responses"
Vivian Wang (1):
riscv: patch: Avoid early phys_to_page()
Wei-Jie Hung (1):
riscv: patch: fix handling of bpf-jit execmem addresses
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 18 -SUBLEVEL = 57 +SUBLEVEL = 58 EXTRAVERSION = NAME = Baby Opossum Posse
arch/riscv/kernel/patch.c +11 -10
@@ -42,19 +42,20 @@ static inline bool is_kernel_exittext(uintptr_t addr) static __always_inline void *patch_map(void *addr, const unsigned int fixmap) {uintptr_t uintaddr = (uintptr_t ) addr; -struct page *page; +phys_addr_t phys; -if (core_kernel_text (uintaddr) ||is_kernel_exittext (uintaddr)) - page =phys_to_page (__pa_symbol (addr)); -else if (IS_ENABLED (CONFIG_STRICT_MODULE_RWX )) - page =vmalloc_to_page (addr); -else -return addr; +if (core_kernel_text (uintaddr) ||is_kernel_exittext (uintaddr)) { + phys =__pa_symbol (addr); + }else if (IS_ENABLED (CONFIG_EXECMEM )) { +struct page *page =vmalloc_to_page (addr); -BUG_ON (!page); +BUG_ON (!page); + phys =page_to_phys (page) +offset_in_page (addr); + }else { +return addr; + } -return (void *)set_fixmap_offset (fixmap,page_to_phys (page) + -offset_in_page (addr)); +return (void *)set_fixmap_offset (fixmap, phys); }static void patch_unmap (int fixmap)
arch/x86/kvm/x86.h +2 -2
@@ -362,7 +362,7 @@ static inline bool is_noncanonical_invlpg_address(u64 la, struct kvm_vcpu *vcpu)static inline void vcpu_cache_mmio_info (struct kvm_vcpu *vcpu,gva_t gva,gfn_t gfn,unsigned access) { -u64 gen =kvm_memslots (vcpu->kvm)->generation; +u64 gen =kvm_vcpu_memslots (vcpu)->generation;if (unlikely (gen &KVM_MEMSLOT_GEN_UPDATE_IN_PROGRESS ))return ;
@@ -379,7 +379,7 @@ static inline void vcpu_cache_mmio_info(struct kvm_vcpu *vcpu,static inline bool vcpu_match_mmio_gen (struct kvm_vcpu *vcpu) { -return vcpu->arch.mmio_gen ==kvm_memslots (vcpu->kvm)->generation; +return vcpu->arch.mmio_gen ==kvm_vcpu_memslots (vcpu)->generation; }/*
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +12 -0
@@ -1342,6 +1342,14 @@ static void smu_feature_cap_init(struct smu_context *smu)bitmap_zero (fea_cap->cap_map,SMU_FEATURE_CAP_ID__COUNT ); } +static int smu_set_power_dep (struct smu_context *smu,bool enable) +{ +if (!smu->ppt_funcs->set_power_dep) +return 0 ; + +return smu->ppt_funcs->set_power_dep (smu, enable); +} +static int smu_sw_init (struct amdgpu_ip_block *ip_block) {struct amdgpu_device *adev = ip_block->adev;
@@ -1405,6 +1413,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)if (!smu->ppt_funcs->get_fan_control_mode) smu->adev->pm.no_fan = true; +smu_set_power_dep (smu, true); +return 0 ; }
@@ -1427,6 +1437,8 @@ static int smu_sw_fini(struct amdgpu_ip_block *ip_block)smu_fini_microcode (smu); +smu_set_power_dep (smu, false); +return 0 ; }
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +10 -0
@@ -599,6 +599,9 @@ struct smu_context {bool pm_enabled;bool is_apu; +/* Power dependency link from an integrated xHCI controller to the GPU */ +struct device_link *usb_power_link; +uint32_t smc_driver_if_version;uint32_t smc_fw_if_version;uint32_t smc_fw_version;
@@ -1521,6 +1524,13 @@ struct pptable_funcs {*/ ssize_t (*get_xcp_metrics)(struct smu_context *smu,int xcp_id,void *table); +/** +* @set_power_dep: Create or destroy a power dependency link +* from an integrated xHCI controller to the GPU so that the GPU is +* resumed before the USB controller during PM resume. @enable is true +* to create the link and false to tear it down. +*/ +int (*set_power_dep)(struct smu_context *smu,bool enable); }; typedef enum {
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +45 -0
57 lines not on this page · raw message
drivers/gpu/drm/xe/xe_i2c.c +4 -1
@@ -330,10 +330,13 @@ static void xe_i2c_remove(void *data)struct xe_i2c *i2c = data;unsigned int i; +/* Stop the notifier from arming the client work before teardown. */ +bus_unregister_notifier (&i2c_bus_type, &i2c->bus_notifier); +cancel_work_sync (&i2c->work); +for (i =0 ; i <XE_I2C_MAX_CLIENTS ; i++)i2c_unregister_device (i2c->client[i]); -bus_unregister_notifier (&i2c_bus_type, &i2c->bus_notifier);xe_i2c_unregister_adapter (i2c);xe_i2c_remove_irq (i2c); }
drivers/infiniband/hw/erdma/erdma_main.c +2 -2
@@ -573,8 +573,8 @@ static int erdma_ib_device_add(struct pci_dev *pdev)INIT_LIST_HEAD (&dev->cep_list);spin_lock_init (&dev->lock); -xa_init_flags (&dev->qp_xa,XA_FLAGS_ALLOC1 ); -xa_init_flags (&dev->cq_xa,XA_FLAGS_ALLOC1 ); +xa_init_flags (&dev->qp_xa,XA_FLAGS_ALLOC1 |XA_FLAGS_LOCK_IRQ ); +xa_init_flags (&dev->cq_xa,XA_FLAGS_ALLOC1 |XA_FLAGS_LOCK_IRQ ); dev->next_alloc_cqn =1 ; dev->next_alloc_qpn =1 ;
drivers/infiniband/hw/erdma/erdma_verbs.c +9 -9
@@ -1019,15 +1019,15 @@ int erdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attrs,init_completion (&qp->safe_free);if (qp->ibqp.qp_type ==IB_QPT_GSI ) { - old_entry =xa_store (&dev->qp_xa,1 , qp,GFP_KERNEL ); + old_entry =xa_store_irq (&dev->qp_xa,1 , qp,GFP_KERNEL );if (xa_is_err (old_entry)) ret =xa_err (old_entry);else qp->ibqp.qp_num =1 ; }else { - ret =xa_alloc_cyclic (&dev->qp_xa, &qp->ibqp.qp_num, qp, -XA_LIMIT (1 , dev->attrs.max_qp -1 ), - &dev->next_alloc_qpn,GFP_KERNEL ); + ret =xa_alloc_cyclic_irq (&dev->qp_xa, &qp->ibqp.qp_num, qp, +XA_LIMIT (1 , dev->attrs.max_qp -1 ), + &dev->next_alloc_qpn,GFP_KERNEL ); }if (ret <0 ) {
@@ -1090,7 +1090,7 @@ int erdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attrs,else free_kernel_qp (qp); err_out_xa: -xa_erase (&dev->qp_xa,QP_ID (qp)); +xa_erase_irq (&dev->qp_xa,QP_ID (qp)); err_out:return ret; }
@@ -1994,9 +1994,9 @@ int erdma_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,refcount_set (&cq->refcount,1 );init_completion (&cq->free); - ret =xa_alloc_cyclic (&dev->cq_xa, &cq->cqn, cq, -XA_LIMIT (1 , dev->attrs.max_cq -1 ), - &dev->next_alloc_cqn,GFP_KERNEL ); + ret =xa_alloc_cyclic_irq (&dev->cq_xa, &cq->cqn, cq, +XA_LIMIT (1 , dev->attrs.max_cq -1 ), + &dev->next_alloc_cqn,GFP_KERNEL );if (ret <0 )return ret;
@@ -2044,7 +2044,7 @@ int erdma_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, } err_out_xa: -xa_erase (&dev->cq_xa, cq->cqn); +xa_erase_irq (&dev->cq_xa, cq->cqn);return ret; }
drivers/md/dm-integrity.c +55 -0
91 lines not on this page · raw message
drivers/net/ethernet/intel/iavf/iavf.h +9 -2
@@ -259,7 +259,6 @@ struct iavf_adapter {struct work_struct adminq_task;struct work_struct finish_config;wait_queue_head_t down_waitqueue; -wait_queue_head_t vc_waitqueue;struct iavf_q_vector *q_vectors;struct list_head vlan_filter_list;int num_vlan_filters;
@@ -588,8 +587,9 @@ void iavf_configure_queues(struct iavf_adapter *adapter);void iavf_enable_queues (struct iavf_adapter *adapter);void iavf_disable_queues (struct iavf_adapter *adapter);void iavf_map_queues (struct iavf_adapter *adapter); -void iavf_add_ether_addrs (struct iavf_adapter *adapter); +int iavf_add_ether_addrs (struct iavf_adapter *adapter);void iavf_del_ether_addrs (struct iavf_adapter *adapter); +void iavf_mac_add_reject (struct iavf_adapter *adapter);void iavf_add_vlans (struct iavf_adapter *adapter);void iavf_del_vlans (struct iavf_adapter *adapter);void iavf_set_promiscuous (struct iavf_adapter *adapter);
@@ -606,6 +606,13 @@ void iavf_disable_vlan_stripping(struct iavf_adapter *adapter);void iavf_virtchnl_completion (struct iavf_adapter *adapter,enum virtchnl_ops v_opcode,enum iavf_status v_retval,u8 *msg,u16 msglen); +int iavf_poll_virtchnl_response (struct iavf_adapter *adapter, +struct iavf_arq_event_info *event, +bool (*condition)(struct iavf_adapter *adapter, +const void *data, +enum virtchnl_ops v_op), +const void *cond_data, +unsigned int timeout_ms);int iavf_config_rss (struct iavf_adapter *adapter);void iavf_cfg_queues_bw (struct iavf_adapter *adapter);void iavf_cfg_queues_quanta_size (struct iavf_adapter *adapter);
drivers/net/ethernet/intel/iavf/iavf_main.c +67 -18
107 lines not on this page · raw message
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +94 -17
175 lines not on this page · raw message
drivers/net/ethernet/microsoft/mana/mana_bpf.c +4 -4
@@ -91,7 +91,7 @@ u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq, goto out;xdp_init_buff (xdp,PAGE_SIZE , &rxq->xdp_rxq); -xdp_prepare_buff (xdp, buf_va,XDP_PACKET_HEADROOM , pkt_len, true); +xdp_prepare_buff (xdp, buf_va, rxq->headroom, pkt_len, true); act =bpf_prog_run_xdp (prog, xdp);
@@ -183,9 +183,9 @@ static int mana_xdp_set(struct net_device *ndev, struct bpf_prog *prog,if (!old_prog && !prog)return 0 ; -if (prog && ndev->mtu >MANA_XDP_MTU_MAX ) { +if (prog && ndev->mtu >MANA_XDP_MTU_MAX (ndev)) {netdev_err (ndev,"XDP: mtu:%u too large, mtu_max:%lu\n" , - ndev->mtu,MANA_XDP_MTU_MAX ); + ndev->mtu,MANA_XDP_MTU_MAX (ndev));NL_SET_ERR_MSG_MOD (extack,"XDP: mtu too large" );return -EOPNOTSUPP ;
@@ -238,7 +238,7 @@ static int mana_xdp_set(struct net_device *ndev, struct bpf_prog *prog,bpf_prog_put (old_prog);if (prog) - ndev->max_mtu =MANA_XDP_MTU_MAX ; + ndev->max_mtu =MANA_XDP_MTU_MAX (ndev);else ndev->max_mtu = gc->adapter_mtu -ETH_HLEN ;
drivers/net/ethernet/microsoft/mana/mana_en.c +12 -14
@@ -749,7 +749,7 @@ static void *mana_get_rxbuf_pre(struct mana_rxq *rxq, dma_addr_t *da)return va; } -/* Get RX buffer's data size, alloc size, XDP headroom based on MTU */ +/* Get RX buffer's data size, alloc size, headroom and frag count based on MTU */ static void mana_get_rxbuf_cfg (struct mana_port_context *apc,int mtu,u32 *datasize,u32 *alloc_size,u32 *headroom,u32 *frag_count)
@@ -759,16 +759,20 @@ static void mana_get_rxbuf_cfg(struct mana_port_context *apc,/* Calculate datasize first (consistent across all cases) */ *datasize = mtu +ETH_HLEN ; -/* For xdp and jumbo frames make sure only one packet fits per page */ -if (mtu +MANA_RXBUF_PAD >PAGE_SIZE /2 ||mana_xdp_get (apc)) { -if (mana_xdp_get (apc)) { - *headroom =XDP_PACKET_HEADROOM ; + *headroom =LL_RESERVED_SPACE (apc->ndev); +if (mana_xdp_get (apc)) + *headroom =max_t (u32, *headroom,XDP_PACKET_HEADROOM ); + + len =SKB_DATA_ALIGN (mtu +MANA_RXBUF_PAD + *headroom); + buf_size =ALIGN (len,MANA_RX_FRAG_ALIGNMENT ); + +/* For xdp and large buffers make sure only one packet fits per page */ +if (PAGE_SIZE / buf_size <2 ||mana_xdp_get (apc)) { +if (mana_xdp_get (apc)) *alloc_size =PAGE_SIZE ; - }else { - *headroom =0 ;/* no support for XDP */ +else *alloc_size =SKB_DATA_ALIGN (mtu +MANA_RXBUF_PAD + *headroom); - } *frag_count =1 ;
@@ -782,12 +786,6 @@ static void mana_get_rxbuf_cfg(struct mana_port_context *apc, }/* Standard MTU case - optimize for multiple packets per page */ - *headroom =0 ; - -/* Calculate base buffer size needed */ - len =SKB_DATA_ALIGN (mtu +MANA_RXBUF_PAD + *headroom); - buf_size =ALIGN (len,MANA_RX_FRAG_ALIGNMENT ); -/* Calculate how many packets can fit in a page */ *frag_count =PAGE_SIZE / buf_size; *alloc_size = buf_size;
drivers/net/ethernet/xilinx/xilinx_axienet.h +5 -2
@@ -523,8 +523,9 @@ struct skbuf_dma_descriptor {* @stats_work: Work for reading the hardware statistics counters often enough * to catch overflows. * @dma_err_task: Work structure to process Axi DMA errors -* @stopping: Set when @dma_err_task shouldn't do anything because we are -* about to stop the device. +* @stopping: Set when we are about to stop the device: makes @dma_err_task +* a no-op (legacy DMA path) and fences RX descriptor +* resubmission in axienet_dma_rx_cb() (dmaengine path). * @tx_irq: Axidma TX IRQ number * @rx_irq: Axidma RX IRQ number * @eth_irq: Ethernet core IRQ number
@@ -545,6 +546,7 @@ struct skbuf_dma_descriptor {* @tx_ring_tail: TX skb ring buffer tail index. * @rx_ring_head: RX skb ring buffer head index. * @rx_ring_tail: RX skb ring buffer tail index. +* @rx_submit_lock: Protects RX ring resubmission vs teardown in dmaengine path. */ struct axienet_local {struct net_device *ndev;
@@ -626,6 +628,7 @@ struct axienet_local {int tx_ring_tail;int rx_ring_head;int rx_ring_tail; +spinlock_t rx_submit_lock; };/**
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +42 -9
96 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/wmi.c +2 -14
@@ -206,16 +206,9 @@ static void ath9k_wmi_rsp_callback(struct wmi *wmi, struct sk_buff *skb) {skb_pull (skb,sizeof (struct wmi_cmd_hdr )); -if (wmi->cmd_rsp_buf && wmi->cmd_rsp_len) { -if (skb->len < wmi->cmd_rsp_len) { - wmi->cmd_rsp_status = -EMSGSIZE ; - goto complete; - } +if (wmi->cmd_rsp_buf !=NULL && wmi->cmd_rsp_len !=0 )memcpy (wmi->cmd_rsp_buf, skb->data, wmi->cmd_rsp_len); - } - wmi->cmd_rsp_status =0 ; -complete:complete (&wmi->cmd_wait); }
@@ -307,7 +300,6 @@ static int ath9k_wmi_cmd_issue(struct wmi *wmi,/* record the rsp buffer and length */ wmi->cmd_rsp_buf = rsp_buf; wmi->cmd_rsp_len = rsp_len; - wmi->cmd_rsp_status =0 ; wmi->last_seq_id = wmi->tx_seq_id;spin_unlock_irqrestore (&wmi->wmi_lock, flags);
@@ -364,13 +356,9 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,return -ETIMEDOUT ; } -spin_lock_irqsave (&wmi->wmi_lock, flags); - ret = wmi->cmd_rsp_status; -spin_unlock_irqrestore (&wmi->wmi_lock, flags); -mutex_unlock (&wmi->op_mutex); -return ret; +return 0 ; out:ath_dbg (common,WMI ,"WMI failure for: %s\n" ,wmi_cmd_to_name (cmd_id));
drivers/net/wireless/ath/ath9k/wmi.h +0 -1
@@ -157,7 +157,6 @@ struct wmi {u16 tx_seq_id;u8 *cmd_rsp_buf;u32 cmd_rsp_len; -int cmd_rsp_status;bool stopped;struct list_head pending_tx_events;
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +8 -1
@@ -1226,6 +1226,9 @@ int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy, len = enable ?sizeof (dev_req) :sizeof (basic_req); err =mt76_mcu_send_msg (dev, cmd, data, len, true); +if (err && cmd ==MCU_UNI_CMD (BSS_INFO_UPDATE )) + err =mt76_connac_mcu_bss_deact_err (dev, err, enable); +if (err <0 )return err;
@@ -1233,7 +1236,11 @@ int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy, data = enable ? (void *)&basic_req : (void *)&dev_req; len = enable ?sizeof (basic_req) :sizeof (dev_req); -return mt76_mcu_send_msg (dev, cmd, data, len, true); + err =mt76_mcu_send_msg (dev, cmd, data, len, true); +if (err && cmd ==MCU_UNI_CMD (BSS_INFO_UPDATE )) + err =mt76_connac_mcu_bss_deact_err (dev, err, enable); + +return err; }EXPORT_SYMBOL_GPL (mt76_connac_mcu_uni_add_dev);
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +23 -0
@@ -1894,6 +1894,29 @@ mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid, } } +#define MT76_CONNAC_MCU_STATUS_WLAN_FAILURE 0xc0000001 + +static inline int +mt76_connac_mcu_bss_deact_err (struct mt76_dev *mdev,int err,bool enable) +{ +if (err != (int )MT76_CONNAC_MCU_STATUS_WLAN_FAILURE ) +return err; + +/* Ignore wlan_failure state false alarm when deactivating an +* inactive network. It does not harm the firmware state. +*/ +if (!enable) { +dev_dbg (mdev->dev, +"ignore wlan_failure when bss is deactivated\n" ); +return 0 ; + } + +dev_warn (mdev->dev, +"wlan_failure when bss is activated\n" ); + +return err; +} +struct sk_buff *__mt76_connac_mcu_alloc_sta_req (struct mt76_dev *dev,struct mt76_vif_link *mvif,struct mt76_wcid *wcid,int len);
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +4 -2
@@ -2848,6 +2848,7 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,struct mt792x_dev *dev = phy->dev;struct mt792x_link_sta *mlink_bc;struct sk_buff *skb; +int err; skb =__mt7925_mcu_alloc_bss_req (&dev->mt76, &mconf->mt76,MT7925_BSS_UPDATE_MAX_SIZE );
@@ -2875,8 +2876,9 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,mt7925_mcu_bss_mbssid_tlv (skb, link_conf, enable); } -return mt76_mcu_skb_send_msg (&dev->mt76, skb, -MCU_UNI_CMD (BSS_INFO_UPDATE ), true); + err =mt76_mcu_skb_send_msg (&dev->mt76, skb, +MCU_UNI_CMD (BSS_INFO_UPDATE ), true); +return mt76_connac_mcu_bss_deact_err (&dev->mt76, err, enable); }int mt7925_mcu_set_dbdc (struct mt76_phy *phy,bool enable)
drivers/pci/controller/dwc/pcie-designware.c +30 -1
@@ -692,9 +692,17 @@ void dw_pcie_disable_atu(struct dw_pcie *pci, u32 dir, int index)dw_pcie_writel_atu (pci, dir, index,PCIE_ATU_REGION_CTRL2 ,0 ); } +/** +* dw_pcie_wait_for_link - Wait for the PCIe link to be up +* @pci: DWC instance +* +* Returns: 0 if link is up, -ENODEV if device is not found, -EIO if the device +* is found but not active and -ETIMEDOUT if the link fails to come up for other +* reasons. +*/ int dw_pcie_wait_for_link (struct dw_pcie *pci) { -u32 offset, val; +u32 offset, val, ltssm;int retries;/* Check if the link is up or not */
@@ -706,6 +714,27 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci) }if (retries >=PCIE_LINK_WAIT_MAX_RETRIES ) { +/* +* If the link is in Detect.Quiet or Detect.Active state, it +* indicates that no device is detected. +*/ + ltssm =dw_pcie_get_ltssm (pci); +if (ltssm ==DW_PCIE_LTSSM_DETECT_QUIET || + ltssm ==DW_PCIE_LTSSM_DETECT_ACT ) { +dev_info (pci->dev,"Device not found\n" ); +return -ENODEV ; + +/* +* If the link is in POLL.{Active/Compliance} state, then the +* device is found to be connected to the bus, but it is not +* active i.e., the device firmware might not yet initialized. +*/ + }else if (ltssm ==DW_PCIE_LTSSM_POLL_ACTIVE || + ltssm ==DW_PCIE_LTSSM_POLL_COMPLIANCE ) { +dev_info (pci->dev,"Device found, but not active\n" ); +return -EIO ; + } +dev_info (pci->dev,"Phy link never came up\n" );return -ETIMEDOUT ; }
drivers/scsi/ch.c +9 -21
@@ -112,7 +112,6 @@ typedef struct {int minor;char name[8 ];struct scsi_device *device; -struct scsi_device **dt;/* ptrs to data transfer elements */ u_int firsts[CH_TYPES ];u_int counts[CH_TYPES ];u_int voltags;
@@ -363,16 +362,10 @@ ch_readconfig(scsi_changer *ch) vendor_labels[i]); } -/* look up the devices of the data transfer elements */ - ch->dt =kcalloc (ch->counts[CHET_DT ],sizeof (*ch->dt), -GFP_KERNEL ); - -if (!ch->dt) { -kfree (buffer); -return -ENOMEM ; - } - +/* report the devices of the data transfer elements */ for (elem =0 ; elem < ch->counts[CHET_DT ]; elem++) { +struct scsi_device *sdev; + id =-1 ; lun =0 ;if (elem <CH_DT_MAX &&-1 != dt_id[elem]) {
@@ -388,10 +381,8 @@ ch_readconfig(scsi_changer *ch)VPRINTK (KERN_INFO ,"dt 0x%x: " ,elem+ch->firsts[CHET_DT ]);if (data[6 ] &0x80 ) {VPRINTK (KERN_CONT ,"not this SCSI bus\n" ); - ch->dt[elem] =NULL ; }else if (0 == (data[6 ] &0x30 )) {VPRINTK (KERN_CONT ,"ID/LUN unknown\n" ); - ch->dt[elem] =NULL ; }else { id = ch->device->id; lun =0 ;
@@ -401,18 +392,16 @@ ch_readconfig(scsi_changer *ch) }if (-1 != id) {VPRINTK (KERN_CONT ,"ID %i, LUN %i, " ,id,lun); - ch->dt[elem] = -scsi_device_lookup (ch->device->host, - ch->device->channel, - id,lun); -if (!ch->dt[elem]) { + sdev =scsi_device_lookup (ch->device->host, + ch->device->channel, + id, lun); +if (!sdev) {/* should not happen */ VPRINTK (KERN_CONT ,"Huh? device not found!\n" ); }else {VPRINTK (KERN_CONT ,"name: %8.8s %16.16s %4.4s\n" , - ch->dt[elem]->vendor, - ch->dt[elem]->model, - ch->dt[elem]->rev); + sdev->vendor, sdev->model, sdev->rev); +scsi_device_put (sdev); } } }
@@ -576,7 +565,6 @@ static void ch_destroy(struct kref *ref)scsi_changer *ch =container_of (ref, scsi_changer, ref); ch->device =NULL ; -kfree (ch->dt);kfree (ch); }
drivers/spi/spi-mpc52xx.c +16 -10
@@ -475,13 +475,15 @@ static int mpc52xx_spi_probe(struct platform_device *op)if (ms->irq0 && ms->irq1) { rc =request_irq (ms->irq0, mpc52xx_spi_irq,0 ,"mpc5200-spi-modf" , ms); - rc |=request_irq (ms->irq1, mpc52xx_spi_irq,0 , -"mpc5200-spi-spif" , ms); -if (rc) { -free_irq (ms->irq0, ms); -free_irq (ms->irq1, ms); - ms->irq0 = ms->irq1 =0 ; +if (rc ==0 ) { + rc =request_irq (ms->irq1, mpc52xx_spi_irq,0 , +"mpc5200-spi-spif" , ms); +if (rc) +free_irq (ms->irq0, ms); } + +if (rc) + ms->irq0 = ms->irq1 =0 ; }else {/* operate in polled mode */ ms->irq0 = ms->irq1 =0 ;
@@ -501,8 +503,10 @@ static int mpc52xx_spi_probe(struct platform_device *op) err_register:dev_err (&ms->host->dev,"initialization failed\n" ); -free_irq (ms->irq0, ms); -free_irq (ms->irq1, ms); +if (ms->irq0) { +free_irq (ms->irq0, ms); +free_irq (ms->irq1, ms); + }cancel_work_sync (&ms->work); err_gpio:while (i-- >0 )
@@ -525,8 +529,10 @@ static void mpc52xx_spi_remove(struct platform_device *op)spi_unregister_controller (host); -free_irq (ms->irq0, ms); -free_irq (ms->irq1, ms); +if (ms->irq0) { +free_irq (ms->irq0, ms); +free_irq (ms->irq1, ms); + }cancel_work_sync (&ms->work);
drivers/ufs/core/ufs-mcq.c +25 -10
@@ -303,19 +303,34 @@ static int ufshcd_mcq_get_tag(struct ufs_hba *hba, struct cq_entry *cqe)return div_u64 (addr,ufshcd_get_ucd_size (hba)); } +static void ufshcd_mcq_compl_cqe (struct ufs_hba *hba,struct cq_entry *cqe) +{ +int tag =ufshcd_mcq_get_tag (hba, cqe); + +ufshcd_compl_one_cqe (hba, tag, cqe); +/* After processing the CQE, mark it as an empty (invalid) entry. */ + cqe->command_desc_base_addr =0 ; +} +static void ufshcd_mcq_process_cqe (struct ufs_hba *hba,struct ufs_hw_queue *hwq) {struct cq_entry *cqe =ufshcd_mcq_cur_cqe (hwq); -int tag =ufshcd_mcq_get_tag (hba, cqe); -if (cqe->command_desc_base_addr) { -ufshcd_compl_one_cqe (hba, tag, cqe); -/* After processed the cqe, mark it empty (invalid) entry */ - cqe->command_desc_base_addr =0 ; - } +if (cqe->command_desc_base_addr) +ufshcd_mcq_compl_cqe (hba, cqe); +else +dev_err (hba->dev,"Abnormal CQ entry!\n" ); } +/* +* This function is called from the UFS error handler with the UFS host +* controller disabled (HCE = 0). Reading host controller registers, e.g. the +* CQ tail pointer (CQTPy), may not be safe with the host controller disabled. +* Hence, iterate over all completion queue entries. This won't result in +* double completions because ufshcd_mcq_compl_cqe() clears a CQE after it +* has been processed. +*/ void ufshcd_mcq_compl_all_cqes_lock (struct ufs_hba *hba,struct ufs_hw_queue *hwq) {
@@ -324,13 +339,13 @@ void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,spin_lock_irqsave (&hwq->cq_lock, flags);while (entries >0 ) { -ufshcd_mcq_process_cqe (hba, hwq); +struct cq_entry *cqe =ufshcd_mcq_cur_cqe (hwq); + +if (cqe->command_desc_base_addr) +ufshcd_mcq_compl_cqe (hba, cqe);ufshcd_mcq_inc_cq_head_slot (hwq); entries--; } - -ufshcd_mcq_update_cq_tail_slot (hwq); - hwq->cq_head_slot = hwq->cq_tail_slot;spin_unlock_irqrestore (&hwq->cq_lock, flags); }
drivers/ufs/core/ufshcd.c +21 -16
@@ -5743,7 +5743,17 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,struct ufshcd_lrb *lrbp;struct scsi_cmnd *cmd;unsigned long flags; -int tag; +int tag, i; + +for (i =0 ; i < hba->nr_hw_queues; i++) { +if (force_compl) +ufshcd_mcq_compl_all_cqes_lock (hba, &hba->uhq[i]); +else +ufshcd_mcq_poll_cqe_lock (hba, &hba->uhq[i]); + } + +if (!force_compl) +return ;for (tag =0 ; tag < hba->nutrs; tag++) { lrbp = &hba->lrb[tag];
@@ -5756,22 +5766,17 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,if (!hwq)continue ; -if (force_compl) { -ufshcd_mcq_compl_all_cqes_lock (hba, hwq); -/* -* For those cmds of which the cqes are not present -* in the cq, complete them explicitly. -*/ -spin_lock_irqsave (&hwq->cq_lock, flags); -if (cmd && !test_bit (SCMD_STATE_COMPLETE , &cmd->state)) { -set_host_byte (cmd,DID_REQUEUE ); -ufshcd_release_scsi_cmd (hba, lrbp); -scsi_done (cmd); - } -spin_unlock_irqrestore (&hwq->cq_lock, flags); - }else { -ufshcd_mcq_poll_cqe_lock (hba, hwq); +/* +* For those cmds of which the cqes are not present +* in the cq, complete them explicitly. +*/ +spin_lock_irqsave (&hwq->cq_lock, flags); +if (cmd && !test_bit (SCMD_STATE_COMPLETE , &cmd->state)) { +set_host_byte (cmd,DID_REQUEUE ); +ufshcd_release_scsi_cmd (hba, lrbp); +scsi_done (cmd); } +spin_unlock_irqrestore (&hwq->cq_lock, flags); } }
drivers/usb/gadget/function/f_hid.c +3 -1
@@ -1279,8 +1279,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)/* create char device */ hidg->cdev =cdev_alloc (); -if (!hidg->cdev) +if (!hidg->cdev) { + status = -ENOMEM ; goto fail_free_all; + } hidg->cdev->ops = &f_hidg_fops; status =cdev_device_add (hidg->cdev, &hidg->dev);
drivers/usb/misc/iowarrior.c +27 -47
164 lines not on this page · raw message
fs/fat/dir.c +40 -4
98 lines not on this page · raw message
fs/nfsd/nfs4proc.c +2 -0
@@ -2084,6 +2084,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, goto out_dec_async_copy_err;memcpy (&result->cb_stateid, &async_copy->cp_stateid.cs_stid,sizeof (result->cb_stateid)); +memcpy (&async_copy->cp_res.cb_stateid, &async_copy->cp_stateid.cs_stid, +sizeof (async_copy->cp_res.cb_stateid));if ((READ_ONCE (copy->nf_dst->nf_file->f_mode) &FMODE_NOCMTIME ) !=0 ) async_copy->attr_update = true;
fs/smb/client/inode.c +23 -4
@@ -3135,11 +3135,8 @@ int cifs_file_set_size(const unsigned int xid, struct dentry *dentry,cifs_put_tlink (tlink); set_size_out: -if (rc ==0 ) { -/* Pairs with smp_load_acquire() in is_size_safe_to_change(). */ -smp_store_release (&cifsInode->time_last_write, jiffies); +if (rc ==0 )cifs_resize_file_locked (inode, size); - }return rc; }
@@ -3202,6 +3199,17 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) rc =0 ;if (attrs->ia_valid &ATTR_SIZE ) { +if (attrs->ia_size !=i_size_read (inode)) { +/* Stamp before RPC. On failure the stamp remains: restoring a +* stale snapshot could silently erase a concurrent +* _cifsFileInfo_put() close stamp. readdir is suppressed +* until the stamp expires; stat() bypasses this via the +* from_readdir=false path in is_size_safe_to_change() and +* always returns an authoritative QUERY_INFO result. +* Pairs with smp_load_acquire() in is_size_safe_to_change(). +*/ +smp_store_release (&cifsInode->time_last_write, jiffies); + } rc =cifs_file_set_size (xid, direntry, full_path, open_file, attrs->ia_size);if (rc !=0 )
@@ -3378,6 +3386,17 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) }if (attrs->ia_valid &ATTR_SIZE ) { +if (attrs->ia_size !=i_size_read (inode)) { +/* Stamp before RPC. On failure the stamp remains: restoring a +* stale snapshot could silently erase a concurrent +* _cifsFileInfo_put() close stamp. readdir is suppressed +* until the stamp expires; stat() bypasses this via the +* from_readdir=false path in is_size_safe_to_change() and +* always returns an authoritative QUERY_INFO result. +* Pairs with smp_load_acquire() in is_size_safe_to_change(). +*/ +smp_store_release (&cifsInode->time_last_write, jiffies); + } rc =cifs_file_set_size (xid, direntry, full_path, cfile, attrs->ia_size);if (rc !=0 )
fs/smb/server/smb2pdu.c +1 -1
@@ -1609,7 +1609,7 @@ static int krb5_authenticate(struct ksmbd_work *work, in_len =le16_to_cpu (req->SecurityBufferLength); out_blob = (char *)&rsp->hdr.ProtocolId +le16_to_cpu (rsp->SecurityBufferOffset); - out_len = work->response_sz - + out_len = work->response_sz - work->next_smb2_rsp_hdr_off - (le16_to_cpu (rsp->SecurityBufferOffset) +4 ); retval = ksmbd_krb5_authenticate(sess, in_blob, in_len,
fs/xfs/libxfs/xfs_attr_leaf.c +22 -0
@@ -1330,6 +1330,28 @@ xfs_attr3_leaf_create(return 0 ; } +/* +* Reinitialize an existing attr fork block as an empty leaf, and attach +* the buffer to tp. +*/ +int +xfs_attr3_leaf_init ( +struct xfs_trans *tp, +struct xfs_inode *dp, +xfs_dablk_t blkno) +{ +struct xfs_buf *bp =NULL ; +struct xfs_da_args args = { + .trans = tp, + .dp = dp, + .owner = dp->i_ino, + .geo = dp->i_mount->m_attr_geo, + }; + +ASSERT (tp !=NULL ); + +return xfs_attr3_leaf_create (&args, blkno, &bp); +}/* * Split the leaf node, rebalance, then add the new entry. *
fs/xfs/libxfs/xfs_attr_leaf.h +3 -0
@@ -86,6 +86,9 @@ int xfs_attr3_leaf_list_int(struct xfs_buf *bp,/* * Routines used for shrinking the Btree. */ + +int xfs_attr3_leaf_init (struct xfs_trans *tp,struct xfs_inode *dp, +xfs_dablk_t blkno);int xfs_attr3_leaf_toosmall (struct xfs_da_state *state,int *retval); void xfs_attr3_leaf_unbalance(struct xfs_da_state *state, struct xfs_da_state_blk *drop_blk,
fs/xfs/libxfs/xfs_da_btree.c +42 -11
86 lines not on this page · raw message
fs/xfs/libxfs/xfs_da_btree.h +2 -0
@@ -184,6 +184,8 @@ int xfs_da3_split(xfs_da_state_t *state);int xfs_da3_join (xfs_da_state_t *state);void xfs_da3_fixhashpath (struct xfs_da_state *state,struct xfs_da_state_path *path_to_to_fix); +void xfs_attr3_node_entry_remove (struct xfs_trans *tp,struct xfs_inode *dp, +struct xfs_buf *bp,int index);/* * Routines used for finding things in the Btree.
fs/xfs/xfs_attr_inactive.c +57 -38
171 lines not on this page · raw message
include/linux/damon.h +1 -0
@@ -785,6 +785,7 @@ struct damon_ctx {struct mutex call_controls_lock;struct damos_walk_control *walk_control; +bool walk_control_obsolete;struct mutex walk_control_lock;/*
include/linux/kernel_read_file.h +1 -0
@@ -14,6 +14,7 @@ id(KEXEC_INITRAMFS, kexec-initramfs) \ id(POLICY, security-policy) \ id(X509_CERTIFICATE, x509-certificate) \ + id(MODULE_COMPRESSED, kernel-module-compressed) \ id(MAX_ID, ) #define __fid_enumify(ENUM, dummy) READING_ ## ENUM,
include/linux/skmsg.h +0 -14
@@ -561,20 +561,6 @@ static inline bool sk_psock_strp_enabled(struct sk_psock *psock)return !!psock->saved_data_ready; } -/* for tcp only, sk is locked */ -static inline ssize_t sk_psock_msg_inq (struct sock *sk) -{ -struct sk_psock *psock; -ssize_t inq =0 ; - - psock =sk_psock_get (sk); -if (likely (psock)) { - inq =sk_psock_get_msg_len_nolock (psock); -sk_psock_put (sk, psock); - } -return inq; -} -/* for udp only, sk is not locked */ static inline ssize_t sk_msg_first_len (struct sock *sk) {
include/net/bluetooth/rfcomm.h +1 -0
@@ -210,6 +210,7 @@ struct rfcomm_dlc {#define RFCOMM_AUTH_REJECT 7#define RFCOMM_DEFER_SETUP 8#define RFCOMM_ENC_DROP 9 +#define RFCOMM_CLOSED 10/* Scheduling flags and events */ #define RFCOMM_SCHED_WAKEUP 31
include/net/mana/mana.h +3 -1
@@ -325,7 +325,9 @@ struct mana_recv_buf_oob {#define MANA_RXBUF_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) \ + ETH_HLEN) -#define MANA_XDP_MTU_MAX (PAGE_SIZE - MANA_RXBUF_PAD - XDP_PACKET_HEADROOM) +#define MANA_XDP_MTU_MAX (ndev) \ + (PAGE_SIZE - MANA_RXBUF_PAD - \ + max_t(u32, LL_RESERVED_SPACE(ndev), XDP_PACKET_HEADROOM))struct mana_rxq {struct gdma_queue *gdma_rq;
io_uring/io_uring.c +7 -5
@@ -2832,8 +2832,9 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, u32 flags,static void io_rings_free (struct io_ring_ctx *ctx) { -io_free_region (ctx, &ctx->sq_region); -io_free_region (ctx, &ctx->ring_region); +/* ring memory is not charged to RLIMIT_MEMLOCK, hence no user */ +io_free_region (NULL , &ctx->sq_region); +io_free_region (NULL , &ctx->ring_region); ctx->rings =NULL ;RCU_INIT_POINTER (ctx->rings_rcu,NULL ); ctx->sq_sqes =NULL ;
@@ -2915,7 +2916,7 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)io_eventfd_unregister (ctx);io_free_alloc_caches (ctx);io_destroy_buffers (ctx); -io_free_region (ctx, &ctx->param_region); +io_free_region (ctx->user, &ctx->param_region);mutex_unlock (&ctx->uring_lock);if (ctx->sq_creds)put_cred (ctx->sq_creds);
@@ -3688,7 +3689,8 @@ static __cold int io_allocate_scq_urings(struct io_ring_ctx *ctx, rd.user_addr = p->cq_off.user_addr; rd.flags |=IORING_MEM_REGION_TYPE_USER ; } - ret =io_create_region (ctx, &ctx->ring_region, &rd,IORING_OFF_CQ_RING ); +/* ring memory is not charged to RLIMIT_MEMLOCK, hence no user */ + ret =io_create_region (NULL , &ctx->ring_region, &rd,IORING_OFF_CQ_RING );if (ret)return ret; ctx->rings = rings =io_region_get_ptr (&ctx->ring_region);
@@ -3711,7 +3713,7 @@ static __cold int io_allocate_scq_urings(struct io_ring_ctx *ctx, rd.user_addr = p->sq_off.user_addr; rd.flags |=IORING_MEM_REGION_TYPE_USER ; } - ret =io_create_region (ctx, &ctx->sq_region, &rd,IORING_OFF_SQES ); + ret =io_create_region (NULL , &ctx->sq_region, &rd,IORING_OFF_SQES );if (ret) {io_rings_free (ctx);return ret;
io_uring/kbuf.c +3 -3
@@ -444,7 +444,7 @@ static int io_remove_buffers_legacy(struct io_ring_ctx *ctx,static void io_put_bl (struct io_ring_ctx *ctx,struct io_buffer_list *bl) {if (bl->flags &IOBL_BUF_RING ) -io_free_region (ctx, &bl->region); +io_free_region (NULL , &bl->region);else io_remove_buffers_legacy (ctx, bl,-1U );
@@ -661,7 +661,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg) rd.user_addr = reg.ring_addr; rd.flags |=IORING_MEM_REGION_TYPE_USER ; } - ret =io_create_region_mmap_safe (ctx, &bl->region, &rd, mmap_offset); + ret =io_create_region_mmap_safe (ctx,NULL , &bl->region, &rd, mmap_offset);if (ret) goto fail; br =io_region_get_ptr (&bl->region);
@@ -695,7 +695,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)if (!ret)return 0 ; fail: -io_free_region (ctx, &bl->region); +io_free_region (NULL , &bl->region);kfree (bl);return ret; }
io_uring/memmap.c +14 -15
@@ -88,7 +88,7 @@ enum { IO_REGION_F_SINGLE_REF = 4, }; -void io_free_region (struct io_ring_ctx *ctx,struct io_mapped_region *mr) +void io_free_region (struct user_struct *user,struct io_mapped_region *mr) {if (mr->pages) {long nr_refs = mr->nr_pages;
@@ -105,8 +105,8 @@ void io_free_region(struct io_ring_ctx *ctx, struct io_mapped_region *mr) }if ((mr->flags &IO_REGION_F_VMAP ) && mr->ptr)vunmap (mr->ptr); -if (mr->nr_pages && ctx->user) -__io_unaccount_mem (ctx->user, mr->nr_pages); +if (mr->nr_pages && user) +__io_unaccount_mem (user, mr->nr_pages);memset (mr,0 ,sizeof (*mr)); }
@@ -131,8 +131,7 @@ static int io_region_init_ptr(struct io_mapped_region *mr)return 0 ; } -static int io_region_pin_pages (struct io_ring_ctx *ctx, -struct io_mapped_region *mr, +static int io_region_pin_pages (struct io_mapped_region *mr,struct io_uring_region_desc *reg) {unsigned long size = (size_t ) mr->nr_pages <<PAGE_SHIFT ;
@@ -150,8 +149,7 @@ static int io_region_pin_pages(struct io_ring_ctx *ctx,return 0 ; } -static int io_region_allocate_pages (struct io_ring_ctx *ctx, -struct io_mapped_region *mr, +static int io_region_allocate_pages (struct io_mapped_region *mr,struct io_uring_region_desc *reg,unsigned long mmap_offset) {
@@ -185,7 +183,7 @@ static int io_region_allocate_pages(struct io_ring_ctx *ctx,return 0 ; } -int io_create_region (struct io_ring_ctx *ctx,struct io_mapped_region *mr, +int io_create_region (struct user_struct *user,struct io_mapped_region *mr,struct io_uring_region_desc *reg,unsigned long mmap_offset) {
@@ -211,17 +209,17 @@ int io_create_region(struct io_ring_ctx *ctx, struct io_mapped_region *mr,return -EOVERFLOW ; nr_pages = reg->size >>PAGE_SHIFT ; -if (ctx->user) { - ret =__io_account_mem (ctx->user, nr_pages); +if (user) { + ret =__io_account_mem (user, nr_pages);if (ret)return ret; } mr->nr_pages = nr_pages;if (reg->flags &IORING_MEM_REGION_TYPE_USER ) - ret =io_region_pin_pages (ctx, mr, reg); + ret =io_region_pin_pages (mr, reg);else - ret =io_region_allocate_pages (ctx, mr, reg, mmap_offset); + ret =io_region_allocate_pages (mr, reg, mmap_offset);if (ret) goto out_free;
@@ -230,11 +228,12 @@ int io_create_region(struct io_ring_ctx *ctx, struct io_mapped_region *mr, goto out_free;return 0 ; out_free: -io_free_region (ctx, mr); +io_free_region (user, mr);return ret; } -int io_create_region_mmap_safe (struct io_ring_ctx *ctx,struct io_mapped_region *mr, +int io_create_region_mmap_safe (struct io_ring_ctx *ctx,struct user_struct *user, +struct io_mapped_region *mr,struct io_uring_region_desc *reg,unsigned long mmap_offset) {
@@ -242,7 +241,7 @@ int io_create_region_mmap_safe(struct io_ring_ctx *ctx, struct io_mapped_regionint ret;memcpy (&tmp_mr, mr,sizeof (tmp_mr)); - ret =io_create_region (ctx, &tmp_mr, reg, mmap_offset); + ret =io_create_region (user, &tmp_mr, reg, mmap_offset);if (ret)return ret;
io_uring/memmap.h +3 -3
@@ -16,12 +16,12 @@ unsigned long io_uring_get_unmapped_area(struct file *file, unsigned long addr, unsigned long flags);int io_uring_mmap (struct file *file,struct vm_area_struct *vma); -void io_free_region (struct io_ring_ctx *ctx,struct io_mapped_region *mr); -int io_create_region (struct io_ring_ctx *ctx,struct io_mapped_region *mr, +void io_free_region (struct user_struct *user,struct io_mapped_region *mr); +int io_create_region (struct user_struct *user,struct io_mapped_region *mr,struct io_uring_region_desc *reg,unsigned long mmap_offset); -int io_create_region_mmap_safe (struct io_ring_ctx *ctx, +int io_create_region_mmap_safe (struct io_ring_ctx *ctx,struct user_struct *user,struct io_mapped_region *mr,struct io_uring_region_desc *reg,unsigned long mmap_offset);
io_uring/register.c +8 -7
@@ -383,8 +383,9 @@ static void io_register_free_rings(struct io_ring_ctx *ctx,struct io_uring_params *p, struct io_ring_ctx_rings *r) { - io_free_region(ctx, &r->sq_region); -io_free_region (ctx, &r->ring_region); +/* ring memory is not charged to RLIMIT_MEMLOCK, hence no user */ + io_free_region(NULL, &r->sq_region); +io_free_region (NULL , &r->ring_region); }#define swap_old (ctx, o, n, field) \
@@ -433,7 +434,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg) rd.user_addr = p.cq_off.user_addr; rd.flags |=IORING_MEM_REGION_TYPE_USER ; } - ret =io_create_region_mmap_safe (ctx, &n.ring_region, &rd,IORING_OFF_CQ_RING ); + ret =io_create_region_mmap_safe (ctx,NULL , &n.ring_region, &rd,IORING_OFF_CQ_RING );if (ret) {io_register_free_rings (ctx, &p, &n);return ret;
@@ -473,7 +474,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg) rd.user_addr = p.sq_off.user_addr; rd.flags |=IORING_MEM_REGION_TYPE_USER ; } - ret =io_create_region_mmap_safe (ctx, &n.sq_region, &rd,IORING_OFF_SQES ); + ret =io_create_region_mmap_safe (ctx,NULL , &n.sq_region, &rd,IORING_OFF_SQES );if (ret) {io_register_free_rings (ctx, &p, &n);return ret;
@@ -633,13 +634,13 @@ static int io_register_mem_region(struct io_ring_ctx *ctx, void __user *uarg) !(ctx->flags & IORING_SETUP_R_DISABLED))return -EINVAL ; - ret =io_create_region_mmap_safe (ctx, &ctx->param_region, &rd, -IORING_MAP_OFF_PARAM_REGION ); + ret =io_create_region_mmap_safe (ctx, ctx->user, &ctx->param_region, + &rd,IORING_MAP_OFF_PARAM_REGION );if (ret)return ret;if (copy_to_user (rd_uptr, &rd,sizeof (rd))) {guard (mutex)(&ctx->mmap_lock); -io_free_region (ctx, &ctx->param_region); +io_free_region (ctx->user, &ctx->param_region);return -EFAULT ; }
io_uring/zcrx.c +2 -2
@@ -371,7 +371,7 @@ static int io_allocate_rbuf_ring(struct io_zcrx_ifq *ifq, mmap_offset =IORING_MAP_OFF_ZCRX_REGION ; mmap_offset += id <<IORING_OFF_PBUF_SHIFT ; - ret =io_create_region (ifq->ctx, &ifq->region, rd, mmap_offset); + ret =io_create_region (ifq->ctx->user, &ifq->region, rd, mmap_offset);if (ret <0 )return ret;
@@ -387,7 +387,7 @@ static int io_allocate_rbuf_ring(struct io_zcrx_ifq *ifq,static void io_free_rbuf_ring (struct io_zcrx_ifq *ifq) { -io_free_region (ifq->ctx, &ifq->region); +io_free_region (ifq->ctx->user, &ifq->region); ifq->rq_ring =NULL ; ifq->rqes =NULL ; }
kernel/kexec_handover.c +1 -1
@@ -365,7 +365,7 @@ static void kho_mem_ser_free(struct khoser_mem_chunk *first_chunk)struct khoser_mem_chunk *tmp = chunk; chunk =KHOSER_LOAD_PTR (chunk->hdr.next); -kfree (tmp); +free_page ((unsigned long )tmp); } }
kernel/module/main.c +14 -3
@@ -3692,24 +3692,35 @@ static int idempotent_wait_for_completion(struct idempotent *u)static int init_module_from_file (struct file *f,const char __user * uargs,int flags) { +bool compressed = !!(flags &MODULE_INIT_COMPRESSED_FILE );struct load_info info = { };void *buf =NULL ;int len; +int err; - len =kernel_read_file (f,0 , &buf,INT_MAX ,NULL ,READING_MODULE ); + len =kernel_read_file (f,0 , &buf,INT_MAX ,NULL , + compressed ?READING_MODULE_COMPRESSED : +READING_MODULE );if (len <0 ) {mod_stat_inc (&failed_kreads);return len; } -if (flags &MODULE_INIT_COMPRESSED_FILE ) { -int err =module_decompress (&info, buf, len); +if (compressed) { + err =module_decompress (&info, buf, len);vfree (buf);/* compressed data is no longer needed */ if (err) {mod_stat_inc (&failed_decompress);mod_stat_add_long (len, &invalid_decompress_bytes);return err; } + err =security_kernel_post_read_file (f, (char *)info.hdr, info.len, +READING_MODULE ); +if (err) { +mod_stat_inc (&failed_kreads); +free_copy (&info, flags); +return err; + } }else { info.hdr = buf; info.len = len;
kernel/sched/ext.c +26 -3
@@ -1369,8 +1369,8 @@ static void set_task_runnable(struct rq *rq, struct task_struct *p) }/* -* list_add_tail() must be used. scx_bypass() depends on tasks being -* appended to the runnable_list. +* list_add_tail() must be used. scx_bypass() and rq_offline_scx() +* depend on tasks being appended to the runnable_list. */ list_add_tail (&p->scx.runnable_node, &rq->scx.runnable_list); }
@@ -2147,8 +2147,14 @@ static int balance_one(struct rq *rq, struct task_struct *prev)if (consume_global_dsq (sch, rq)) goto has_tasks; +/* +* scx_rq_online() can't be used. Its cpu_active() test goes false +* before CPU hotplug waits for an RCU grace period, and +* rq_offline_scx() moves this CPU's tasks to the local DSQ only after +* the wait. The grace period can depend on those tasks running. +*/ if (unlikely (!SCX_HAS_OP (sch, dispatch)) || -scx_rq_bypassing (rq) || !scx_rq_online (rq)) +scx_rq_bypassing (rq) || !(rq->scx.flags &SCX_RQ_ONLINE )) goto no_tasks; dspc->rq = rq;
@@ -2677,7 +2683,24 @@ static void rq_online_scx(struct rq *rq)static void rq_offline_scx (struct rq *rq) { +struct task_struct *p, *n; + rq->scx.flags &= ~SCX_RQ_ONLINE ; + +/* sched domain rebuilds call rq_offline with the CPU staying alive */ +if (cpu_active (cpu_of (rq))) +return ; + +/* +* An offline CPU no longer calls ops.dispatch(). Re-enqueue its tasks +* onto the local DSQ so that they run here and balance_push() moves +* them off. +*/ +list_for_each_entry_safe_reverse (p, n, &rq->scx.runnable_list, scx.runnable_node) { +if (p->scx.dsq == &rq->scx.local_dsq) +continue ; +guard (sched_change)(p,DEQUEUE_SAVE |DEQUEUE_MOVE |DEQUEUE_NOCLOCK ); + } }
kernel/sched/sched.h +3 -2
@@ -3905,8 +3905,9 @@ extern void balance_callbacks(struct rq *rq, struct balance_callback *head);* after which it is enqueued again. * * Typically this must be called while holding task_rq_lock, since most/all -* properties are serialized under those locks. There is currently one -* exception to this rule in sched/ext which only holds rq->lock. +* properties are serialized under those locks. There are currently two +* exceptions to this rule in sched/ext which only hold rq->lock: scx_bypass() +* and rq_offline_scx(). */ /*
mm/damon/core.c +15 -9
@@ -1568,6 +1568,10 @@ int damon_call(struct damon_ctx *ctx, struct damon_call_control *control)* passed at least one &damos->apply_interval_us, kdamond marks the request as * completed so that damos_walk() can wakeup and return. * +* Note that this function should be called only after damon_start() with the +* @ctx has succeeded. Otherwise, this function could fall into an indefinite +* wait. +* * Return: 0 on success, negative error code otherwise. */ int damos_walk (struct damon_ctx *ctx,struct damos_walk_control *control)
@@ -1575,19 +1579,16 @@ int damos_walk(struct damon_ctx *ctx, struct damos_walk_control *control)init_completion (&control->completion); control->canceled = false;mutex_lock (&ctx->walk_control_lock); +if (ctx->walk_control_obsolete) { +mutex_unlock (&ctx->walk_control_lock); +return -ECANCELED ; + }if (ctx->walk_control) {mutex_unlock (&ctx->walk_control_lock);return -EBUSY ; } ctx->walk_control = control;mutex_unlock (&ctx->walk_control_lock); -if (!damon_is_running (ctx)) { -mutex_lock (&ctx->walk_control_lock); -if (ctx->walk_control == control) - ctx->walk_control =NULL ; -mutex_unlock (&ctx->walk_control_lock); -return -EINVAL ; - }wait_for_completion (&control->completion);if (control->canceled)return -ECANCELED ;
@@ -2725,6 +2726,9 @@ static int kdamond_fn(void *data)mutex_lock (&ctx->call_controls_lock); ctx->call_controls_obsolete = false;mutex_unlock (&ctx->call_controls_lock); +mutex_lock (&ctx->walk_control_lock); + ctx->walk_control_obsolete = false; +mutex_unlock (&ctx->walk_control_lock);complete (&ctx->kdamond_started);kdamond_init_ctx (ctx);
@@ -2838,14 +2842,16 @@ static int kdamond_fn(void *data) ctx->call_controls_obsolete = true;mutex_unlock (&ctx->call_controls_lock);kdamond_call (ctx, true); +mutex_lock (&ctx->walk_control_lock); + ctx->walk_control_obsolete = true; +mutex_unlock (&ctx->walk_control_lock); +damos_walk_cancel (ctx);pr_debug ("kdamond (%d) finishes\n" , current->pid);mutex_lock (&ctx->kdamond_lock); ctx->kdamond =NULL ;mutex_unlock (&ctx->kdamond_lock); -damos_walk_cancel (ctx); -mutex_lock (&damon_lock); nr_running_ctxs--;if (!nr_running_ctxs && running_exclusive_ctxs)
mm/mremap.c +28 -10
@@ -1025,8 +1025,8 @@ static void vrm_stat_account(struct vma_remap_struct *vrm, }/* -* Perform checks before attempting to write a VMA prior to it being -* moved. +* Perform checks and preparation before attempting to write a VMA prior to it +* being moved. */ static unsigned long prep_move_vma (struct vma_remap_struct *vrm) {
@@ -1035,18 +1035,17 @@ static unsigned long prep_move_vma(struct vma_remap_struct *vrm)unsigned long old_addr = vrm->addr;unsigned long old_len = vrm->old_len;vm_flags_t dummy = vma->vm_flags; +const bool split_before = vma->vm_start != old_addr; +const bool split_after = vma->vm_end != old_addr + old_len; -/* -* We'd prefer to avoid failure later on in do_munmap: -* which may split one vma into three before unmapping. -*/ +/* Avoid failure later on. */ if (current->mm->map_count >= sysctl_max_map_count -3 )return -ENOMEM ;if (vma->vm_ops && vma->vm_ops->may_split) { -if (vma->vm_start != old_addr) +if (split_before) err = vma->vm_ops->may_split (vma, old_addr); -if (!err && vma->vm_end != old_addr + old_len) +if (!err && split_after) err = vma->vm_ops->may_split (vma, old_addr + old_len);if (err)return err;
@@ -1064,6 +1063,22 @@ static unsigned long prep_move_vma(struct vma_remap_struct *vrm)if (err)return err; +/* +* To account mlock()'d pages correctly in the MREMAP_DONTUNMAP +* case perform any split ahead of time for an mlock()'d VMA. +*/ +if ((vrm->flags &MREMAP_DONTUNMAP ) && + (vma->vm_flags &VM_LOCKED )) { +VMA_ITERATOR (vmi, vma->vm_mm, old_addr); + +if (split_before) + err =split_vma (&vmi, vma, old_addr,1 ); +if (!err && split_after) + err =split_vma (&vmi, vma, old_addr + old_len,0 ); + vrm->vmi_needs_invalidate = true; +return err; + } +return 0 ; }
@@ -1191,7 +1206,7 @@ static int copy_vma_and_data(struct vma_remap_struct *vrm,PAGETABLE_MOVE (pmc,NULL ,NULL , vrm->addr, vrm->new_addr, vrm->old_len); new_vma =copy_vma (&vma, vrm->new_addr, vrm->new_len, new_pgoff, - &pmc.need_rmap_locks); + &pmc.need_rmap_locks, vrm->flags &MREMAP_DONTUNMAP );if (!new_vma) {vrm_uncharge (vrm); *new_vma_ptr =NULL ;
@@ -1251,6 +1266,9 @@ static void dontunmap_complete(struct vma_remap_struct *vrm,unsigned long old_start = vma->vm_start;unsigned long old_end = vma->vm_end; +/* Self-merge is disallowed. */ +VM_WARN_ON_ONCE (new_vma == vma); +/* We always clear VM_LOCKED[ONFAULT] on the old VMA. */ vm_flags_clear (vma,VM_LOCKED_MASK );
@@ -1258,7 +1276,7 @@ static void dontunmap_complete(struct vma_remap_struct *vrm,* anon_vma links of the old vma is no longer needed after its page * table has been moved. */ -if (new_vma != vma && start == old_start && end == old_end) { +if (start == old_start && end == old_end) {const pgoff_t pgoff_unfaulted = vma->vm_start >>PAGE_SHIFT ;unlink_anon_vmas (vma);
mm/vma.c +18 -3
@@ -584,8 +584,8 @@ __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma,* Split a vma into two pieces at address 'addr', a new vma is allocated * either for the first part or the tail. */ -static int split_vma (struct vma_iterator *vmi,struct vm_area_struct *vma, -unsigned long addr,int new_below) +int split_vma (struct vma_iterator *vmi,struct vm_area_struct *vma, +unsigned long addr,int new_below) {if (vma->vm_mm->map_count >= sysctl_max_map_count)return -ENOMEM ;
@@ -1852,7 +1852,7 @@ int vma_link(struct mm_struct *mm, struct vm_area_struct *vma)*/ struct vm_area_struct *copy_vma (struct vm_area_struct **vmap,unsigned long addr,unsigned long len,pgoff_t pgoff, -bool *need_rmap_locks) +bool *need_rmap_locks,bool keep_source) {struct vm_area_struct *vma = *vmap;unsigned long vma_start = vma->vm_start;
@@ -1885,6 +1885,21 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, vmg.pgoff = pgoff; vmg.next =vma_iter_next_rewind (&vmi,NULL ); + +/* +* If the original VMA is kept (MREMAP_DONTUNMAP), the source and +* destination VMA must be treated distinctly. +* +* A merge violates this, so in this case disallow a self-merge. +*/ +if (!faulted_in_anon_vma && keep_source) { +if (vmg.prev == vma) + vmg.prev =NULL ; +if (vmg.next == vma) + vmg.next =NULL ; + faulted_in_anon_vma = true; + } + new_vma =vma_merge_copied_range (&vmg);if (new_vma) {
mm/vma.h +6 -1
@@ -389,7 +389,7 @@ int vma_link(struct mm_struct *mm, struct vm_area_struct *vma);struct vm_area_struct *copy_vma (struct vm_area_struct **vmap,unsigned long addr,unsigned long len,pgoff_t pgoff, -bool *need_rmap_locks); +bool *need_rmap_locks,bool keep_source);struct anon_vma *find_mergeable_anon_vma (struct vm_area_struct *vma);
@@ -409,6 +409,11 @@ int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *brkvma,unsigned long unmapped_area (struct vm_unmapped_area_info *info);unsigned long unmapped_area_topdown (struct vm_unmapped_area_info *info); +#ifdef CONFIG_MMU +int split_vma (struct vma_iterator *vmi,struct vm_area_struct *vma, +unsigned long addr,int new_below); +#endif +static inline bool vma_wants_manual_pte_write_upgrade (struct vm_area_struct *vma) {/*
net/bluetooth/rfcomm/core.c +95 -39
191 lines not on this page · raw message
net/ipv4/tcp_bpf.c +16 -1
@@ -334,6 +334,7 @@ static int tcp_bpf_recvmsg_parser(struct sock *sk,static int tcp_bpf_ioctl (struct sock *sk,int cmd,int *karg) { +struct sk_psock *psock;bool slow;if (cmd !=SIOCINQ )
@@ -344,7 +345,21 @@ static int tcp_bpf_ioctl(struct sock *sk, int cmd, int *karg)return -EINVAL ; slow =lock_sock_fast (sk); - *karg =sk_psock_msg_inq (sk); + psock =sk_psock_get (sk); +if (unlikely (!psock)) { +unlock_sock_fast (sk, slow); +return tcp_ioctl (sk, cmd, karg); + } + *karg =sk_psock_get_msg_len_nolock (psock); +/* Without a verdict program, ingress data is never diverted to +* ingress_msg: it stays in sk_receive_queue and is read through +* the fallback to tcp_recvmsg(), so account for it like +* tcp_ioctl() does. +*/ +if (!READ_ONCE (psock->progs.stream_verdict) && + !READ_ONCE (psock->progs.skb_verdict)) + *karg +=tcp_inq (sk); +sk_psock_put (sk, psock);unlock_sock_fast (sk, slow);return 0 ;
net/ipv6/ip6_gre.c +0 -7
@@ -922,7 +922,6 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb, {struct ip_tunnel_info *tun_info =NULL ;struct ip6_tnl *t =netdev_priv (dev); -struct dst_entry *dst =skb_dst (skb);IP_TUNNEL_DECLARE_FLAGS (flags) = { };bool truncate = false;int encap_limit =-1 ;
@@ -1058,12 +1057,6 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,gre_build_header (skb,8 , flags, proto,0 ,htonl (atomic_fetch_inc (&t->o_seqno))); -/* TooBig packet may have updated dst->dev's mtu */ -if (!t->parms.collect_md && dst) { - mtu =READ_ONCE (dst_dev (dst)->mtu); -if (dst6_mtu (dst) > mtu) - dst->ops->update_pmtu (dst,NULL , skb, mtu, false); - } err =ip6_tnl_xmit (skb, dev, dsfield, &fl6, encap_limit, &mtu,NEXTHDR_GRE );if (err !=0 ) {
net/rose/af_rose.c +39 -5
74 lines not on this page · raw message
net/rose/rose_timer.c +5 -0
@@ -188,6 +188,11 @@ static void rose_heartbeat_expiry(struct timer_list *t)rose_neigh_put (rose->neighbour); rose->neighbour =NULL ; } +/* Tell rose_accept() and the listener's teardown, which +* may still hold this socket on their queue, that it is +* gone. +*/ +sock_set_flag (sk,SOCK_DESTROY );bh_unlock_sock (sk);rose_destroy_socket (sk);sock_put (sk);
security/integrity/ima/ima.h +4 -2
@@ -441,7 +441,8 @@ int ima_check_blacklist(struct ima_iint_cache *iint,int ima_appraise_measurement (enum ima_hooks func,struct ima_iint_cache *iint,struct file *file,const unsigned char *filename,struct evm_ima_xattr_data *xattr_value, -int xattr_len,const struct modsig *modsig); +int xattr_len,const struct modsig *modsig, +bool bprm_is_check);int ima_must_appraise (struct mnt_idmap *idmap,struct inode *inode,int mask,enum ima_hooks func);void ima_update_xattr (struct ima_iint_cache *iint,struct file *file);
@@ -466,7 +467,8 @@ static inline int ima_appraise_measurement(enum ima_hooks func,const unsigned char *filename, struct evm_ima_xattr_data *xattr_value, int xattr_len, - const struct modsig *modsig) + const struct modsig *modsig, + bool bprm_is_check) { return INTEGRITY_UNKNOWN; }
security/integrity/ima/ima_appraise.c +3 -13
@@ -480,17 +480,6 @@ int ima_check_blacklist(struct ima_iint_cache *iint,return rc; } -static bool is_bprm_creds_for_exec (enum ima_hooks func,struct file *file) -{ -struct linux_binprm *bprm; - -if (func ==BPRM_CHECK ) { - bprm = container_of(&file, struct linux_binprm, file); -return bprm->is_check; - } -return false; -} -/* * ima_appraise_measurement - appraise file measurement *
@@ -502,7 +491,8 @@ static bool is_bprm_creds_for_exec(enum ima_hooks func, struct file *file)int ima_appraise_measurement (enum ima_hooks func,struct ima_iint_cache *iint,struct file *file,const unsigned char *filename,struct evm_ima_xattr_data *xattr_value, -int xattr_len,const struct modsig *modsig) +int xattr_len,const struct modsig *modsig, +bool bprm_is_check) {static const char op[] ="appraise_data" ;int audit_msgno =AUDIT_INTEGRITY_DATA ;
@@ -524,7 +514,7 @@ int ima_appraise_measurement(enum ima_hooks func, struct ima_iint_cache *iint,* of the script interpreter(userspace). Differentiate kernel and * userspace enforced integrity audit messages. */ -if (is_bprm_creds_for_exec (func, file)) +if (bprm_is_check) audit_msgno =AUDIT_INTEGRITY_USERSPACE ;/* If reading the xattr failed and there's no modsig, error out. */
security/integrity/ima/ima_main.c +21 -9
@@ -235,7 +235,9 @@ static void ima_file_free(struct file *file)static int process_measurement (struct file *file,const struct cred *cred,struct lsm_prop *prop,char *buf,loff_t size, -int mask,enum ima_hooks func) +int mask,enum ima_hooks func, +enum kernel_read_file_id read_id, +bool bprm_is_check) {struct inode *real_inode, *inode =file_inode (file);struct ima_iint_cache *iint =NULL ;
@@ -406,6 +408,12 @@ static int process_measurement(struct file *file, const struct cred *cred,if (rc !=0 && rc != -EBADF && rc != -EINVAL ) goto out_locked; +/* Defer measuring/appraising kernel modules to READING_MODULE */ +if (read_id ==READING_MODULE_COMPRESSED ) { + must_appraise =0 ; + goto out_locked; + } +if (!pathbuf)/* ima_rdwr_violation possibly pre-fetched */ pathname =ima_d_path (&file->f_path, &pathbuf, filename);
@@ -419,7 +427,8 @@ static int process_measurement(struct file *file, const struct cred *cred,inode_lock (inode); rc =ima_appraise_measurement (func, iint, file, pathname, xattr_value, - xattr_len, modsig); + xattr_len, modsig, + bprm_is_check);inode_unlock (inode); }if (!rc)
@@ -486,14 +495,15 @@ static int ima_file_mmap(struct file *file, unsigned long reqprot,if (reqprot &PROT_EXEC ) { ret =process_measurement (file,current_cred (), &prop,NULL , -0 ,MAY_EXEC ,MMAP_CHECK_REQPROT ); +0 ,MAY_EXEC ,MMAP_CHECK_REQPROT ,0 , + false);if (ret)return ret; }if (prot &PROT_EXEC )return process_measurement (file,current_cred (), &prop,NULL , -0 ,MAY_EXEC ,MMAP_CHECK ); +0 ,MAY_EXEC ,MMAP_CHECK ,0 , false);return 0 ; }
@@ -577,7 +587,8 @@ static int ima_bprm_check(struct linux_binprm *bprm)security_current_getlsmprop_subj (&prop);return process_measurement (bprm->file,current_cred (), - &prop,NULL ,0 ,MAY_EXEC ,BPRM_CHECK ); + &prop,NULL ,0 ,MAY_EXEC ,BPRM_CHECK ,0 , + bprm->is_check); }/**
@@ -607,7 +618,7 @@ static int ima_creds_check(struct linux_binprm *bprm, const struct file *file)security_current_getlsmprop_subj (&prop);return process_measurement ((struct file *)file, bprm->cred, &prop,NULL , -0 ,MAY_EXEC ,CREDS_CHECK ); +0 ,MAY_EXEC ,CREDS_CHECK ,0 , false); }/**
@@ -655,7 +666,7 @@ static int ima_file_check(struct file *file, int mask)security_current_getlsmprop_subj (&prop);return process_measurement (file,current_cred (), &prop,NULL ,0 , mask & (MAY_READ |MAY_WRITE |MAY_EXEC | -MAY_APPEND ),FILE_CHECK ); +MAY_APPEND ),FILE_CHECK ,0 , false); }/*
@@ -911,12 +922,13 @@ static int ima_read_file(struct file *file, enum kernel_read_file_id read_id, func = read_idmap[read_id] ?:FILE_CHECK ;security_current_getlsmprop_subj (&prop);return process_measurement (file,current_cred (), &prop,NULL ,0 , -MAY_READ , func); +MAY_READ , func,0 , false); }const int read_idmap[READING_MAX_ID ] = { [READING_FIRMWARE ] =FIRMWARE_CHECK , [READING_MODULE ] =MODULE_CHECK , + [READING_MODULE_COMPRESSED ] =MODULE_CHECK , [READING_KEXEC_IMAGE ] =KEXEC_KERNEL_CHECK , [READING_KEXEC_INITRAMFS ] =KEXEC_INITRAMFS_CHECK , [READING_POLICY ] =POLICY_CHECK
@@ -954,7 +966,7 @@ static int ima_post_read_file(struct file *file, char *buf, loff_t size, func = read_idmap[read_id] ?:FILE_CHECK ;security_current_getlsmprop_subj (&prop);return process_measurement (file,current_cred (), &prop, buf, size, -MAY_READ , func); +MAY_READ , func, read_id, false); }/**
security/integrity/ima/ima_policy.c +2 -1
@@ -241,7 +241,8 @@ static struct ima_rule_entry build_appraise_rules[] __ro_after_init = {static struct ima_rule_entry secure_boot_rules[]__ro_after_init = { {.action =APPRAISE , .func =MODULE_CHECK , - .flags =IMA_FUNC |IMA_DIGSIG_REQUIRED }, + .flags =IMA_FUNC |IMA_DIGSIG_REQUIRED |IMA_MODSIG_ALLOWED | +IMA_CHECK_BLACKLIST }, {.action =APPRAISE , .func =FIRMWARE_CHECK , .flags =IMA_FUNC |IMA_DIGSIG_REQUIRED }, {.action =APPRAISE , .func =KEXEC_KERNEL_CHECK ,
security/ipe/hooks.c +1 -0
@@ -119,6 +119,7 @@ int ipe_kernel_read_file(struct file *file, enum kernel_read_file_id id, op =IPE_OP_FIRMWARE ;break ;case READING_MODULE : +case READING_MODULE_COMPRESSED : op =IPE_OP_KERNEL_MODULE ;break ;case READING_KEXEC_INITRAMFS :
security/selinux/hooks.c +3 -2
@@ -4514,7 +4514,7 @@ static int selinux_kernel_read_file(struct file *file, {int rc =0 ; -BUILD_BUG_ON_MSG (READING_MAX_ID >7 , +BUILD_BUG_ON_MSG (READING_MAX_ID >8 ,"New kernel_read_file_id introduced; update SELinux!" );switch (id) {
@@ -4522,6 +4522,7 @@ static int selinux_kernel_read_file(struct file *file, rc =selinux_kernel_load_from_file (file,SYSTEM__FIRMWARE_LOAD );break ;case READING_MODULE : +case READING_MODULE_COMPRESSED : rc =selinux_kernel_load_from_file (file,SYSTEM__MODULE_LOAD );break ;case READING_KEXEC_IMAGE :
@@ -4550,7 +4551,7 @@ static int selinux_kernel_load_data(enum kernel_load_data_id id, bool contents) {int rc =0 ; -BUILD_BUG_ON_MSG (LOADING_MAX_ID >7 , +BUILD_BUG_ON_MSG (LOADING_MAX_ID >8 ,"New kernel_load_data_id introduced; update SELinux!" );switch (id) {
security/selinux/selinuxfs.c +4 -23
@@ -74,7 +74,6 @@ struct selinux_fs_info {int *bool_pending_values;struct dentry *class_dir;unsigned long last_class_ino; -bool policy_opened;struct dentry *policycap_dir;unsigned long last_ino;struct super_block *sb;
@@ -340,44 +339,31 @@ struct policy_load_memory {static int sel_open_policy (struct inode *inode,struct file *filp) { -struct selinux_fs_info *fsi = inode->i_sb->s_fs_info;struct policy_load_memory *plm =NULL ;int rc; -BUG_ON (filp->private_data); - -mutex_lock (&selinux_state.policy_mutex); - rc =avc_has_perm (current_sid (),SECINITSID_SECURITY ,SECCLASS_SECURITY ,SECURITY__READ_POLICY ,NULL );if (rc) - goto err; - - rc = -EBUSY ; -if (fsi->policy_opened) - goto err; +return rc; - rc = -ENOMEM ; plm =kzalloc (sizeof (*plm),GFP_KERNEL );if (!plm) - goto err; +return -ENOMEM ; +mutex_lock (&selinux_state.policy_mutex); rc =security_read_policy (&plm->data, &plm->len);if (rc) goto err; -if ((size_t )i_size_read (inode) != plm->len) {inode_lock (inode);i_size_write (inode, plm->len);inode_unlock (inode); } - - fsi->policy_opened =1 ; +mutex_unlock (&selinux_state.policy_mutex); filp->private_data = plm; -mutex_unlock (&selinux_state.policy_mutex); -return 0 ; err:mutex_unlock (&selinux_state.policy_mutex);
@@ -390,13 +376,8 @@ static int sel_open_policy(struct inode *inode, struct file *filp)static int sel_release_policy (struct inode *inode,struct file *filp) { -struct selinux_fs_info *fsi = inode->i_sb->s_fs_info;struct policy_load_memory *plm = filp->private_data; -BUG_ON (!plm); - - fsi->policy_opened =0 ; -vfree (plm->data);kfree (plm);
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.