Linux 6.6.161
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.6.161 kernel.
All users of the 6.6 kernel series must upgrade.
The updated 6.6.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.6.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/nios2/include/asm/checksum.h | 2 arch/s390/pci/pci_sysfs.c | 3 arch/x86/kvm/mmu/mmu.c | 4 arch/x86/kvm/vmx/nested.c | 4 block/blk-mq.c | 32 +- block/bsg-lib.c | 13 crypto/asymmetric_keys/restrict.c | 8 drivers/gpio/gpio-mxc.c | 67 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 21 - drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 25 + drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 drivers/gpu/drm/drm_exec.c | 73 ++-- drivers/gpu/drm/i915/display/intel_dmc.c | 21 + drivers/hv/channel_mgmt.c | 12 drivers/hv/connection.c | 1 drivers/hv/vmbus_drv.c | 1 drivers/i2c/busses/i2c-qcom-cci.c | 4 drivers/i2c/busses/i2c-wmt.c | 2 drivers/md/dm-cache-target.c | 59 ++- drivers/md/dm-crypt.c | 3 drivers/md/dm-ebs-target.c | 3 drivers/md/dm-integrity.c | 5 drivers/md/dm-table.c | 2 drivers/net/bonding/bond_main.c | 20 - drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 drivers/net/gtp.c | 2 drivers/net/wireless/intersil/p54/fwio.c | 42 ++ drivers/pinctrl/pinctrl-amd.c | 9 drivers/pinctrl/qcom/pinctrl-ipq5018.c | 10 drivers/power/supply/ds2780_battery.c | 2 drivers/power/supply/generic-adc-battery.c | 9 drivers/s390/net/ctcm_mpc.c | 3 drivers/scsi/libiscsi.c | 14 drivers/scsi/libsas/sas_expander.c | 14 drivers/scsi/mpi3mr/mpi3mr_app.c | 2 drivers/scsi/scsi_transport_fc.c | 5 drivers/scsi/scsi_transport_iscsi.c | 3 drivers/scsi/scsi_transport_sas.c | 6 drivers/scsi/st.c | 18 - drivers/scsi/xen-scsifront.c | 1 drivers/spi/spi-tegra114.c | 7 drivers/target/iscsi/iscsi_target_configfs.c | 26 + drivers/ufs/core/ufs_bsg.c | 3 fs/autofs/waitq.c | 25 + fs/coredump.c | 16 - fs/ext4/ext4.h | 2 fs/ext4/extents_status.c | 7 fs/ext4/extents_status.h | 1 fs/ext4/mballoc.c | 21 - fs/ext4/super.c | 13 fs/notify/mark.c | 11 fs/ntfs3/ntfs_fs.h | 1 fs/ntfs3/super.c | 29 + fs/ocfs2/dlm/dlmcommon.h | 2 fs/ocfs2/dlm/dlmdebug.c | 5 fs/ocfs2/dlm/dlmrecovery.c | 2 fs/pipe.c | 6 fs/smb/client/cifssmb.c | 13 fs/smb/client/connect.c | 21 + fs/smb/client/smb2ops.c | 7 fs/smb/server/smb2pdu.c | 5 fs/tracefs/event_inode.c | 16 - fs/unicode/utf8-core.c | 21 + fs/xfs/libxfs/xfs_sb.c | 17 - fs/xfs/xfs_fsmap.c | 2 fs/xfs/xfs_ioctl.c | 2 fs/xfs/xfs_iops.c | 2 include/drm/drm_exec.h | 9 include/linux/bsg-lib.h | 3 include/linux/cgroup-defs.h | 5 include/linux/device-mapper.h | 5 include/linux/fsnotify_backend.h | 1 include/linux/futex.h | 14 include/linux/io_uring_types.h | 6 include/linux/ipv6.h | 22 + include/linux/key-type.h | 1 include/linux/key.h | 5 include/linux/mm_types.h | 3 include/linux/power_supply.h | 6 include/linux/sched.h | 2 include/linux/sched/signal.h | 27 + include/linux/sched/user.h | 8 include/linux/srcutiny.h | 4 include/linux/unicode.h | 1 include/net/af_vsock.h | 3 include/net/codel_impl.h | 1 include/net/ipv6.h | 2 include/net/netfilter/nf_tables_ipv6.h | 4 io_uring/cancel.c | 36 +- io_uring/cancel.h | 12 io_uring/io-wq.c | 112 ++++++- io_uring/io-wq.h | 4 io_uring/io_uring.c | 144 +++++++-- io_uring/io_uring.h | 44 ++ io_uring/poll.c | 48 ++- io_uring/rw.c | 18 - io_uring/sqpoll.c | 7 io_uring/tctx.c | 1 io_uring/timeout.c | 88 ++++- kernel/cgroup/cgroup.c | 6 kernel/events/core.c | 33 -- kernel/exit.c | 51 ++- kernel/fork.c | 3 kernel/futex/core.c | 49 +-- kernel/pid_namespace.c | 5 kernel/ptrace.c | 6 kernel/rcu/srcutiny.c | 19 - kernel/signal.c | 4 kernel/trace/ftrace.c | 4 kernel/trace/trace.c | 6 kernel/trace/trace_events_filter.c | 15 kernel/trace/trace_events_hist.c | 52 +-- kernel/trace/trace_events_synth.c | 10 kernel/trace/trace_probe.c | 3 kernel/trace/trace_synth.h | 1 kernel/watch_queue.c | 16 - mm/huge_memory.c | 2 mm/khugepaged.c | 3 net/bluetooth/l2cap_core.c | 7 net/bluetooth/l2cap_sock.c | 2 net/bridge/br_multicast.c | 13 net/bridge/br_netfilter_ipv6.c | 2 net/bridge/netfilter/nf_conntrack_bridge.c | 4 net/core/page_pool.c | 3 net/ipv4/fib_semantics.c | 2 net/ipv4/tcp.c | 18 - net/ipv4/tcp_cong.c | 4 net/ipv4/tcp_dctcp.c | 4 net/ipv4/tcp_minisocks.c | 2 net/ipv4/tcp_output.c | 2 net/ipv4/udp.c | 11 net/ipv6/calipso.c | 6 net/ipv6/ip6_input.c | 2 net/ipv6/ip6_offload.c | 7 net/ipv6/output_core.c | 7 net/iucv/af_iucv.c | 42 +- net/mptcp/protocol.c | 7 net/mptcp/protocol.h | 8 net/netfilter/ipvs/ip_vs_xmit.c | 2 net/netfilter/nf_conntrack_ovs.c | 2 net/netfilter/nf_log_syslog.c | 2 net/netlink/af_netlink.c | 10 net/rds/rdma_transport.c | 38 ++ net/sched/act_api.c | 11 net/sched/cls_flower.c | 5 net/sched/sch_cake.c | 2 net/sctp/inqueue.c | 6 net/sctp/socket.c | 33 +- net/tipc/node.c | 2 net/vmw_vsock/af_vsock.c | 49 ++- net/vmw_vsock/virtio_transport_common.c | 3 samples/pidfd/Makefile | 2 security/keys/key.c | 13 security/keys/keyctl.c | 15 security/keys/keyring.c | 152 +++++----- security/keys/process_keys.c | 5 security/keys/trusted-keys/trusted_tpm1.c | 4 security/keys/trusted-keys/trusted_tpm2.c | 2 sound/soc/codecs/cs42l52.c | 2 sound/soc/codecs/cs42l56.c | 2 sound/soc/codecs/max98371.c | 2 sound/soc/codecs/nau8822.c | 4 sound/soc/codecs/pcm3168a.c | 2 sound/soc/codecs/wm8978.c | 4 sound/soc/intel/avs/pcm.c | 2 sound/soc/sof/ipc4-topology.c | 16 - sound/soc/stm/stm32_spdifrx.c | 2 tools/gpio/Makefile | 6 tools/testing/selftests/ftrace/test.d/filter/event-filter-incomplete.tc | 24 + 171 files changed, 1607 insertions(+), 732 deletions(-)
Aaron Ahmed (1):
ftrace: Initialize modname and offset in print_rec()
Abdul Wasey (1):
mptcp: move the OoO check back into __mptcp_try_fallback()
Adrian Martinez (1):
KEYS: Fix key_reject_and_link() race with keyring restriction
Adriel Santos (1):
pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12
Aleksandr Khromov (3):
ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION
ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION
ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in
Alexander Stein (1):
gpio: mxc: use BIT() macro
Alice Mikityanska (1):
net/ipv6: Introduce payload_len helpers
Allison Henderson (1):
net/rds: don't let the rdma_cm destroy an id RDS still owns on route failure
Amirmohammad Eftekhar (1):
KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
Amit Machhiwal (1):
tracing: Do not initialize tracefs work if tracing is disabled
Antoine Huret (1):
perf: Update cgroup time when rotating multiplexed events
Aohan Mei (2):
net: rds: fix uninitialized trans dereference in CM event handler net/sched: cls_flower: validate mask pointer after nla_next()
Aswin Karuvally (1):
s390/ctcm: Prevent XID null dereference
Avi Weiss (1):
ASoC: stm32: spdifrx: fix synchronization state check
Aviv Vaknin (1):
pid_namespace: make zap_pid_ns_processes() freezable
Bartosz Golaszewski (1):
gpio: mxc: use lock guards for the generic GPIO chip lock
Ben Cressey (2):
dm-crypt: fix a tiny race condition in crypt_dec_pending
dm-integrity: fix infinite loop on discard with large tag size
Benjamin Marzinski (1):
dm cache: fix issue with background work locking
Bryam Vargas (1):
net/iucv: fix the recvmsg window update
Carlos Jones Jr (1):
spi: tegra114: assert CS GPIO for every transfer in a message
Carlos Maiolino (1):
xfs: fix capability check in xfs
Cen Zhang (5):
ocfs2/dlm: Protect the recovery list during debugfs reads
keys: Avoid the owner account dereference in named keyring lookup
keys: Check the authorization payload in process keyring searches
keys: Protect the type name while describing a key
keys: Protect the read method check against type removal
Cen Zhang (Microsoft Security FORGE Labs) (3):
tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION)
tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO) io_uring/cancel: don't spin on local work the task can't run
Cen Zhang (Microsoft) (1):
watch_queue: Fix note pool publication race in watch_queue_set_size()
Charles Vosburgh (1):
sctp: validate chunk length in the inqueue parser
Chen Cheng (1):
dm-integrity: require stable writes for internal hash modes
Chengfeng Ye (1):
tipc: protect node reset trace dump with node lock
Christian Brauner (11):
unicode: free the map after a grace period
eventfs: Free the eventfs_inode after an rcu grace period too
ntfs3: free the sbi after a grace period
ext4: free the sbi after a grace period
io-wq: order the exit bit against worker creation task work
coredump: hold RCU while releasing parked threads
signal: don't retarget shared signals in a dying thread group
signal: only SIGKILL and the freezers interrupt a coredumping task
ptrace: refuse to change the signal mask of a user worker
signal: allow taks to temporarily block TIF_NOTIFY_SIGNAL
pid_namespace: prevent TIF_NOTIFY_SIGNAL from interrupting the reaper
Christian König (1):
drm/exec: don't immediately add prelocked obj to array of locked objs
Daehyeon Ko (2):
sctp: revalidate output stream after association connect wait vsock/virtio: validate packet source for connected sockets
David Carlier (1):
gtp: disable BH before calling udp_tunnel_xmit_skb()
David Rosca (1):
drm/amdgpu: Fix VCE 3 ring align_mask
Dibin Moolakadan Subrahmanian (1):
drm/i915/dmc: Harden DMC firmware payload parsing
Donggeun Yoo (4):
tracing: Fix the shift out of bounds in the log2 histogram modifier
tracing: Save the event file instead of the compatible histogram
tracing: Unregister field variable histograms when the command fails
tracing: Fix 64-bit and signed histogram fields on 32-bit kernels
Etienne Perot (1):
cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children
Florian Schauer (1):
page_pool: keep frag_offset aligned for odd-sized requests
Frank Sorenson (2):
smb: client: fix heap overflow in cifs_do_set_acl()
cifs: add revalidation on FSCTL failure in smb2_duplicate_extents()
Genjian Zhang (1):
dm-ebs: fix incorrect device offset check in ebs_ctr()
Gilberto Conde (1):
pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13
Greg Kroah-Hartman (1):
Linux 6.6.161
Hangbin Liu (1):
bonding: do not set usable_slaves for broadcast mode
Haris Okanovic (1):
perf: Fix perf_pmu_migrate_context() leaving events behind
Heyang Tan (1):
wifi: p54: validate firmware record lengths
HyeongJun An (6):
ASoC: cs42l56: Put the Limiter Cushion control on the limiter register
ASoC: cs42l52: Fix the NG Type Switch bit
ASoC: pcm3168a: Fix the DAC zero flag polarity bit
ASoC: max98371: Fix the Speaker DHT Min Volume bits
ASoC: wm8978: Fix the 128x oversampling switch bits
ASoC: nau8822: Fix the 128x oversampling switch bits
Hyunwoo Kim (1):
KVM: x86/mmu: Preserve nested TDP shadow page tables if they are used as roots
Ido Schimmel (1):
ipv4: udp: Create exceptions before socket matching
Jann Horn (1):
futex: Fix mm reuse handling for FUT_OFF_MMSHARED
Jens Axboe (6):
exit: move core of do_wait() into helper
io_uring/cancel: don't default to setting req->work.cancel_seq io_uring/timeout: don't put a sequence target behind the last flush io_uring/timeout: don't flush with the sequence behind the last flush io_uring/timeout: don't lose a cancel as io-wq arms a timeout io_uring/poll: don't loop on HUP with multiple references
Jesse Zhang (2):
drm/amdgpu: don't drop the runtime PM reference twice in amdgpu_gpr drm/amdgpu: free the userptr ranges when a CS fails after parser_bos
Joas Antonio dos Santos (1):
calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()
Jonas Köppeler (1):
net_sched: codel: fix stale state for empty flows in fq_codel
Josef Bacik (20):
io_uring/wait: don't spin on a stuck overflow list io_uring/io-wq: don't lose the signal that ends work io_uring/io-wq: don't hide a link from cancellations
io_uring: don't flood a cancelling task with task_work io_uring/io-wq: don't strand work when a worker exits io_uring/io-wq: don't exit with a creation pending io_uring/io-wq: let cancel find picked up hashed work io_uring/poll: don't lose a cancel as io-wq arms poll io_uring/cancel: don't forget that the work was running io_uring/cancel: recognize "no timeout" on 32-bit io_uring/cancel: let CANCEL_ALL find parked requests
io_uring: wake ring pollers for local task_work io_uring/wait: look at all CQ waiters on wake up io_uring/poll: drop stale double poll entry on rearm io_uring/timeout: don't skip over reached sequences io_uring/timeout: keep repeat count on multishot update io_uring/sqpoll: let the thread sleep on disabled rings
io_uring: don't pass restart error codes to userspace io_uring/timeout: no ABS update of multishot timeouts
io_uring: look up the file before queueing to io-wq
Joseph Qi (1):
eventfs: fix SRCU read lock leak in eventfs_iterate()
Juanlu Herrero (1):
io_uring/poll: avoid retry wakeup loss when dropping ownership
Jun Yang (1):
net: bridge: mcast: don't truncate the port group walk on teardown
Jérémy Jean (1):
net/sched: fix use-after-free in __tcf_action_put()
K Prateek Nayak (1):
kernel/watch_queue: Use pipe_buf() to retrieve the pipe buffer
Kairui Song (1):
mm, madvise: fix potential workingset node list_lru leaks
Karl Mehltretter (1):
power: supply: Fix maintenance charge table kernel-doc
Keith Busch (3):
blk-mq: pop cached request if it is usable
blk-mq: reinsert cached request to the list
nios2: fix __wsum type degradation in csum_fold()
Kyle Zeng (6):
netlink: reset skb headers before unicast and multicast filtering
pipe: preserve existing fasync readers on writer setup failure
netlink: avoid hashing the network namespace pointer
fsnotify: prevent mark additions during connector teardown
tracing: Reject incomplete event filter expressions
keys: make keyring indexes independent of kernel addresses
Laurence Oberman (2):
scsi: st: Save the visited block for the partition the drive is in
scsi: st: Fix use-after-free race between st_remove() and st_open()
Lee Jones (2):
tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields tracing/histograms: Verify event_call identity when updating synth_event refcount
Linfeng Sun (1):
scsi: target: iscsi: Fix race in discovery auth updates
Loic Poulain (1):
i2c: qcom-cci: Fix HALT_ACK reset request being dropped
Lorenzo Stoakes (ARM) (1):
perf: Track the perf mlock gift separately
Mario Limonciello (1):
pinctrl: amd: Clear S4 wake bits when firmware has _AEI
Martin Kaiser (1):
tracing: probes: error if BTF is required but unavailable
Matt Fleming (1):
mm/huge_memory: initialise workingset state before folio split
Michael Kelley (1):
Drivers: hv: Don't reset VMBus connection state on error/exit paths
Michal Luczaj (1):
vsock: treat TCP_CLOSING as once-established
Ming-Hung Tsai (1):
dm cache: fix demotion stats in passthrough mode
Nicolai Buchwitz (1):
net: bcmgenet: unshare the skb before writing the control block
Niklas Schnelle (1):
s390/pci: Fix leak of uninitialized kernel data in SCLP report
Ojaswin Mujoo (1):
ext4: fallback to complex scan if aligned scan doesn't work
Pauli Virtanen (1):
Bluetooth: L2CAP: refuse __l2cap_chan_add if chan already has conn
Paulo Alcantara (1):
smb: client: fix multiuser mount with krb5
Peng Fan (2):
gpio: mxc: fix both_edges bit operations
gpio: mxc: fix wakeup_pads bit operations
Peter Ujfalusi (1):
ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture
Sasha Levin (3):
samples: pidfd: fix userprogs typo
tools: gpio: fix building from the top level with O= Revert "srcu: Use irq_work to start GP in tiny SRCU"
Sergey Tiraspolsky (1):
ASoC: Intel: avs: Reset the stream unless it is already prepared
Srish Srinivasan (1):
keys/trusted_keys: return immediately after TPM unseal failure
Stanley Jhu (1):
scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies
Stefano Garzarella (1):
KEYS: trusted: Fix blob allocation size in tpm2_key_decode()
Sung Byeongchan (1):
autofs: ignore notification errors from a replaced pipe
Svyatoslav Ryhel (1):
power: supply: generic-adc-battery: Fix temperature IIO channel conversion
Taeyang Lee (2):
tracing: Check operator stack capacity before pushing
tracing: Keep the predicate limit separate from program capacity
Tengda Wu (1):
tracing: Fix hist trigger timestamps for buffered events
Timur Kristóf (1):
drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang
Tonghao Zhang (1):
net: bonding: update the slave array for broadcast mode
Waiman Long (1):
Drivers: hv: Avoid infinite retry loop in init_vp_index()
Weiming Shi (1):
asymmetric_keys: reject trust keys without IDs
Wentao Liang (1):
i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()
Xingui Yang (1):
scsi: libsas: Fix SMP IO deadlock during HA resume
Xueqin Luo (1):
power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
Yehyeong Lee (4):
scsi: xen/scsifront: Check for a NULL shadow entry on a backend response
scsi: libiscsi: Reject a negative task index from parse_pdu_itt
scsi: libiscsi: Validate the ITT reflected in a Reject PDU
scsi: libiscsi: Validate the task named by a management response
Yun Zhou (1):
xfs: don't hold buffer locks across sync transaction commit in xfs_sync_sb_buf
Zihan Xi (1):
ipv4: avoid divide by zero in fib_rebalance
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 6 -SUBLEVEL = 160 +SUBLEVEL = 161 EXTRAVERSION = NAME = Pinguïn Aangedreven
arch/nios2/include/asm/checksum.h +1 -1
@@ -27,7 +27,7 @@ static inline __sum16 csum_fold(__wsum sum) "add %0, %0, r8\n" "nor %0, %0, %0\n" : "=r" (sum) - : "r" (sum << 16), "0" (sum) + : "r" ((__force u32)sum << 16), "0" (sum) : "r8");return (__force __sum16 ) sum; }
arch/s390/pci/pci_sysfs.c +3 -0
@@ -146,6 +146,9 @@ static ssize_t report_error_write(struct file *filp, struct kobject *kobj,if (off || (count <sizeof (*report)))return -EINVAL ; +if (count < (report->length +sizeof (*report))) +return -EINVAL ; + ret =sclp_pci_report (report, zdev->fh, zdev->fid);return ret ? ret : count;
arch/x86/kvm/mmu/mmu.c +3 -1
@@ -2508,7 +2508,9 @@ static int mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp,* avoids retaining a large number of stale nested SPs. */ if (tdp_enabled && invalid_list && - child->role.guest_mode && !child->parent_ptes.val) + child->role.guest_mode && + !child->root_count && + !child->parent_ptes.val)return kvm_mmu_prepare_zap_page (kvm, child, invalid_list); }
arch/x86/kvm/vmx/nested.c +3 -1
@@ -3568,8 +3568,10 @@ enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, vmentry_fail_vmexit:vmx_switch_vmcs (vcpu, &vmx->vmcs01); -if (!from_vmentry) +if (!from_vmentry) { +nested_ept_uninit_mmu_context (vcpu);return NVMX_VMENTRY_VMEXIT ; + }kvm_vcpu_unmap (vcpu, &vmx->nested.apic_access_page_map, false);kvm_vcpu_unmap (vcpu, &vmx->nested.virtual_apic_map, true);
block/blk-mq.c +16 -16
@@ -2984,17 +2984,7 @@ static bool blk_mq_can_use_cached_rq(struct request *rq, struct blk_plug *plug,if (op_is_flush (rq->cmd_flags) !=op_is_flush (bio->bi_opf))return false; -/* -* If any qos ->throttle() end up blocking, we will have flushed the -* plug and hence killed the cached_rq list as well. Pop this entry -* before we throttle. -*/ plug->cached_rq =rq_list_next (rq); -rq_qos_throttle (rq->q, bio); - -blk_mq_rq_time_init (rq,0 ); - rq->cmd_flags = bio->bi_opf; -INIT_LIST_HEAD (&rq->queuelist);return true; }
@@ -3027,20 +3017,30 @@ void blk_mq_submit_bio(struct bio *bio) rq =rq_list_peek (&plug->cached_rq);if (rq && rq->q != q) rq =NULL ; +if (rq && !blk_mq_can_use_cached_rq (rq, plug, bio)) + rq =NULL ; }if (rq) {if (unlikely (bio_may_exceed_limits (bio, &q->limits))) { bio =__bio_split_to_limits (bio, &q->limits, &nr_segs); -if (!bio) +if (!bio) { +rq_list_add (&plug->cached_rq, rq);return ; + } } -if (!bio_integrity_prep (bio)) +if (!bio_integrity_prep (bio)) { +rq_list_add (&plug->cached_rq, rq);return ; -if (blk_mq_attempt_bio_merge (q, bio, nr_segs)) + } +if (blk_mq_attempt_bio_merge (q, bio, nr_segs)) { +rq_list_add (&plug->cached_rq, rq);return ; -if (blk_mq_can_use_cached_rq (rq, plug, bio)) - goto done; -percpu_ref_get (&q->q_usage_counter); + } +rq_qos_throttle (rq->q, bio); +blk_mq_rq_time_init (rq,0 ); + rq->cmd_flags = bio->bi_opf; +INIT_LIST_HEAD (&rq->queuelist); + goto done; }else {if (unlikely (bio_queue_enter (bio)))return ;
block/bsg-lib.c +10 -3
@@ -23,11 +23,14 @@ struct bsg_set {struct bsg_device *bd;bsg_job_fn *job_fn;bsg_timeout_fn *timeout_fn; +unsigned int reply_len; };static int bsg_transport_sg_io_fn (struct request_queue *q,struct sg_io_v4 *hdr,bool open_for_write,unsigned int timeout) { +struct bsg_set *bset = + container_of(q->tag_set, struct bsg_set, tag_set);struct bsg_job *job;struct request *rq;struct bio *bio;
@@ -50,7 +53,7 @@ static int bsg_transport_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr, reply = job->reply;memset (job,0 ,sizeof (*job)); job->reply = reply; - job->reply_len =SCSI_SENSE_BUFFERSIZE ; + job->reply_len = bset->reply_len; job->dd_data = job +1 ; job->request_len = hdr->request_len;
@@ -301,9 +304,10 @@ static blk_status_t bsg_queue_rq(struct blk_mq_hw_ctx *hctx,static int bsg_init_rq (struct blk_mq_tag_set *set,struct request *req,unsigned int hctx_idx,unsigned int numa_node) { + struct bsg_set *bset = container_of(set, struct bsg_set, tag_set);struct bsg_job *job =blk_mq_rq_to_pdu (req); - job->reply =kzalloc (SCSI_SENSE_BUFFERSIZE ,GFP_KERNEL ); + job->reply =kzalloc (bset->reply_len,GFP_KERNEL );if (!job->reply)return -ENOMEM ;return 0 ;
@@ -357,9 +361,11 @@ static const struct blk_mq_ops bsg_mq_ops = {* @job_fn: bsg job handler * @timeout: timeout handler function pointer * @dd_job_size: size of LLD data needed for each job +* @reply_len: size of the reply buffer needed for each job */ struct request_queue *bsg_setup_queue (struct device *dev,const char *name, -bsg_job_fn *job_fn,bsg_timeout_fn *timeout,int dd_job_size) +bsg_job_fn *job_fn,bsg_timeout_fn *timeout,int dd_job_size, +unsigned int reply_len) {struct bsg_set *bset;struct blk_mq_tag_set *set;
@@ -372,6 +378,7 @@ struct request_queue *bsg_setup_queue(struct device *dev, const char *name, bset->job_fn = job_fn; bset->timeout_fn = timeout; + bset->reply_len = reply_len; set = &bset->tag_set; set->ops = &bsg_mq_ops;
crypto/asymmetric_keys/restrict.c +6 -2
@@ -236,10 +236,14 @@ static int key_or_keyring_common(struct key *dest_keyring,if (IS_ERR (key)) key =NULL ; }else if (trusted->type == &key_type_asymmetric) { +const struct asymmetric_key_ids *kids;const struct asymmetric_key_id **signer_ids; - signer_ids = (const struct asymmetric_key_id **) -asymmetric_key_ids (trusted)->id; + kids =asymmetric_key_ids (trusted); +if (!kids) +return -ENOKEY ; + + signer_ids = (const struct asymmetric_key_id **)kids->id;/* * The auth_ids come from the candidate key (the
drivers/gpio/gpio-mxc.c +32 -35
145 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +6 -0
@@ -1440,6 +1440,7 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser)int amdgpu_cs_ioctl (struct drm_device *dev,void *data,struct drm_file *filp) {struct amdgpu_device *adev =drm_to_adev (dev); +struct amdgpu_bo_list_entry *e;struct amdgpu_cs_parser parser;int r;
@@ -1495,6 +1496,11 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)return 0 ; error_backoff: +/* amdgpu_cs_submit() only drops the ranges once it got that far. */ +amdgpu_bo_list_for_each_userptr_entry (e, parser.bo_list) { +amdgpu_ttm_tt_get_user_pages_done (e->bo->tbo.ttm, e->range); + e->range =NULL ; + }mutex_unlock (&parser.bo_list->bo_list_mutex); error_fini:
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3 -18
@@ -1157,7 +1157,6 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf, {struct amdgpu_device *adev = f->f_inode->i_private;int r; -ssize_t result =0 ;uint32_t offset, se, sh, cu, wave, simd, thread, bank, *data;if (size >4096 || size &3 || *pos &3 )
@@ -1202,25 +1201,11 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,pm_runtime_mark_last_busy (adev_to_drm (adev)->dev);pm_runtime_put_autosuspend (adev_to_drm (adev)->dev); +amdgpu_virt_disable_access_debugfs (adev); -while (size) { -uint32_t value; - - value = data[result >>2 ]; - r =put_user (value, (uint32_t *)buf); -if (r) { -amdgpu_virt_disable_access_debugfs (adev); - goto err; - } - - result +=4 ; - buf +=4 ; - size -=4 ; - } - + r =copy_to_user (buf, data, size) ? -EFAULT : size;kfree (data); -amdgpu_virt_disable_access_debugfs (adev); -return result; +return r; err:pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +21 -4
@@ -454,6 +454,9 @@ static void sdma_v3_0_ring_emit_hdp_flush(struct amdgpu_ring *ring)else ref_and_mask =REG_SET_FIELD (ref_and_mask,GPU_HDP_FLUSH_DONE ,SDMA1 ,1 ); +/* Hang workaround */ +amdgpu_ring_write (ring,SDMA_PKT_NOP_HEADER_OP (SDMA_OP_NOP )); +amdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_POLL_REGMEM ) |SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH (1 ) |SDMA_PKT_POLL_REGMEM_HEADER_FUNC (3 ));/* == */
@@ -481,6 +484,10 @@ static void sdma_v3_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 se unsigned flags) {bool write64bit = flags &AMDGPU_FENCE_FLAG_64BIT ; + +/* Hang workaround */ +amdgpu_ring_write (ring,SDMA_PKT_NOP_HEADER_OP (SDMA_OP_NOP )); +/* write the fence */ amdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ));amdgpu_ring_write (ring,lower_32_bits (addr));
@@ -489,7 +496,11 @@ static void sdma_v3_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 se/* optionally write high bits as well */ if (write64bit) { +/* Hang workaround */ +amdgpu_ring_write (ring,SDMA_PKT_NOP_HEADER_OP (SDMA_OP_NOP )); + addr +=4 ; +amdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ));amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));
@@ -1035,6 +1046,9 @@ static void sdma_v3_0_ring_emit_pipeline_sync(struct amdgpu_ring *ring)uint32_t seq = ring->fence_drv.sync_seq;uint64_t addr = ring->fence_drv.gpu_addr; +/* Hang workaround */ +amdgpu_ring_write (ring,SDMA_PKT_NOP_HEADER_OP (SDMA_OP_NOP )); +/* wait for idle */ amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) | SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(0) |
@@ -1063,6 +1077,9 @@ static void sdma_v3_0_ring_emit_vm_flush(struct amdgpu_ring *ring, {amdgpu_gmc_emit_flush_gpu_tlb (ring, vmid, pd_addr); +/* Hang workaround */ +amdgpu_ring_write (ring,SDMA_PKT_NOP_HEADER_OP (SDMA_OP_NOP )); +/* wait for flush */ amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) | SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(0) |
@@ -1571,11 +1588,11 @@ static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = { .get_wptr = sdma_v3_0_ring_get_wptr, .set_wptr = sdma_v3_0_ring_set_wptr, .emit_frame_size = -6 +/* sdma_v3_0_ring_emit_hdp_flush */ +6 +1 +/* sdma_v3_0_ring_emit_hdp_flush */ 3 +/* hdp invalidate */ -6 +/* sdma_v3_0_ring_emit_pipeline_sync */ -VI_FLUSH_GPU_TLB_NUM_WREG *3 +6 +/* sdma_v3_0_ring_emit_vm_flush */ - 10 + 10 + 10, /* sdma_v3_0_ring_emit_fence x3 for user fence, vm fence */ +6 +1 +/* sdma_v3_0_ring_emit_pipeline_sync */ +VI_FLUSH_GPU_TLB_NUM_WREG *3 +6 +1 +/* sdma_v3_0_ring_emit_vm_flush */ + (10 + 1) * 3, /* sdma_v3_0_ring_emit_fence x3 for user fence, vm fence */ .emit_ib_size = 7 + 6, /* sdma_v3_0_ring_emit_ib */ .emit_ib = sdma_v3_0_ring_emit_ib, .emit_fence = sdma_v3_0_ring_emit_fence,
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +1 -1
@@ -959,7 +959,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {static const struct amdgpu_ring_funcs vce_v3_0_ring_vm_funcs = { .type =AMDGPU_RING_TYPE_VCE , - .align_mask =0xf , + .align_mask =0x1f , .nop =VCE_CMD_NO_OP , .support_64bit_ptrs = false, .no_user_fence = true,
drivers/gpu/drm/drm_exec.c +43 -30
114 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dmc.c +16 -5
@@ -770,7 +770,7 @@ static u32 parse_dmc_fw_header(struct intel_dmc *dmc, }/* Cache the dmc header info. */ -if (mmio_count > mmio_count_max) { +if (!mmio_count || mmio_count > mmio_count_max) {drm_err (&i915->drm,"DMC firmware has wrong mmio count %u\n" , mmio_count);return 0 ; }
@@ -785,13 +785,21 @@ static u32 parse_dmc_fw_header(struct intel_dmc *dmc, dmc_info->mmioaddr[i] =_MMIO (mmioaddr[i]); dmc_info->mmiodata[i] = mmiodata[i]; } - dmc_info->mmio_count = mmio_count; - dmc_info->start_mmioaddr = start_mmioaddr; rem_size -= header_len_bytes;/* fw_size is in dwords, so multiplied by 4 to convert into bytes. */ - payload_size = dmc_header->fw_size *4 ; +if (check_mul_overflow (dmc_header->fw_size,4u , &payload_size)) { +drm_err (&i915->drm,"DMC fw_size too large (%u dwords)\n" , + dmc_header->fw_size); +return 0 ; + } + +if (!payload_size) { +drm_err (&i915->drm,"DMC firmware has empty payload\n" ); +return 0 ; + } +if (rem_size < payload_size) goto error_truncated;
@@ -799,12 +807,15 @@ static u32 parse_dmc_fw_header(struct intel_dmc *dmc,drm_err (&i915->drm,"DMC FW too big (%u bytes)\n" , payload_size);return 0 ; } - dmc_info->dmc_fw_size = dmc_header->fw_size; dmc_info->payload =kmalloc (payload_size,GFP_KERNEL );if (!dmc_info->payload)return 0 ; + dmc_info->mmio_count = mmio_count; + dmc_info->start_mmioaddr = start_mmioaddr; + dmc_info->dmc_fw_size = dmc_header->fw_size; + payload = (u8 *)(dmc_header) + header_len_bytes;memcpy (dmc_info->payload, payload, payload_size);
drivers/hv/channel_mgmt.c +9 -3
@@ -743,13 +743,14 @@ static void init_vp_index(struct vmbus_channel *channel)u32 i, ncpu =num_online_cpus ();cpumask_var_t available_mask;struct cpumask *allocated_mask; +const struct cpumask *node_mask;const struct cpumask *hk_mask =housekeeping_cpumask (HK_TYPE_MANAGED_IRQ );u32 target_cpu;int numa_node;if (!perf_chn || !alloc_cpumask_var (&available_mask,GFP_KERNEL ) || -cpumask_empty (hk_mask)) { + !cpumask_intersects (hk_mask, cpu_online_mask)) {/* * If the channel is not a performance critical * channel, bind it to VMBUS_CONNECT_CPU.
@@ -771,14 +772,19 @@ static void init_vp_index(struct vmbus_channel *channel) next_numa_node_id =0 ;continue ; } -if (cpumask_empty (cpumask_of_node (numa_node))) +/* +* Try next NUMA node if current NUMA node has no CPU +* or doesn't contain any housekeeping CPU. +*/ + node_mask =cpumask_of_node (numa_node); +if (!cpumask_intersects (node_mask, hk_mask))continue ;break ; } allocated_mask = &hv_context.hv_numa_map[numa_node]; retry: -cpumask_xor (available_mask, allocated_mask,cpumask_of_node (numa_node)); +cpumask_xor (available_mask, allocated_mask, node_mask);cpumask_and (available_mask, available_mask, hk_mask);if (cpumask_empty (available_mask)) {
drivers/hv/connection.c +0 -1
@@ -340,7 +340,6 @@ int vmbus_connect(void) cleanup:pr_err ("Unable to connect to host\n" ); - vmbus_connection.conn_state =DISCONNECTED ;vmbus_disconnect ();kfree (msginfo);
drivers/hv/vmbus_drv.c +0 -1
@@ -2707,7 +2707,6 @@ static void __exit vmbus_exit(void)hv_remove_kexec_handler ();hv_remove_crash_handler (); - vmbus_connection.conn_state =DISCONNECTED ;hv_stimer_global_cleanup ();vmbus_disconnect ();if (vmbus_irq ==-1 ) {
drivers/i2c/busses/i2c-qcom-cci.c +2 -2
@@ -168,12 +168,12 @@ static irqreturn_t cci_isr(int irq, void *dev) }if (unlikely (val &CCI_IRQ_STATUS_0_I2C_M0_Q0Q1_HALT_ACK )) { - reset =CCI_RESET_CMD_M0_MASK ; + reset |=CCI_RESET_CMD_M0_MASK ; ret =IRQ_HANDLED ; }if (unlikely (val &CCI_IRQ_STATUS_0_I2C_M1_Q0Q1_HALT_ACK )) { - reset =CCI_RESET_CMD_M1_MASK ; + reset |=CCI_RESET_CMD_M1_MASK ; ret =IRQ_HANDLED ; }
drivers/i2c/busses/i2c-wmt.c +1 -1
@@ -389,7 +389,7 @@ static int wmt_i2c_probe(struct platform_device *pdev)return -EINVAL ; } - i2c_dev->clk =of_clk_get (np,0 ); + i2c_dev->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (i2c_dev->clk)) {dev_err (&pdev->dev,"unable to request clock\n" );return PTR_ERR (i2c_dev->clk);
drivers/md/dm-cache-target.c +31 -28
129 lines not on this page · raw message
drivers/md/dm-crypt.c +1 -2
@@ -1794,7 +1794,6 @@ static void crypt_dec_pending(struct dm_crypt_io *io) {struct crypt_config *cc = io->cc;struct bio *base_bio = io->base_bio; -blk_status_t error = io->error;if (!atomic_dec_and_test (&io->io_pending))return ;
@@ -1816,7 +1815,7 @@ static void crypt_dec_pending(struct dm_crypt_io *io)else kfree (io->integrity_metadata); - base_bio->bi_status = error; + base_bio->bi_status = io->error;bio_endio (base_bio); }
drivers/md/dm-ebs-target.c +1 -2
@@ -265,8 +265,7 @@ static int ebs_ctr(struct dm_target *ti, unsigned int argc, char **argv) r = -EINVAL ;if (sscanf (argv[1 ],"%llu%c" , &tmp, &dummy) !=1 || - tmp != (sector_t )tmp || - (sector_t )tmp >= ti->len) { + tmp != (sector_t )tmp) { ti->error ="Invalid device offset sector" ; goto bad; }
drivers/md/dm-integrity.c +4 -1
@@ -1814,7 +1814,7 @@ static void integrity_metadata(struct work_struct *w)if (unlikely (dio->op ==REQ_OP_DISCARD )) {unsigned int bi_size = dio->bio_details.bi_iter.bi_size; -unsigned int max_size =likely (checksums != checksums_onstack) ?PAGE_SIZE :HASH_MAX_DIGESTSIZE ; +unsigned int max_size =likely (checksums != checksums_onstack) ?PAGE_SIZE :sizeof (checksums_onstack);unsigned int max_blocks = max_size / ic->tag_size;memset (checksums,DISCARD_FILLER , max_size);
@@ -3515,6 +3515,9 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim limits->io_min = ic->sectors_per_block <<SECTOR_SHIFT ; limits->dma_alignment = limits->logical_block_size -1 ; } + +if (ic->internal_hash && (ic->mode =='D' || ic->mode =='B' )) + ti->needs_stable_writes = true; }static void calculate_journal_section_size (struct dm_integrity_c *ic)
drivers/md/dm-table.c +1 -1
@@ -1944,7 +1944,7 @@ static int device_requires_stable_pages(struct dm_target *ti, struct dm_dev *dev, sector_t start, sector_t len, void *data) { - return bdev_stable_writes(dev->bdev); + return ti->needs_stable_writes || bdev_stable_writes(dev->bdev); } int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
drivers/net/bonding/bond_main.c +14 -6
@@ -2314,7 +2314,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,bpf_prog_inc (bond->xdp_prog); } -if (bond_mode_can_use_xmit_hash (bond)) +/* broadcast mode uses the all_slaves to loop through slaves. */ +if (bond_mode_can_use_xmit_hash (bond) || +BOND_MODE (bond) ==BOND_MODE_BROADCAST )bond_update_slave_arr (bond,NULL );bond_xdp_set_features (bond_dev);
@@ -2457,7 +2459,8 @@ static int __bond_release_one(struct net_device *bond_dev,bond_upper_dev_unlink (bond, slave); -if (bond_mode_can_use_xmit_hash (bond)) +if (bond_mode_can_use_xmit_hash (bond) || +BOND_MODE (bond) ==BOND_MODE_BROADCAST )bond_update_slave_arr (bond, slave); slave_info(bond_dev, slave_dev, "Releasing %s interface\n",
@@ -5109,13 +5112,18 @@ static void bond_set_slave_arr(struct bonding *bond, {struct bond_up_slave *usable, *all; - usable =rtnl_dereference (bond->usable_slaves); -rcu_assign_pointer (bond->usable_slaves, usable_slaves); -kfree_rcu (usable, rcu); - all =rtnl_dereference (bond->all_slaves);rcu_assign_pointer (bond->all_slaves, all_slaves);kfree_rcu (all, rcu); + +if (BOND_MODE (bond) ==BOND_MODE_BROADCAST ) { +kfree_rcu (usable_slaves, rcu); +return ; + } + + usable =rtnl_dereference (bond->usable_slaves); +rcu_assign_pointer (bond->usable_slaves, usable_slaves); +kfree_rcu (usable, rcu); }static void bond_reset_slave_arr (struct bonding *bond)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +10 -0
@@ -2104,6 +2104,16 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) goto out; } +/* We store Tx state in the control block, so the skb must not be +* shared, but ether_setup() leaves IFF_TX_SKB_SHARING set. +*/ + skb =skb_share_check (skb,GFP_ATOMIC ); +if (!skb) { +BCMGENET_STATS64_INC ((&ring->stats64), dropped); + ret =NETDEV_TX_OK ; + goto out; + } +/* Retain how many bytes will be sent on the wire, without TSB inserted * by transmit checksum offload */
drivers/net/gtp.c +2 -0
@@ -1827,6 +1827,7 @@ static int gtp_genl_send_echo_req(struct sk_buff *skb, struct genl_info *info)return -ENODEV ; } +local_bh_disable (); udp_tunnel_xmit_skb(rt, sk, skb_to_send, fl4.saddr, fl4.daddr, fl4.flowi4_tos,
@@ -1836,6 +1837,7 @@ static int gtp_genl_send_echo_req(struct sk_buff *skb, struct genl_info *info) !net_eq (sock_net (sk),dev_net (gtp->dev)), false); +local_bh_enable ();return 0 ; }
drivers/net/wireless/intersil/p54/fwio.c +37 -5
59 lines not on this page · raw message
drivers/pinctrl/pinctrl-amd.c +9 -0
@@ -871,6 +871,15 @@ static void amd_gpio_irq_init(struct amd_gpio *gpio_dev) mask =BIT (WAKE_CNTRL_OFF_S0I3 ) |BIT (WAKE_CNTRL_OFF_S3 ); +#ifdef CONFIG_ACPI +/* +* Platforms without _AEI leave GPIO wake sources to firmware, so +* preserve their S4 wake bits. +*/ +if (acpi_has_method (ACPI_HANDLE (&gpio_dev->pdev->dev),"_AEI" )) + mask |=BIT (WAKE_CNTRL_OFF_S4 ); +#endif +for (i =0 ; i < desc->npins; i++) {int pin = desc->pins[i].number;const struct pin_desc *pd =pin_desc_get (gpio_dev->pctrl, pin);
drivers/pinctrl/qcom/pinctrl-ipq5018.c +5 -5
@@ -363,7 +363,7 @@ static const char * const blsp1_uart0_groups[] = { };static const char *const gcc_plltest_groups[] = { -"gpio10" ,"gpio12" , +"gpio10" , };static const char *const gcc_tlmm_groups[] = {
@@ -557,7 +557,7 @@ static const char * const qdss_cti_trig_in_b0_groups[] = { };static const char *const pwm2_groups[] = { -"gpio44" , +"gpio12" ,"gpio44" , };static const char *const qdss_cti_trig_out_b1_groups[] = {
@@ -565,7 +565,7 @@ static const char * const qdss_cti_trig_out_b1_groups[] = { };static const char *const pwm3_groups[] = { -"gpio45" , +"gpio45" ,"gpio13" , };static const char *const qdss_cti_trig_in_b1_groups[] = {
@@ -690,8 +690,8 @@ static const struct msm_pingroup ipq5018_groups[] = {PINGROUP (9 , sdc1_clk, qspi_clk, _, qdss_tracedata_a, _, _, _, _, _),PINGROUP (10 , blsp0_spi, blsp1_uart0, led0, gcc_plltest, qdss_tracedata_a, _, _, _, _),PINGROUP (11 , blsp0_spi, blsp1_uart0, _, gcc_tlmm, qdss_tracedata_a, _, _, _, _), -PINGROUP (12 , blsp0_spi, blsp0_i2c, blsp1_uart0, _, gcc_plltest, qdss_tracedata_a, _, _, _), -PINGROUP (13 , blsp0_spi, blsp0_i2c, blsp1_uart0, _, qdss_tracedata_a, _, _, _, _), +PINGROUP (12 , blsp0_spi, blsp0_i2c, blsp1_uart0, _, pwm2, qdss_tracedata_a, _, _, _), +PINGROUP (13 , blsp0_spi, blsp0_i2c, blsp1_uart0, pwm3, qdss_tracedata_a, _, _, _, _),PINGROUP (14 , pcie0_clk, _, _, cri_trng0, qdss_tracedata_a, _, _, _, _),PINGROUP (15 , _, _, cri_trng1, qdss_tracedata_a, _, _, _, _, _), PINGROUP(16, pcie0_wake, _, _, cri_trng, qdss_tracedata_a, _, _, _, _),
drivers/power/supply/ds2780_battery.c +1 -1
@@ -304,7 +304,7 @@ static int ds2780_get_capacity(struct ds2780_device_info *dev_info,return ret; *capacity = raw; -return raw; +return 0 ; }static int ds2780_get_status (struct ds2780_device_info *dev_info,int *status)
drivers/power/supply/generic-adc-battery.c +7 -2
@@ -90,12 +90,17 @@ static int gab_read_channel(struct gab *adc_bat, enum gab_chan_type channel,int ret; ret =iio_read_channel_processed (adc_bat->channel[channel], result); -if (ret <0 ) +if (ret <0 ) {dev_err (&adc_bat->psy->dev,"read channel error: %d\n" , ret); +return ret; + } + +if (channel ==GAB_TEMP ) + *result /=100 ;/* Convert from milli- to deci-degree */ else *result *=1000 ; -return ret; +return 0 ; } static int gab_get_property(struct power_supply *psy,
drivers/s390/net/ctcm_mpc.c +1 -2
@@ -826,7 +826,7 @@ static void mpc_action_go_ready(fsm_instance *fsm, int event, void *arg)fsm_deltimer (&grp->timer); -if (grp->saved_xid2->xid2_flag2 ==0x40 ) { +if (priv->xid->xid2_flag2 ==0x40 ) { priv->xid->xid2_flag2 =0x00 ;if (grp->estconnfunc) { grp->estconnfunc(grp->port_num, 1,
@@ -1636,7 +1636,6 @@ static int mpc_validate_xid(struct mpcg_info *mpcginfo)"The XID used in the MPC protocol is not valid, " "rc = %d\n", rc); priv->xid->xid2_flag2 =0x40 ; - grp->saved_xid2->xid2_flag2 =0x40 ; }return rc;
drivers/scsi/libiscsi.c +8 -6
@@ -1142,13 +1142,15 @@ static int iscsi_handle_reject(struct iscsi_conn *conn, struct iscsi_hdr *hdr,spin_unlock (&conn->session->frwd_lock);spin_lock (&conn->session->back_lock); }else { -struct iscsi_task *task; +struct iscsi_task *task =NULL ;/* * Our nop as ping got dropped. We know the target * and transport are ok so just clean up */ - task =iscsi_itt_to_task (conn, rejected_pdu.itt); -if (!task) { +if (!iscsi_verify_itt (conn, rejected_pdu.itt)) + task =iscsi_itt_to_task (conn, rejected_pdu.itt); +if (!task || task->state ==ISCSI_TASK_FREE || + task->sc) {iscsi_conn_printk (KERN_ERR , conn,"Invalid pdu reject. Could " "not lookup rejected task.\n" );
@@ -1191,7 +1193,7 @@ struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *conn, itt_t itt) session->tt->parse_pdu_itt (conn, itt, &i,NULL ); else i =get_itt (itt); -if (i >= session->cmds_max) +if (i <0 || i >= session->cmds_max)return NULL ;return session->cmds[i];
@@ -1284,7 +1286,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,case ISCSI_OP_SCSI_TMFUNC_RSP :case ISCSI_OP_NOOP_IN : task =iscsi_itt_to_task (conn, hdr->itt); -if (!task) +if (!task || task->state ==ISCSI_TASK_FREE || task->sc)return ISCSI_ERR_BAD_ITT ;break ;default :
@@ -1384,7 +1386,7 @@ int iscsi_verify_itt(struct iscsi_conn *conn, itt_t itt)return ISCSI_ERR_BAD_ITT ; } -if (i >= session->cmds_max) { +if (i <0 || i >= session->cmds_max) {iscsi_conn_printk (KERN_ERR , conn,"received invalid itt index %u (max cmds " "%u.\n" , i, session->cmds_max);
drivers/scsi/libsas/sas_expander.c +12 -2
@@ -40,7 +40,11 @@ static int smp_execute_task_sg(struct domain_device *dev,to_sas_internal (dev->port->ha->shost->transportt);struct sas_ha_struct *ha = dev->port->ha; -pm_runtime_get_sync (ha->dev); +/* +* Non-blocking: a sync resume here would deadlock against +* sas_drain_work() during HA resume. +*/ +pm_runtime_get_noresume (ha->dev);mutex_lock (&dev->ex_dev.cmd_mutex);for (retry =0 ; retry <3 ; retry++) {if (test_bit (SAS_DEV_GONE , &dev->state)) {
@@ -113,7 +117,7 @@ static int smp_execute_task_sg(struct domain_device *dev, } }mutex_unlock (&dev->ex_dev.cmd_mutex); -pm_runtime_put_sync (ha->dev); +pm_runtime_put (ha->dev);BUG_ON (retry ==3 && task !=NULL );sas_free_task (task);
@@ -2142,6 +2146,11 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, goto out; } +/* The host may have autosuspended, resume it here. */ + ret =pm_runtime_resume_and_get (dev->port->ha->dev); +if (ret) + goto out; + ret =smp_execute_task_sg (dev, job->request_payload.sg_list, job->reply_payload.sg_list);if (ret >=0 ) {
@@ -2149,6 +2158,7 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, rcvlen = job->reply_payload.payload_len - ret; ret =0 ; } +pm_runtime_put (dev->port->ha->dev); out:bsg_job_done (job, ret, rcvlen);
drivers/scsi/mpi3mr/mpi3mr_app.c +1 -1
@@ -1551,7 +1551,7 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc) } q =bsg_setup_queue (bsg_dev,dev_name (bsg_dev), - mpi3mr_bsg_request,NULL ,0 ); + mpi3mr_bsg_request,NULL ,0 ,SCSI_SENSE_BUFFERSIZE );if (IS_ERR (q)) {ioc_err (mrioc,"%s: bsg registration failed\n" ,dev_name (bsg_dev));
drivers/scsi/scsi_transport_fc.c +3 -2
@@ -4293,7 +4293,7 @@ fc_bsg_hostadd(struct Scsi_Host *shost, struct fc_host_attrs *fc_host) "fc_host%d", shost->host_no); q =bsg_setup_queue (dev, bsg_name, fc_bsg_dispatch, fc_bsg_job_timeout, - i->f->dd_bsg_size); + i->f->dd_bsg_size,SCSI_SENSE_BUFFERSIZE );if (IS_ERR (q)) { dev_err(dev, "fc_host%d: bsg interface failed to initialize - setup queue\n",
@@ -4324,7 +4324,8 @@ fc_bsg_rportadd(struct Scsi_Host *shost, struct fc_rport *rport)return -ENOTSUPP ; q =bsg_setup_queue (dev,dev_name (dev), fc_bsg_dispatch_prep, - fc_bsg_job_timeout, i->f->dd_bsg_size); + fc_bsg_job_timeout, i->f->dd_bsg_size, +SCSI_SENSE_BUFFERSIZE );if (IS_ERR (q)) {dev_err (dev,"failed to setup bsg queue\n" );return PTR_ERR (q);
drivers/scsi/scsi_transport_iscsi.c +2 -1
@@ -1542,7 +1542,8 @@ iscsi_bsg_host_add(struct Scsi_Host *shost, struct iscsi_cls_host *ihost)return -ENOTSUPP ;snprintf (bsg_name,sizeof (bsg_name),"iscsi_host%d" , shost->host_no); - q =bsg_setup_queue (dev, bsg_name, iscsi_bsg_host_dispatch,NULL ,0 ); + q =bsg_setup_queue (dev, bsg_name, iscsi_bsg_host_dispatch,NULL ,0 , +SCSI_SENSE_BUFFERSIZE );if (IS_ERR (q)) {shost_printk (KERN_ERR , shost,"bsg interface failed to " "initialize - no request queue\n" );
drivers/scsi/scsi_transport_sas.c +4 -2
@@ -199,7 +199,8 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)if (rphy) { q =bsg_setup_queue (&rphy->dev,dev_name (&rphy->dev), - sas_smp_dispatch,NULL ,0 ); + sas_smp_dispatch,NULL ,0 , +SCSI_SENSE_BUFFERSIZE );if (IS_ERR (q))return PTR_ERR (q); rphy->q = q;
@@ -208,7 +209,8 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)snprintf (name,sizeof (name),"sas_host%d" , shost->host_no); q =bsg_setup_queue (&shost->shost_gendev, name, - sas_smp_dispatch,NULL ,0 ); + sas_smp_dispatch,NULL ,0 , +SCSI_SENSE_BUFFERSIZE );if (IS_ERR (q))return PTR_ERR (q);to_sas_host_attrs (shost)->q = q;
drivers/scsi/st.c +12 -6
@@ -3195,14 +3195,20 @@ static int set_location(struct scsi_tape *STp, unsigned int block, int partition partition >= ST_NBR_PARTITIONS)return (-EINVAL );if (partition != STp->partition) { -if (get_location (STp, &blk, &p,1 )) +/* +* Save the location for the partition the drive reports, +* not for STp->partition: after a reset STp->partition may +* not match the partition the drive is in. +*/ +if (get_location (STp, &blk, &p,1 ) || + p <0 || p >=ST_NBR_PARTITIONS ) STps->last_block_valid =0 ;else { - STps->last_block_valid =1 ; - STps->last_block_visited = blk; + STp->ps[p].last_block_valid =1 ; + STp->ps[p].last_block_visited = blk;DEBC_printk (STp,"Visited block %d for " "partition %d saved.\n" , - blk, STp->partition); + blk, p); } }
@@ -4443,11 +4449,11 @@ static int st_remove(struct device *dev)remove_cdevs (tpnt);mutex_lock (&st_ref_mutex); -kref_put (&tpnt->kref, scsi_tape_release); -mutex_unlock (&st_ref_mutex);spin_lock (&st_index_lock);idr_remove (&st_index_idr, index);spin_unlock (&st_index_lock); +kref_put (&tpnt->kref, scsi_tape_release); +mutex_unlock (&st_ref_mutex);return 0 ; }
drivers/scsi/xen-scsifront.c +1 -0
@@ -367,6 +367,7 @@ static void scsifront_do_response(struct vscsifrnt_info *info,struct vscsifrnt_shadow *shadow;if (ring_rsp->rqid >=VSCSIIF_MAX_REQS || + !info->shadow[ring_rsp->rqid] || !info->shadow[ring_rsp->rqid]->inflight) {scsifront_set_error (info,"illegal rqid returned by backend!" );return ;
drivers/spi/spi-tegra114.c +7 -0
@@ -859,6 +859,13 @@ static u32 tegra_spi_setup_transfer_one(struct spi_device *spi, command1 |=SPI_BIT_LENGTH (bits_per_word -1 ); } +/* +* Re-assert the CS GPIO for every transfer: transfer_end() drops it +* on cs_change, and the assert above only covers is_first_of_msg. +*/ +if (spi_get_csgpiod (spi,0 )) +gpiod_set_value (spi_get_csgpiod (spi,0 ),1 ); +return command1; }
drivers/target/iscsi/iscsi_target_configfs.c +19 -7
@@ -1306,17 +1306,24 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,return -EINVAL ; } +if (iscsit_get_tpg (discovery_tpg) <0 ) +return -EINVAL ; + param =iscsi_find_param_from_key (AUTHMETHOD , discovery_tpg->param_list); -if (!param) -return -EINVAL ; +if (!param) { + err = -EINVAL ; + goto out; + }if (op) {/* * Reset the AuthMethod key to CHAP. */ -if (iscsi_update_param_value (param,CHAP ) <0 ) -return -EINVAL ; +if (iscsi_update_param_value (param,CHAP ) <0 ) { + err = -EINVAL ; + goto out; + } discovery_tpg->tpg_attrib.authentication =1 ; iscsit_global->discovery_acl.node_auth.enforce_discovery_auth =1 ;
@@ -1327,8 +1334,10 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,/* * Reset the AuthMethod key to CHAP,None */ -if (iscsi_update_param_value (param,"CHAP,None" ) <0 ) -return -EINVAL ; +if (iscsi_update_param_value (param,"CHAP,None" ) <0 ) { + err = -EINVAL ; + goto out; + } discovery_tpg->tpg_attrib.authentication =0 ; iscsit_global->discovery_acl.node_auth.enforce_discovery_auth =0 ;
@@ -1337,7 +1346,10 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item, " Discovery TPG\n"); } -return count; + err = count; +out: +iscsit_put_tpg (discovery_tpg); +return err; }CONFIGFS_ATTR (iscsi_disc_, enforce_discovery_auth);
drivers/ufs/core/ufs_bsg.c +2 -1
@@ -256,7 +256,8 @@ int ufs_bsg_probe(struct ufs_hba *hba)if (ret) goto out; - q =bsg_setup_queue (bsg_dev,dev_name (bsg_dev), ufs_bsg_request,NULL ,0 ); + q =bsg_setup_queue (bsg_dev,dev_name (bsg_dev), ufs_bsg_request,NULL ,0 , +sizeof (struct ufs_rpmb_reply ));if (IS_ERR (q)) { ret =PTR_ERR (q);device_del (bsg_dev);
fs/autofs/waitq.c +19 -6
@@ -12,15 +12,13 @@*/ static autofs_wqt_t autofs_next_wait_queue =1 ; -void autofs_catatonic_mode (struct autofs_sb_info *sbi) +static void autofs_catatonic_mode_locked (struct autofs_sb_info *sbi) {struct autofs_wait_queue *wq, *nwq; -mutex_lock (&sbi->wq_mutex); -if (sbi->flags &AUTOFS_SBI_CATATONIC ) { -mutex_unlock (&sbi->wq_mutex); +lockdep_assert_held (&sbi->wq_mutex); +if (sbi->flags &AUTOFS_SBI_CATATONIC )return ; - }pr_debug ("entering catatonic mode\n" );
@@ -40,6 +38,21 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)fput (sbi->pipe);/* Close the pipe */ sbi->pipe =NULL ; sbi->pipefd =-1 ; +} + +void autofs_catatonic_mode (struct autofs_sb_info *sbi) +{ +mutex_lock (&sbi->wq_mutex); +autofs_catatonic_mode_locked (sbi); +mutex_unlock (&sbi->wq_mutex); +} + +static void autofs_catatonic_mode_for_pipe (struct autofs_sb_info *sbi, +struct file *pipe) +{ +mutex_lock (&sbi->wq_mutex); +if (sbi->pipe == pipe) +autofs_catatonic_mode_locked (sbi);mutex_unlock (&sbi->wq_mutex); }
@@ -170,7 +183,7 @@ static void autofs_notify_daemon(struct autofs_sb_info *sbi,autofs_wait_release (sbi, wq->wait_queue_token, ret);break ;default : -autofs_catatonic_mode (sbi); +autofs_catatonic_mode_for_pipe (sbi, pipe);break ; }fput (pipe);
fs/coredump.c +8 -8
@@ -416,7 +416,9 @@ static int zap_threads(struct task_struct *tsk,int nr = -EAGAIN ;spin_lock_irq (&tsk->sighand->siglock); -if (!(signal->flags &SIGNAL_GROUP_EXIT ) && !signal->group_exec_task) { +/* A freeze requested before the dump would be lost with TIF_SIGPENDING. */ +if (!(signal->flags &SIGNAL_GROUP_EXIT ) && !signal->group_exec_task && + !freezing (tsk) && !(tsk->jobctl &JOBCTL_TRAP_FREEZE )) { signal->core_state = core_state; nr =zap_process (tsk, exit_code);clear_tsk_thread_flag (tsk,TIF_SIGPENDING );
@@ -469,6 +471,8 @@ static void coredump_finish(bool core_dumped) current->signal->core_state =NULL ;spin_unlock_irq (¤t->sighand->siglock); +/* A released thread may exit and be freed before it is woken. */ +guard (rcu)();while ((curr = next) !=NULL ) { next = curr->next; task = curr->task;
@@ -477,6 +481,7 @@ static void coredump_finish(bool core_dumped)* ->task == NULL before we read ->next. */ smp_mb (); +/* Any wakeup now lets the thread exit, rcu keeps it alive. */ curr->task =NULL ;wake_up_process (task); }
@@ -484,13 +489,8 @@ static void coredump_finish(bool core_dumped)static bool dump_interrupted (void ) { -/* -* SIGKILL or freezing() interrupt the coredumping. Perhaps we -* can do try_to_freeze() and check __fatal_signal_pending(), -* but then we need to teach dump_write() to restart and clear -* TIF_SIGPENDING. -*/ -return fatal_signal_pending (current) ||freezing (current); +/* Only SIGKILL and the freezers set it after zap_threads(). */ +return task_sigpending (current); }static void wait_for_dump_helpers (struct file *file)
fs/ext4/ext4.h +2 -0
@@ -1669,6 +1669,8 @@ struct ext4_sb_info {struct list_head s_es_list;/* List of inodes with reclaimable extents */ long s_es_nr_inode;struct ext4_es_stats s_es_stats; +/* ext4_get_link() reads the sbi in rcu pathwalk */ +struct rcu_head s_rcu;struct mb_cache *s_ea_block_cache;struct mb_cache *s_ea_inode_cache;spinlock_t s_es_lock____cacheline_aligned_in_smp ;
fs/ext4/extents_status.c +6 -1
@@ -1749,12 +1749,17 @@ int ext4_es_register_shrinker(struct ext4_sb_info *sbi) }void ext4_es_unregister_shrinker (struct ext4_sb_info *sbi) +{ +unregister_shrinker (&sbi->s_es_shrinker); +} + +/* ext4_get_link() bumps the hit and miss counters in rcu pathwalk */ +void ext4_es_destroy_stats (struct ext4_sb_info *sbi) {percpu_counter_destroy (&sbi->s_es_stats.es_stats_cache_hits);percpu_counter_destroy (&sbi->s_es_stats.es_stats_cache_misses);percpu_counter_destroy (&sbi->s_es_stats.es_stats_all_cnt);percpu_counter_destroy (&sbi->s_es_stats.es_stats_shk_cnt); -unregister_shrinker (&sbi->s_es_shrinker); }/*
fs/ext4/extents_status.h +1 -0
@@ -241,6 +241,7 @@ static inline void ext4_es_store_pblock_status(struct extent_status *es,extern int ext4_es_register_shrinker (struct ext4_sb_info *sbi);extern void ext4_es_unregister_shrinker (struct ext4_sb_info *sbi); +extern void ext4_es_destroy_stats (struct ext4_sb_info *sbi);extern int ext4_seq_es_shrinker_info_show (struct seq_file *seq,void *v);
fs/ext4/mballoc.c +13 -8
@@ -2954,14 +2954,19 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac) ac->ac_groups_scanned++;if (cr ==CR_POWER2_ALIGNED )ext4_mb_simple_scan_group (ac, &e4b); -else if ((cr ==CR_GOAL_LEN_FAST || - cr ==CR_BEST_AVAIL_LEN ) && - sbi->s_stripe && - !(ac->ac_g_ex.fe_len % -EXT4_B2C (sbi, sbi->s_stripe))) -ext4_mb_scan_aligned (ac, &e4b); -else -ext4_mb_complex_scan_group (ac, &e4b); +else { +bool is_stripe_aligned = sbi->s_stripe && + !(ac->ac_g_ex.fe_len % +EXT4_B2C (sbi, sbi->s_stripe)); + +if ((cr ==CR_GOAL_LEN_FAST || + cr ==CR_BEST_AVAIL_LEN ) && + is_stripe_aligned) +ext4_mb_scan_aligned (ac, &e4b); + +if (ac->ac_status ==AC_STATUS_CONTINUE ) +ext4_mb_complex_scan_group (ac, &e4b); + }ext4_unlock_group (sb, group);ext4_mb_unload_buddy (&e4b);
fs/ext4/super.c +11 -2
@@ -1289,6 +1289,14 @@ static void ext4_flex_groups_free(struct ext4_sb_info *sbi) } } +static void ext4_put_sbi_rcu (struct rcu_head *head) +{ + struct ext4_sb_info *sbi = container_of(head, struct ext4_sb_info, s_rcu); + +ext4_es_destroy_stats (sbi); +kfree (sbi); +} +static void ext4_put_super (struct super_block *sb) {struct ext4_sb_info *sbi =EXT4_SB (sb);
@@ -1378,7 +1386,6 @@ static void ext4_put_super(struct super_block *sb)ext4_stop_mmpd (sbi);brelse (sbi->s_sbh); - sb->s_fs_info =NULL ;/* * Now that we are completely done shutting down the * superblock, we need to actually destroy the kobject.
@@ -1393,7 +1400,8 @@ static void ext4_put_super(struct super_block *sb)#if IS_ENABLED (CONFIG_UNICODE )utf8_unload (sb->s_encoding);#endif -kfree (sbi); +/* ext4_get_link() reads the sbi and the counters in rcu pathwalk */ +call_rcu (&sbi->s_rcu, ext4_put_sbi_rcu); }static struct kmem_cache *ext4_inode_cachep;
@@ -5688,6 +5696,7 @@ failed_mount8: __maybe_unused } failed_mount3a:ext4_es_unregister_shrinker (sbi); +ext4_es_destroy_stats (sbi); failed_mount3:/* flush s_sb_upd_work before sbi destroy */ flush_work (&sbi->s_sb_upd_work);
fs/notify/mark.c +11 -0
@@ -719,6 +719,11 @@ static int fsnotify_add_mark_list(struct fsnotify_mark *mark, goto out_err; } +if (conn->flags &FSNOTIFY_CONN_FLAG_DESTROYING ) { + err = -ENOENT ; + goto out_err; + } +/* is mark the first mark? */ if (hlist_empty (&conn->list)) {hlist_add_head_rcu (&mark->obj_list, &conn->list);
@@ -901,6 +906,12 @@ void fsnotify_destroy_marks(fsnotify_connp_t *connp) conn =fsnotify_grab_connector (connp);if (!conn)return ; +/* +* New marks could be inserted before our cursor and survive the final +* detachment of the connector from the object. Prevent additions to +* this connector before dropping its lock. +*/ + conn->flags |=FSNOTIFY_CONN_FLAG_DESTROYING ;/* * We have to be careful since we can race with e.g. * fsnotify_clear_marks_by_group() and once we drop the conn->lock, the
fs/ntfs3/ntfs_fs.h +1 -0
@@ -209,6 +209,7 @@ struct ntfs_index {/* Ntfs file system in-core superblock data. */ struct ntfs_sb_info {struct super_block *sb; +struct rcu_head rcu;u32 discard_granularity;u64 discard_granularity_mask_inv;// ~(discard_granularity_mask_inv-1)
fs/ntfs3/super.c +22 -7
@@ -183,7 +183,7 @@ void *ntfs_set_shared(void *ptr, u32 bytes)void *ret =NULL ;int i, j =-1 ; -spin_lock (&s_shared_lock); +spin_lock_bh (&s_shared_lock);for (i =0 ; i <ARRAY_SIZE (s_shared); i++) {if (!s_shared[i].cnt) { j = i;
@@ -201,7 +201,7 @@ void *ntfs_set_shared(void *ptr, u32 bytes) s_shared[j].cnt =1 ; ret = ptr; } -spin_unlock (&s_shared_lock); +spin_unlock_bh (&s_shared_lock);return ret; }
@@ -218,7 +218,7 @@ void *ntfs_put_shared(void *ptr)void *ret = ptr;int i; -spin_lock (&s_shared_lock); +spin_lock_bh (&s_shared_lock);for (i =0 ; i <ARRAY_SIZE (s_shared); i++) {if (s_shared[i].cnt && s_shared[i].ptr == ptr) {if (--s_shared[i].cnt)
@@ -226,7 +226,7 @@ void *ntfs_put_shared(void *ptr)break ; } } -spin_unlock (&s_shared_lock); +spin_unlock_bh (&s_shared_lock);return ret; }
@@ -624,6 +624,8 @@ static noinline void ntfs3_put_sbi(struct ntfs_sb_info *sbi)static void ntfs3_free_sbi (struct ntfs_sb_info *sbi) { +if (sbi->options) +put_mount_options (sbi->options);kfree (sbi->new_rec);kvfree (ntfs_put_shared (sbi->upcase));kvfree (sbi->def_table);
@@ -635,6 +637,11 @@ static void ntfs3_free_sbi(struct ntfs_sb_info *sbi)kfree (sbi); } +static void ntfs3_free_sbi_rcu (struct rcu_head *head) +{ +ntfs3_free_sbi (container_of(head ,struct ntfs_sb_info ,rcu )); +} +static void ntfs_put_super (struct super_block *sb) {struct ntfs_sb_info *sbi = sb->s_fs_info;
@@ -651,6 +658,12 @@ static void ntfs_put_super(struct super_block *sb)/* Mark rw ntfs as clear, if possible. */ ntfs_set_state (sbi,NTFS_DIRTY_CLEAR ); + +/* +* The mount options stay until the sbi is freed: ->d_hash() and +* ->d_compare() of a pathwalk in rcu mode read the nls table through +* them. +*/ ntfs3_put_sbi (sbi); }
@@ -1807,9 +1820,11 @@ static void ntfs3_kill_sb(struct super_block *sb)kill_block_super (sb); -if (sbi->options) -put_mount_options (sbi->options); -ntfs3_free_sbi (sbi); +/* +* A pathwalk in rcu mode may still be in ->d_hash() or ->d_compare() +* and read the upcase table and the nls table through the sbi. +*/ +call_rcu (&sbi->rcu, ntfs3_free_sbi_rcu); }// clang-format off
fs/ocfs2/dlm/dlmcommon.h +2 -0
@@ -435,6 +435,8 @@ enum { DLM_DEREF_LOCKRES_DONE = 522, }; +extern spinlock_t dlm_reco_state_lock; +struct dlm_reco_node_data {int state;
fs/ocfs2/dlm/dlmdebug.c +4 -1
@@ -792,8 +792,11 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len) buf + out, len - out); out +=scnprintf (buf + out, len - out,"\n" ); +spin_unlock (&dlm->spinlock); +/* Recovery Node State: */ out +=scnprintf (buf + out, len - out,"Recovery Node State:\n" ); +spin_lock (&dlm_reco_state_lock);list_for_each_entry (node, &dlm->reco.node_data, list) {switch (node->state) {case DLM_RECO_NODE_DATA_INIT :
@@ -825,7 +828,7 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len) node->node_num, state); } -spin_unlock (&dlm->spinlock); +spin_unlock (&dlm_reco_state_lock);return out; }
fs/ocfs2/dlm/dlmrecovery.c +1 -1
@@ -80,7 +80,7 @@ static int dlm_lockres_master_requery(struct dlm_ctxt *dlm,static u64 dlm_get_next_mig_cookie (void ); -static DEFINE_SPINLOCK (dlm_reco_state_lock); +DEFINE_SPINLOCK (dlm_reco_state_lock);static DEFINE_SPINLOCK (dlm_mig_cookie_lock);static u64 dlm_mig_cookie =1 ;
fs/pipe.c +4 -2
@@ -751,9 +751,11 @@ pipe_fasync(int fd, struct file *filp, int on)if (filp->f_mode &FMODE_READ ) retval =fasync_helper (fd, filp, on, &pipe->fasync_readers);if ((filp->f_mode &FMODE_WRITE ) && retval >=0 ) { +int read_ret = retval; + retval =fasync_helper (fd, filp, on, &pipe->fasync_writers); -if (retval <0 && (filp->f_mode &FMODE_READ )) -/* this can happen only if on == T */ +/* Undo only a reader entry added by this call. */ +if (retval <0 && read_ret >0 )fasync_helper (-1 , filp,0 , &pipe->fasync_readers); }__pipe_unlock (pipe);
fs/smb/client/cifssmb.c +11 -2
@@ -3152,6 +3152,7 @@ int cifs_do_set_acl(const unsigned int xid, struct cifs_tcon *tcon,int rc =0 ;int bytes_returned =0 ;__u16 params, byte_count, data_count, param_offset, offset; +size_t cifs_acl_size, bytes_available;cifs_dbg (FYI ,"In SetPosixACL (Unix) for path %s\n" , fileName); setAclRetry:
@@ -3170,8 +3171,7 @@ int cifs_do_set_acl(const unsigned int xid, struct cifs_tcon *tcon, } params =6 + name_len; pSMB->MaxParameterCount =cpu_to_le16 (2 ); -/* BB find max SMB size from sess */ - pSMB->MaxDataCount =cpu_to_le16 (1000 ); + pSMB->MaxDataCount = cpu_to_le16(min_t(unsigned int, CIFSMaxBufSize, USHRT_MAX)); pSMB->MaxSetupCount =0 ; pSMB->Reserved =0 ; pSMB->Flags =0 ;
@@ -3183,6 +3183,15 @@ int cifs_do_set_acl(const unsigned int xid, struct cifs_tcon *tcon, parm_data = ((char *)pSMB) +sizeof (pSMB->hdr.smb_buf_length) + offset; pSMB->ParameterOffset =cpu_to_le16 (param_offset); +/* make sure we can fit the larger cifs_posix_aces in the buffer */ + cifs_acl_size =sizeof (struct cifs_posix_acl ) + + (acl->a_count *sizeof (struct cifs_posix_ace )); + bytes_available = (CIFSMaxBufSize +MAX_HEADER_SIZE (tcon->ses->server)) - offset; +if (cifs_acl_size > bytes_available || cifs_acl_size >USHRT_MAX ) { + rc = -E2BIG ; + goto setACLerrorExit; + } +/* convert to on the wire format for POSIX ACL */ data_count =posix_acl_to_cifs (parm_data, acl, acl_type);
fs/smb/client/connect.c +16 -5
@@ -4147,14 +4147,25 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,return rc; } -static int -cifs_set_vol_auth (struct smb3_fs_context *ctx,struct cifs_ses *ses) +static int set_fs_context_auth (struct smb3_fs_context *ctx, +struct cifs_ses *ses) { ctx->sectype = ses->sectype; -/* krb5 is special, since we don't need username or pw */ -if (ctx->sectype == Kerberos) +/* +* krb5 is special as we might need to pass username (passwordless) down +* to cifs.upcall(8) for keytab. +*/ +if (ctx->sectype == Kerberos) { +if (ses->user_name && ses->user_name[0 ]) { + ctx->username =kstrndup (ses->user_name, +CIFS_MAX_USERNAME_LEN , +GFP_KERNEL ); +if (!ctx->username) +return -ENOMEM ; + }return 0 ; + }return cifs_set_cifscreds (ctx, ses); }
@@ -4193,7 +4204,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) ctx->witness = master_tcon->use_witness; ctx->dfs_root_ses = master_tcon->ses->dfs_root_ses; - rc =cifs_set_vol_auth (ctx, master_tcon->ses); + rc =set_fs_context_auth (ctx, master_tcon->ses);if (rc) { tcon =ERR_PTR (rc); goto out;
fs/smb/client/smb2ops.c +6 -1
@@ -2070,7 +2070,7 @@ smb2_duplicate_extents(const unsigned int xid, src_off, dest_off, len); inode =d_inode (trgtfile->dentry); -if (inode->i_size < dest_off + len) { +if (i_size_read (inode) < dest_off + len) { rc =smb2_set_file_size (xid, tcon, trgtfile, dest_off + len, false);if (rc) goto duplicate_extents_out;
@@ -2095,6 +2095,11 @@ smb2_duplicate_extents(const unsigned int xid,if (ret_data_len >0 )cifs_dbg (FYI ,"Non-zero response length in duplicate extents\n" ); +if (rc) { +CIFS_I (inode)->time =0 ;/* force reval */ +cifs_invalidate_cache (inode,0 ); + } + duplicate_extents_out:return rc; }
fs/smb/server/smb2pdu.c +5 -0
@@ -5685,6 +5685,7 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,struct object_id_info *info; info = (struct object_id_info *)(rsp->Buffer); +memset (info,0 ,sizeof (*info));if (path.mnt->mnt_sb->s_uuid_len ==16 ) memcpy(info->objid, path.mnt->mnt_sb->s_uuid.b,
@@ -5739,6 +5740,7 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work, info->FreeSpaceStopFiltering =0 ; info->DefaultQuotaThreshold =cpu_to_le64 (SMB2_NO_FID ); info->DefaultQuotaLimit =cpu_to_le64 (SMB2_NO_FID ); + info->FileSystemControlFlags =0 ; info->Padding =0 ; rsp->OutputBufferLength =cpu_to_le32 (48 ); fixed_len =48 ;
@@ -5761,6 +5763,9 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work, info->UserBlocksAvail =cpu_to_le64 (stfs.f_bavail); info->TotalFileNodes =cpu_to_le64 (stfs.f_files); info->FreeFileNodes =cpu_to_le64 (stfs.f_ffree); + info->FileSysIdentifier = +cpu_to_le64 ((u64 )(u32 )stfs.f_fsid.val[1 ] <<32 | + (u32 )stfs.f_fsid.val[0 ]); rsp->OutputBufferLength =cpu_to_le32 (56 ); fixed_len =56 ; }
fs/tracefs/event_inode.c +13 -3
@@ -92,6 +92,14 @@ static void free_ei_rcu(struct rcu_head *rcu) } } +/* read under eventfs_srcu and, by tracefs_d_revalidate(), in rcu pathwalk */ +static void free_ei_srcu (struct rcu_head *rcu) +{ + struct eventfs_inode *ei = container_of(rcu, struct eventfs_inode, rcu); + +call_rcu (&ei->rcu, free_ei_rcu); +} +/* * eventfs_inode reference count management. *
@@ -113,7 +121,7 @@ static void release_ei(struct kref *ref) entry->release (entry->name, ei->data); } -call_srcu (&eventfs_srcu, &ei->rcu, free_ei_rcu); +call_srcu (&eventfs_srcu, &ei->rcu, free_ei_srcu); }static inline void put_ei (struct eventfs_inode *ei)
@@ -740,8 +748,10 @@ static int eventfs_iterate(struct file *file, struct dir_context *ctx)* Matches the smp_wmb() in free_ei() */ smp_rmb (); -if (ei->is_freed) -return -EINVAL ; +if (ei->is_freed) { + ret = -EINVAL ; + goto out; + }if (c >0 ) { c--;
fs/unicode/utf8-core.c +17 -4
@@ -3,6 +3,7 @@#include <linux/kernel.h> #include <linux/string.h> #include <linux/slab.h> +#include <linux/rcupdate.h> #include <linux/parser.h> #include <linux/errno.h> #include <linux/stringhash.h>
@@ -205,12 +206,24 @@ struct unicode_map *utf8_load(unsigned int version) }EXPORT_SYMBOL (utf8_load); +static void utf8_unload_rcu (struct rcu_head *head) +{ + struct unicode_map *um = container_of(head, struct unicode_map, rcu); + +symbol_put (utf8_data_table); +kfree (um); +} + +/* +* A pathwalk in rcu mode may still be in ->d_hash() or ->d_compare() of a +* filesystem that is being torn down and read the map through its +* superblock, so the map and the tables it points to have to outlive the +* grace period. +*/ void utf8_unload (struct unicode_map *um) { -if (um) { -symbol_put (utf8_data_table); -kfree (um); - } +if (um) +call_rcu (&um->rcu, utf8_unload_rcu); }EXPORT_SYMBOL (utf8_unload);
fs/xfs/libxfs/xfs_sb.c +7 -10
@@ -1150,26 +1150,23 @@ xfs_sync_sb_buf( struct xfs_mount *mp) {struct xfs_trans *tp; -struct xfs_buf *bp;int error; error =xfs_trans_alloc (mp, &M_RES (mp)->tr_sb,0 ,0 ,0 , &tp);if (error)return error; - bp =xfs_trans_getsb (tp);xfs_log_sb (tp); -xfs_trans_bhold (tp, bp);xfs_trans_set_sync (tp); error =xfs_trans_commit (tp);if (error) - goto out; -/* -* write out the sb buffer to get the changes to disk -*/ - error =xfs_bwrite (bp); -out: -xfs_buf_relse (bp); +return error; + +/* Re-acquire and write the sb to disk. */ +xfs_buf_lock (mp->m_sb_bp); + error =xfs_bwrite (mp->m_sb_bp); +xfs_buf_unlock (mp->m_sb_bp); +return error; }
fs/xfs/xfs_fsmap.c +1 -1
@@ -902,7 +902,7 @@ xfs_getfsmap(return -EINVAL ; use_rmap =xfs_has_rmapbt (mp) && -has_capability_noaudit (current,CAP_SYS_ADMIN ); +ns_capable_noaudit (&init_user_ns,CAP_SYS_ADMIN ); head->fmh_entries =0 ;/* Set up our device handlers. */
fs/xfs/xfs_ioctl.c +1 -1
@@ -1218,7 +1218,7 @@ xfs_ioctl_setattr_get_trans( goto out_error; error =xfs_trans_alloc_ichange (ip,NULL ,NULL , pdqp, -has_capability_noaudit (current,CAP_FOWNER ), &tp); +ns_capable_noaudit (&init_user_ns,CAP_FOWNER ), &tp);if (error) goto out_error;
fs/xfs/xfs_iops.c +1 -1
@@ -712,7 +712,7 @@ xfs_setattr_nonsize( } error =xfs_trans_alloc_ichange (ip, udqp, gdqp,NULL , -has_capability_noaudit (current,CAP_FOWNER ), &tp); +ns_capable_noaudit (&init_user_ns,CAP_FOWNER ), &tp);if (error) goto out_dqrele;
include/drm/drm_exec.h +5 -4
@@ -71,7 +71,8 @@ drm_exec_obj(struct drm_exec *exec, unsigned long index)* @index: unsigned long index for the iteration * @obj: the current GEM object * -* Iterate over all the locked GEM objects inside the drm_exec object. +* Iterate over all the explicitly locked GEM objects inside the drm_exec +* container, except for the contended and implicit prelocked one. */ #define drm_exec_for_each_locked_object (exec, index, obj) \ for ((index) = 0; ((obj) = drm_exec_obj(exec, index)); ++(index))
@@ -83,9 +84,9 @@ drm_exec_obj(struct drm_exec *exec, unsigned long index)* @index: unsigned long index for the iteration * @obj: the current GEM object * -* Iterate over all the locked GEM objects inside the drm_exec object in -* reverse locking order. Note that @index may go below zero and wrap, -* but that will be caught by drm_exec_obj(), returning a NULL object. +* Iterate over all the explicitly locked GEM objects inside the drm_exec +* container in reverse locking order. Note that @index may go below zero and wrap +* around, but that will be caught by drm_exec_obj(), returning a NULL object. */ #define drm_exec_for_each_locked_object_reverse (exec, index, obj) \ for ((index) = (exec)->num_objects - 1; \
include/linux/bsg-lib.h +2 -1
@@ -65,7 +65,8 @@ struct bsg_job {void bsg_job_done (struct bsg_job *job,int result,unsigned int reply_payload_rcv_len);struct request_queue *bsg_setup_queue (struct device *dev,const char *name, -bsg_job_fn *job_fn,bsg_timeout_fn *timeout,int dd_job_size); +bsg_job_fn *job_fn,bsg_timeout_fn *timeout,int dd_job_size, +unsigned int reply_len);void bsg_remove_queue (struct request_queue *q);void bsg_job_put (struct bsg_job *job);int __must_check bsg_job_get (struct bsg_job *job);
include/linux/cgroup-defs.h +4 -1
@@ -435,7 +435,10 @@ struct cgroup {int nr_threaded_children;/* # of live threaded child cgroups */ -/* sequence number for cgroup.kill, serialized by css_set_lock. */ +/* +* Sequence number for cgroup.kill. Incremented with both cgroup_mutex +* and css_set_lock held. Readers hold either one. +*/ unsigned int kill_seq;struct kernfs_node *kn;/* cgroup kernfs entry */
include/linux/device-mapper.h +5 -0
@@ -356,6 +356,11 @@ struct dm_target {*/ bool discards_supported:1; +/* +* Set if this target requires stable data during writeback. +*/ + bool needs_stable_writes:1; +/* * Set if this target requires that discards be split on * 'max_discard_sectors' boundaries.
include/linux/fsnotify_backend.h +1 -0
@@ -474,6 +474,7 @@ struct fsnotify_mark_connector {unsigned short type;/* Type of object [lock] */ #define FSNOTIFY_CONN_FLAG_HAS_FSID 0x01#define FSNOTIFY_CONN_FLAG_HAS_IREF 0x02 +#define FSNOTIFY_CONN_FLAG_DESTROYING 0x04unsigned short flags;/* flags [lock] */ __kernel_fsid_t fsid;/* fsid of filesystem containing object */ union {
include/linux/futex.h +9 -5
@@ -23,26 +23,30 @@ struct task_struct;* 01 : Shared futex (PTHREAD_PROCESS_SHARED) * mapped on a file (reference on the underlying inode) * 10 : Shared futex (PTHREAD_PROCESS_SHARED) -* (but private mapping on an mm, and reference taken on it) +* (but private mapping on an mm) */ -#define FUT_OFF_INODE 1/* We set bit 0 if key has a reference on inode */ -#define FUT_OFF_MMSHARED 2/* We set bit 1 if key has a reference on mm */ +#define FUT_OFF_INODE 1/* We set bit 0 if shared key identifies an inode */ +#define FUT_OFF_MMSHARED 2/* We set bit 1 if shared key identifies an mm */ union futex_key { +/* For FUT_OFF_INODE */ struct {u64 i_seq;unsigned long pgoff;unsigned int offset; } shared; + +/* For FUT_OFF_MMSHARED or private */ struct {union { -struct mm_struct *mm; -u64 __tmp; +struct mm_struct *mm;/* for private */ +u64 mm_seq;/* for FUT_OFF_MMSHARED */ };unsigned long address;unsigned int offset; } private; +struct {u64 ptr;unsigned long word;
include/linux/io_uring_types.h +5 -1
@@ -362,6 +362,9 @@ struct io_ring_ctx {bool iowq_limits_set;struct callback_head poll_wq_task_work; +/* deferred ->poll_wq wake up for local task_work */ +struct rcu_head poll_wq_rcu; +atomic_t poll_wq_rcu_pending;struct list_head defer_list;unsigned sq_thread_idle;/* protected by ->completion_lock */
@@ -576,7 +579,7 @@ struct io_kiocb {__poll_t apoll_events; };atomic_t refs; -atomic_t poll_refs; +bool cancel_seq_set;struct io_task_work io_task_work;unsigned nr_tw;/* for polled requests, i.e. IORING_OP_POLL_ADD and async armed poll */
@@ -586,6 +589,7 @@ struct io_kiocb {/* opcode allocated if it needs to store data for async defer */ void *async_data;/* linked requests, IFF REQ_F_HARDLINK or REQ_F_LINK are set */ +atomic_t poll_refs;struct io_kiocb *link;/* custom credentials, valid IFF REQ_F_CREDS is set */ const struct cred *creds;
include/linux/ipv6.h +22 -0
@@ -117,6 +117,28 @@ static inline unsigned int ipv6_transport_len(const struct sk_buff *skb)skb_network_header_len (skb); } +static inline unsigned int +ipv6_payload_len (const struct sk_buff *skb,const struct ipv6hdr *ip6) +{ +u32 len =ntohs (ip6->payload_len); + +return (len || !skb_is_gso (skb) || !skb_is_gso_tcp (skb)) ? + len : + skb->len -skb_network_offset (skb) -sizeof (struct ipv6hdr ); +} + +static inline unsigned int skb_ipv6_payload_len (const struct sk_buff *skb) +{ +return ipv6_payload_len (skb,ipv6_hdr (skb)); +} + +#define IPV6_MAXPLEN 65535 + +static inline void ipv6_set_payload_len (struct ipv6hdr *ip6,unsigned int len) +{ + ip6->payload_len = len <=IPV6_MAXPLEN ?htons (len) :0 ; +} +/* This structure contains results of exthdrs parsing as offsets from skb->nh.
include/linux/key-type.h +1 -0
@@ -158,6 +158,7 @@ struct key_type { const void *in, const void *in2);/* internal fields */ +atomic64_t index_id;/* Opaque keyring index ID */ struct list_head link;/* link in types list */ struct lock_class_key lock_class;/* key->sem lock class */ } __randomize_layout;
include/linux/key.h +5 -0
@@ -107,6 +107,7 @@ struct keyring_name;struct key_tag {struct rcu_head rcu; +atomic64_t index_id;/* Opaque keyring index ID */ refcount_t usage;bool removed;/* T when subject removed */ };
@@ -129,6 +130,8 @@ struct keyring_index_key {struct key_type *type;struct key_tag *domain_tag;/* Domain of operation */ const char *description; +u64 type_id;/* Cached index IDs */ +u64 domain_id; };union key_payload {
@@ -250,6 +253,8 @@ struct key {struct key_type *type;/* type of key */ struct key_tag *domain_tag;/* Domain of operation */ char *description; +u64 type_id; +u64 domain_id; }; };
include/linux/mm_types.h +3 -0
@@ -849,6 +849,9 @@ struct mm_struct {*/ int mm_lock_seq;#endif +#ifdef CONFIG_FUTEX +atomic64_t futex_unique_id; +#endif unsigned long hiwater_rss;/* High-watermark of RSS usage */
include/linux/power_supply.h +3 -3
@@ -365,9 +365,9 @@ struct power_supply_vbat_ri_table {* @charge_voltage_max_uv: maintenance charging voltage that is usually a bit * lower than the constant_charge_voltage_max_uv. We can apply this settings * charge_current_max_ua until we get back up to this voltage. -* @safety_timer_minutes: maintenance charging safety timer, with an expiry -* time in minutes. We will only use maintenance charging in this setting -* for a certain amount of time, then we will first move to the next +* @charge_safety_timer_minutes: maintenance charging safety timer, with an +* expiry time in minutes. We will only use maintenance charging in this +* setting for a certain amount of time, then we will first move to the next * maintenance charge current and voltage pair in respective array and wait * for the next safety timer timeout, or, if we reached the last maintencance * charging setting, disable charging until we reach
include/linux/sched.h +1 -1
@@ -1768,7 +1768,7 @@ extern struct pid __rcu *cad_pid;* I am cleaning dirty pages from some other bdi. */ #define PF_KTHREAD 0x00200000/* I am a kernel thread */ #define PF_RANDOMIZE 0x00400000/* Randomize virtual address space */ -#define PF__HOLE__00800000 0x00800000 +#define PF_NO_NOTIFY_SIGNAL 0x00800000/* see no_notify_signal_save() */ #define PF__HOLE__01000000 0x01000000#define PF__HOLE__02000000 0x02000000#define PF_NO_SETAFFINITY 0x04000000/* Userland is not allowed to meddle with cpus_mask */
include/linux/sched/signal.h +25 -2
@@ -2,6 +2,7 @@#ifndef _LINUX_SCHED_SIGNAL_H#define _LINUX_SCHED_SIGNAL_H +#include <linux/cleanup.h> #include <linux/rculist.h> #include <linux/signal.h> #include <linux/sched.h>
@@ -389,14 +390,36 @@ static inline int task_sigpending(struct task_struct *p)return unlikely (test_tsk_thread_flag (p,TIF_SIGPENDING )); } +/* Prevent TIF_NOTIFY_SIGNAL from interrupting this task. */ +static inline unsigned int no_notify_signal_save (void ) +{ +unsigned int flags = current->flags; + + current->flags |=PF_NO_NOTIFY_SIGNAL ; +return flags; +} + +/* Restore the previous PF_NO_NOTIFY_SIGNAL state. */ +static inline void no_notify_signal_restore (unsigned int flags) +{ +current_restore_flags (flags,PF_NO_NOTIFY_SIGNAL ); +} + +DEFINE_LOCK_GUARD_0 (no_notify_signal, + _T->flags =no_notify_signal_save (), +no_notify_signal_restore (_T->flags), + unsigned int flags) +static inline int signal_pending (struct task_struct *p) {/* * TIF_NOTIFY_SIGNAL isn't really a signal, but it requires the same * behavior in terms of ensuring that we break out of wait loops -* so that notify signal callbacks can be processed. +* so that notify signal callbacks can be processed. Not for a task +* that asked not to be interrupted by it, see no_notify_signal_save(). */ -if (unlikely (test_tsk_thread_flag (p,TIF_NOTIFY_SIGNAL ))) +if (unlikely (test_tsk_thread_flag (p,TIF_NOTIFY_SIGNAL )) && +likely (!(READ_ONCE (p->flags) &PF_NO_NOTIFY_SIGNAL )))return 1 ;return task_sigpending (p); }
include/linux/sched/user.h +5 -3
@@ -23,11 +23,13 @@ struct user_struct {struct hlist_node uidhash_node;kuid_t uid; -#if defined(CONFIG_PERF_EVENTS ) || defined(CONFIG_BPF_SYSCALL ) || \ - defined(CONFIG_NET ) || defined(CONFIG_IO_URING ) || \ +#if defined(CONFIG_NET ) || defined(CONFIG_IO_URING ) || \ defined(CONFIG_VFIO_PCI_ZDEV_KVM ) ||IS_ENABLED (CONFIG_IOMMUFD ) || \ defined(CONFIG_SECRETMEM ) -atomic_long_t locked_vm; +atomic_long_t locked_vm;/* pinned pages charged to RLIMIT_MEMLOCK */ +#endif +#ifdef CONFIG_PERF_EVENTS +atomic_long_t perf_mlock;/* perf buffer pages within perf_event_mlock_kb */ #endif #ifdef CONFIG_WATCH_QUEUE atomic_t nr_watches;/* The number of watches this user currently has */
include/linux/srcutiny.h +0 -4
@@ -11,7 +11,6 @@#ifndef _LINUX_SRCU_TINY_H#define _LINUX_SRCU_TINY_H -#include <linux/irq_work_types.h> #include <linux/swait.h> struct srcu_struct {
@@ -25,21 +24,18 @@ struct srcu_struct {struct rcu_head *srcu_cb_head;/* Pending callbacks: Head. */ struct rcu_head **srcu_cb_tail;/* Pending callbacks: Tail. */ struct work_struct srcu_work;/* For driving grace periods. */ -struct irq_work srcu_irq_work;/* Defer schedule_work() to irq work. */ #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map dep_map;#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ };void srcu_drive_gp (struct work_struct *wp); -void srcu_tiny_irq_work (struct irq_work *irq_work);#define __SRCU_STRUCT_INIT (name, __ignored, ___ignored) \ { \ .srcu_wq = __SWAIT_QUEUE_HEAD_INITIALIZER(name.srcu_wq), \ .srcu_cb_tail = &name.srcu_cb_head, \ .srcu_work = __WORK_INITIALIZER(name.srcu_work, srcu_drive_gp), \ - .srcu_irq_work = { .func = srcu_tiny_irq_work }, \ __SRCU_DEP_MAP_INIT(name) \ }
include/linux/unicode.h +1 -0
@@ -51,6 +51,7 @@ struct unicode_map {unsigned int version;const struct utf8data *ntab[UTF8_NMAX ];const struct utf8data_table *tables; +struct rcu_head rcu; };int utf8_validate (const struct unicode_map *um,const struct qstr *str);
include/net/af_vsock.h +3 -0
@@ -210,6 +210,9 @@ void vsock_remove_connected(struct vsock_sock *vsk);struct sock *vsock_find_bound_socket (struct sockaddr_vm *addr);struct sock *vsock_find_connected_socket (struct sockaddr_vm *src,struct sockaddr_vm *dst); +bool vsock_check_source (const struct vsock_sock *vsk, +const struct vsock_transport *transport, +const struct sockaddr_vm *src);void vsock_remove_sock (struct vsock_sock *vsk);void vsock_for_each_connected_socket (struct vsock_transport *transport,void (*fn)(struct sock *sk));
include/net/codel_impl.h +1 -0
@@ -158,6 +158,7 @@ static struct sk_buff *codel_dequeue(void *ctx,bool drop;if (!skb) { + vars->first_above_time =0 ; vars->dropping = false;return skb; }
include/net/ipv6.h +0 -2
@@ -25,8 +25,6 @@ struct ip_tunnel_info;#define SIN6_LEN_RFC2133 24 -#define IPV6_MAXPLEN 65535 -/* * NextHeader field of IPv6 header */
include/net/netfilter/nf_tables_ipv6.h +2 -2
@@ -42,7 +42,7 @@ static inline int __nft_set_pktinfo_ipv6_validate(struct nft_pktinfo *pkt)if (ip6h->version !=6 )return -1 ; - pkt_len =ntohs (ip6h->payload_len); + pkt_len =ipv6_payload_len (pkt->skb, ip6h); skb_len = pkt->skb->len -skb_network_offset (pkt->skb);if (pkt_len +sizeof (*ip6h) > skb_len)return -1 ;
@@ -86,7 +86,7 @@ static inline int nft_set_pktinfo_ipv6_ingress(struct nft_pktinfo *pkt)if (ip6h->version !=6 ) goto inhdr_error; - pkt_len =ntohs (ip6h->payload_len); + pkt_len =ipv6_payload_len (pkt->skb, ip6h);if (pkt_len +sizeof (*ip6h) > pkt->skb->len) { idev =__in6_dev_get (nft_in (pkt));__IP6_INC_STATS (nft_net (pkt), idev,IPSTATS_MIB_INTRUNCATEDPKTS );
io_uring/cancel.c +28 -8
@@ -56,9 +56,8 @@ bool io_cancel_req_match(struct io_kiocb *req, struct io_cancel_data *cd)return false;if (cd->flags &IORING_ASYNC_CANCEL_ALL ) { check_seq: -if (cd->seq == req->work.cancel_seq) +if (io_cancel_match_sequence (req, cd->seq))return false; - req->work.cancel_seq = cd->seq; }return true;
@@ -69,7 +68,16 @@ static bool io_cancel_cb(struct io_wq_work *work, void *data) struct io_kiocb *req = container_of(work, struct io_kiocb, work);struct io_cancel_data *cd = data; -return io_cancel_req_match (req, cd); +if (!io_cancel_req_match (req, cd)) +return false; +/* +* Pending work is gone once it has matched. Work that is running may +* park the request where the same cancellation looks next. Don't make +* it skip the request as one that it has dealt with. +*/ +if (cd->flags & (IORING_ASYNC_CANCEL_ALL |IORING_ASYNC_CANCEL_ANY )) + req->cancel_seq_set = false; +return true; } static int io_async_cancel_one(struct io_uring_task *tctx,
@@ -114,6 +122,8 @@ int io_try_cancel(struct io_uring_task *tctx, struct io_cancel_data *cd,*/ if (!ret)return 0 ; +if (ret == -EALREADY ) + cd->running = true; ret =io_poll_cancel (ctx, cd, issue_flags);if (ret != -ENOENT )
@@ -162,6 +172,7 @@ static int __io_async_cancel(struct io_cancel_data *cd,struct io_tctx_node *node;int ret, nr =0 ; + cd->running = false; do { ret = io_try_cancel(tctx, cd, issue_flags); if (ret == -ENOENT)
@@ -175,9 +186,10 @@ static int __io_async_cancel(struct io_cancel_data *cd,io_ring_submit_lock (ctx, issue_flags); ret = -ENOENT ;list_for_each_entry (node, &ctx->tctx_list, ctx_node) { -struct io_uring_task *tctx = node->task->io_uring; - - ret =io_async_cancel_one (tctx, cd); +/* has been done above, don't count what is running there */ +if (all && node->task->io_uring == tctx) +continue ; + ret =io_async_cancel_one (node->task->io_uring, cd);if (ret != -ENOENT ) {if (!all)break ;
@@ -185,7 +197,15 @@ static int __io_async_cancel(struct io_cancel_data *cd, } }io_ring_submit_unlock (ctx, issue_flags); -return all ? nr : ret; +if (all) +return nr; +/* +* The worker may be done with the work that was found running, and +* flagged, above. That isn't the same as not having found it. +*/ +if (ret == -ENOENT && cd->running) + ret = -EALREADY ; +return ret; }int io_async_cancel (struct io_kiocb *req,unsigned int issue_flags)
@@ -297,7 +317,7 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg)if (ret != -EALREADY ) goto out; -if (sc.timeout.tv_sec !=-1UL || sc.timeout.tv_nsec !=-1UL ) { +if (sc.timeout.tv_sec !=-1 || sc.timeout.tv_nsec !=-1 ) {struct timespec64 ts = { .tv_sec = sc.timeout.tv_sec, .tv_nsec = sc.timeout.tv_nsec
io_uring/cancel.h +12 -0
@@ -9,6 +9,8 @@ struct io_cancel_data {u8 opcode;u32 flags;int seq; +/* io_try_cancel() has found it being run by io-wq, and flagged it */ +bool running; };int io_async_cancel_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);
@@ -20,3 +22,13 @@ void init_hash_table(struct io_hash_table *table, unsigned size);int io_sync_cancel (struct io_ring_ctx *ctx,void __user *arg);bool io_cancel_req_match (struct io_kiocb *req,struct io_cancel_data *cd); + +static inline bool io_cancel_match_sequence (struct io_kiocb *req,int sequence) +{ +if (req->cancel_seq_set && sequence == req->work.cancel_seq) +return true; + + req->cancel_seq_set = true; + req->work.cancel_seq = sequence; +return false; +}
io_uring/io-wq.c +97 -15
218 lines not on this page · raw message
io_uring/io-wq.h +3 -1
@@ -21,7 +21,8 @@ enum io_wq_cancel { IO_WQ_CANCEL_NOTFOUND, /* work not found */ }; -typedef struct io_wq_work *(free_work_fn )(struct io_wq_work *); +typedef bool (put_work_fn )(struct io_wq_work *,struct io_wq_work **); +typedef void (free_work_fn )(struct io_wq_work *);typedef void (io_wq_work_fn )(struct io_wq_work *);struct io_wq_hash {
@@ -40,6 +41,7 @@ struct io_wq_data {struct io_wq_hash *hash;struct task_struct *task;io_wq_work_fn *do_work; +put_work_fn *put_work;free_work_fn *free_work; };
io_uring/io_uring.c +112 -32
259 lines not on this page · raw message
io_uring/io_uring.h +43 -1
62 lines not on this page · raw message
io_uring/poll.c +38 -10
99 lines not on this page · raw message
io_uring/rw.c +0 -18
@@ -140,24 +140,6 @@ void io_readv_writev_cleanup(struct io_kiocb *req)kfree (io->free_iovec); } -static inline ssize_t io_fixup_restart_res (ssize_t ret) -{ -switch (ret) { -case -ERESTARTSYS : -case -ERESTARTNOINTR : -case -ERESTARTNOHAND : -case -ERESTART_RESTARTBLOCK : -/* -* We can't just restart the syscall, since previously
Lines of this file are not shown. View the raw message.
io_uring/timeout.c +67 -21
88 lines not on this page · raw message
kernel/exit.c +31 -20
51 lines not on this page · raw message
kernel/futex/core.c +26 -23
49 lines not on this page · raw message
kernel/trace/trace_events_hist.c +27 -25
52 lines not on this page · raw message
net/bridge/netfilter/nf_conntrack_bridge.c +2 -2
Lines of this file are not shown. View the raw message.
net/iucv/af_iucv.c +25 -17
42 lines not on this page · raw message
net/vmw_vsock/af_vsock.c +40 -9
49 lines not on this page · raw message
net/vmw_vsock/virtio_transport_common.c +2 -1
Lines of this file are not shown. View the raw message.
security/keys/keyring.c +81 -71
152 lines not on this page · raw message
security/keys/trusted-keys/trusted_tpm1.c +3 -1
Lines of this file are not shown. View the raw message.
security/keys/trusted-keys/trusted_tpm2.c +1 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/ftrace/test.d/filter/event-filter-incomplete.tc new file +24 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.