Linux 6.1.185
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.1.185 kernel.
All users of the 6.1 kernel series must upgrade.
The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.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 drivers/block/null_blk/zoned.c | 10 drivers/gpio/gpio-ml-ioh.c | 36 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 50 ++++ drivers/hid/hid-core.c | 11 drivers/hid/hid-hyperv.c | 27 ++ drivers/hid/hid-magicmouse.c | 26 ++ drivers/hid/hid-nintendo.c | 7 drivers/hid/hid-sensor-custom.c | 17 - drivers/input/keyboard/atkbd.c | 23 +- drivers/input/mouse/byd.c | 2 drivers/misc/fastrpc.c | 64 +++-- drivers/net/can/dev/skb.c | 2 drivers/net/ntb_netdev.c | 15 - drivers/net/usb/rndis_host.c | 6 drivers/nfc/fdp/i2c.c | 27 ++ drivers/nfc/microread/microread.c | 31 ++ drivers/nfc/pn533/pn533.c | 1 drivers/nfc/st21nfca/dep.c | 3 drivers/nvme/target/fabrics-cmd-auth.c | 2 drivers/nvme/target/fc.c | 2 drivers/nvme/target/tcp.c | 5 drivers/pci/controller/pci-host-generic.c | 11 drivers/pci/ecam.c | 13 + drivers/s390/cio/vfio_ccw_chp.c | 26 +- drivers/s390/cio/vfio_ccw_cp.c | 30 ++ drivers/s390/cio/vfio_ccw_drv.c | 26 ++ drivers/s390/cio/vfio_ccw_fsm.c | 8 drivers/s390/cio/vfio_ccw_ops.c | 27 ++ drivers/s390/cio/vfio_ccw_private.h | 9 drivers/tty/serial/amba-pl011.c | 8 drivers/tty/serial/sc16is7xx.c | 222 ++++++++++---------- fs/ext4/xattr.c | 7 fs/iomap/buffered-io.c | 19 + fs/ocfs2/xattr.c | 18 + fs/xfs/libxfs/xfs_attr_leaf.c | 14 + fs/xfs/libxfs/xfs_log_recover.h | 4 fs/xfs/xfs_attr_item.c | 24 +- fs/xfs/xfs_bmap_item.c | 18 - fs/xfs/xfs_buf_item.c | 8 fs/xfs/xfs_buf_item.h | 2 fs/xfs/xfs_buf_item_recover.c | 91 +++++--- fs/xfs/xfs_dquot_item_recover.c | 20 - fs/xfs/xfs_extfree_item.c | 43 ++- fs/xfs/xfs_icreate_item.c | 2 fs/xfs/xfs_inode_item.c | 6 fs/xfs/xfs_inode_item.h | 4 fs/xfs/xfs_inode_item_recover.c | 26 +- fs/xfs/xfs_log_recover.c | 16 - fs/xfs/xfs_refcount_item.c | 16 - fs/xfs/xfs_rmap_item.c | 16 - fs/xfs/xfs_trans.h | 1 include/linux/can/core.h | 1 include/linux/can/skb.h | 2 include/linux/netdevice.h | 6 include/linux/pci-ecam.h | 3 include/linux/sched.h | 8 include/net/tls.h | 3 kernel/events/core.c | 121 +++++----- kernel/kcov.c | 90 ++++---- lib/Kconfig.debug | 5 net/bluetooth/hci_event.c | 2 net/bluetooth/rfcomm/core.c | 24 +- net/can/af_can.c | 14 - net/can/bcm.c | 2 net/can/isotp.c | 320 ++++++++++++++++++++--------- net/can/j1939/socket.c | 1 net/can/j1939/transport.c | 2 net/can/raw.c | 7 net/ceph/osd_client.c | 5 net/core/gro.c | 3 net/ipv4/inet_fragment.c | 6 net/ipv4/ip_output.c | 4 net/ipv6/ip6_output.c | 2 net/ipv6/ndisc.c | 8 net/mptcp/pm_netlink.c | 36 +-- net/nfc/digital_technology.c | 2 net/nfc/llcp_commands.c | 18 + net/nfc/llcp_core.c | 15 - net/nfc/nci/ntf.c | 10 net/nfc/nci/rsp.c | 1 net/packet/af_packet.c | 79 ++++--- net/packet/internal.h | 2 net/tls/tls.h | 4 net/tls/tls_strp.c | 17 - net/tls/tls_sw.c | 3 net/xfrm/xfrm_state.c | 4 sound/drivers/dummy.c | 6 sound/soc/codecs/lpass-tx-macro.c | 4 90 files changed, 1280 insertions(+), 668 deletions(-)
Abel Vesa (1):
misc: fastrpc: Rework fastrpc_req_munmap
Aditya Chillara (1):
perf/core: Fix group leader use-after-free after sibling detach
Ali Ahmet Memis (1):
Bluetooth: RFCOMM: take rfcomm_mutex for the deferred setup accept
Baul Lee (1):
HID: core: fix OOB read of field->usage in hid_set_field()
Bryam Vargas (2):
nfc: fdp: bound the device-reported read length and fix an skb leak
nvmet-auth: zero the AUTH_RECEIVE response buffer
Chengfeng Ye (1):
Bluetooth: hci_event: fix LE list UAF on reset
Christoph Hellwig (1):
xfs: don't use a xfs_log_iovec for ri_buf in log recovery
Cryolitia PukNgae (1):
Input: atkbd - skip deactivate for HONOR FMB-P's internal keyboard
Dawid Wróbel (1):
ASoC: codecs: lpass-tx-macro: Fix enum kcontrol accesses
Donglin Lyu (1):
Input: atkbd - skip deactivate for HONOR ZQC-P
Doruk Tan Ozturk (4):
nfc: digital: clamp SENSF_RES length to the destination buffer
nfc: llcp: bound the connect_sn TLV walk to the skb
nfc: llcp: reject PDUs shorter than the LLCP header
nfc: st21nfca: validate ATR_REQ length against the received frame
Ekansh Gupta (1):
misc: fastrpc: Remove buffer from list prior to unmap operation
Eric Dumazet (3):
net/packet: convert po->pressure to an atomic flag
ndisc: ndisc_send_redirect() cleanup
net: gro: properly validate BIG TCP aggregation criteria
Eric Farman (5):
s390/vfio_ccw: Cancel existing workqueues s390/vfio_ccw: Move cp cleanup out of not operational s390/vfio_ccw: Selectively expand io_mutex s390/vfio_ccw: Implement a crw lock s390/vfio_ccw: Free all memory if cp_init() fails
Fan Wu (1):
serial: amba-pl011: synchronize DMA teardown
Greg Kroah-Hartman (2):
nvmet-tcp: Do not WARN on remotely-controlled oversized SGL allocations Linux 6.1.185
Griffin Kroah-Hartman (1):
rndis_host: add overflow check in rndis_rx_fixup()
Guanghui Yang (1):
ext4: clear error before retrying inode xattr space fallback
Haoxiang Li (1):
HID: sensor: custom: Fix use-after-free in enable_sensor
Hongling Zeng (1):
xfs: validate attr entry pointer before field access
Hugo Villeneuve (2):
serial: sc16is7xx: rename EFR mutex with generic name
serial: sc16is7xx: use guards for simple mutex locks
Ian Bridges (1):
ocfs2: fix missing metadata reservation for large xattrs
Ibrahim Hashimov (2):
xfs: bounds-check buffer log item's dirty bitmap
HID: nintendo: fix out-of-bounds read in joycon_ctlr_read_handler()
Jakub Kicinski (1):
tls: handle data disappearing from under the TLS ULP
Jann Horn (1):
HID: core: fix number/pointer type confusion on long items
Jiang HongHui (1):
nvmet-fc: fix invalid free in LS IOD error path
Joanne Koong (1):
iomap: adjust read range correctly for non-block-aligned positions
Jose Villaseñor Montfort (1):
HID: magicmouse: do not keep a stale msc->input if no input is claimed
Junjie Cao (1):
gpio: ml-ioh: use raw_spinlock_t for the register lock
Junrui Luo (1):
drm/amdgpu: disallow multiple FENCE chunks in one submit
Koichiro Den (1):
NTB: ntb_netdev: Preserve RX queue depth on allocation failure
Lech Perczak (2):
serial: sc16is7xx: fix copy-paste errors in EFR_SWFLOWx_BIT constants
serial: sc16is7xx: convert bitmask definitions to use BIT() macro
Lee Jones (1):
HID: magicmouse: Prevent out-of-bounds (OOB) read during DOUBLE_REPORT_ID
Linmao Li (2):
nfc: nci: free destination parameters when closing a connection
Input: byd - synchronize timer deletion before freeing private data
Luca Fresi (1):
serial: sc16is7xx: enable THRI before filling TX FIFO
Luxiao Xu (1):
ipv6: fix use-after-free in ip6_finish_output2()
Matthias Goergens (1):
ext4: stop retrying saturated xattr cache entries
Matthieu Baerts (NGI0) (2):
mptcp: pm: ADD_ADDR rtx: always decrease sk refcount
mptcp: pm: ADD_ADDR rtx: free sk if last
Michael Bommarito (1):
HID: hyperv: validate initial device info bounds
Muhammad Bilal (1):
nfc: llcp: fix OOB read and u8 offset wrap in TLV parsers
Oliver Hartkopp (2):
can: use skb hash instead of private variable in headroom
can: isotp: fix timer drain order, wakeup handling and tx_gen ordering
Pavitra Jha (1):
libceph: fix OOB read in decode_watchers() via missing bounds check
Pengpeng Hou (1):
nfc: microread: validate target discovery payload lengths
Peter Zijlstra (1):
perf: Fix cgroup state vs ERROR
Qihang Tang (2):
packet: use consistent hard_header_len in non-ring send paths
packet: use consistent hard_header_len in TX_RING send path
Qing Luo (1):
mptcp: pm: fix data race in add_addr timer callback
Rik van Riel (1):
null_blk: fix UBSAN shift-out-of-bounds when zone_size is 0 or overflows
Sabrina Dubroca (1):
tls: fix lockless read of strp->msg_ready in ->poll
Samuel Page (2):
nfc: nci: fix out-of-bounds write in nci_target_auto_activated()
nfc: nci: fix uninit-value in the RF discover/activated NTF handlers
Steffen Persvold (1):
PCI: host-generic: Fix NULL pointer dereference on 32-bit CAM systems
Sukrut Bellary (1):
misc: fastrpc: Fix double free of 'buf' in error path
Takashi Iwai (1):
ALSA: dummy: Check card index validity at probe
Tetsuo Handa (1):
kcov: fix data corruption and race conditions on PREEMPT_RT
Xiang Mei (Microsoft) (1):
xfrm: fix sk_dst_cache double-free in xfrm_user_policy()
Xu Rao (1):
nfc: pn533: purge fragmented skbs during cleanup
Yang Wang (1):
drm/amdgpu: check ASPM on the dGPU host link
Yeoreum Yun (2):
perf/core: Fix child_total_time_enabled accounting bug at task exit
perf: Fix dangling cgroup pointer in cpuctx
Yong Wang (1):
ipv4: reject undersized MTUs in ip_do_fragment()
Zhiling Zou (1):
inet: frags: publish queues before arming timer
Zihan Xi (1):
packet: synchronize pressure clearing with ring reconfiguration
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 1 -SUBLEVEL = 184 +SUBLEVEL = 185 EXTRAVERSION = NAME = Curry Ramen
drivers/block/null_blk/zoned.c +8 -2
@@ -16,6 +16,8 @@ static inline sector_t mb_to_sects(unsigned long mb)static inline unsigned int null_zone_no (struct nullb_device *dev,sector_t sect) { +if (WARN_ON_ONCE (!dev->zone_size_sects)) +return 0 ;return sect >>ilog2 (dev->zone_size_sects); }
@@ -65,8 +67,8 @@ int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q)sector_t sector =0 ;unsigned int i; -if (!is_power_of_2 (dev->zone_size)) { -pr_err ("zone_size must be power-of-two\n" ); +if (!dev->zone_size || !is_power_of_2 (dev->zone_size)) { +pr_err ("zone_size must be non-zero power-of-two\n" );return -EINVAL ; }if (dev->zone_size > dev->size) {
@@ -97,6 +99,10 @@ int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q) zone_capacity_sects =mb_to_sects (dev->zone_capacity); dev_capacity_sects =mb_to_sects (dev->size); dev->zone_size_sects =mb_to_sects (dev->zone_size); +if (!dev->zone_size_sects) { +pr_err ("zone_size too large or too small, leads to zero sectors\n" ); +return -EINVAL ; + } dev->nr_zones =round_up (dev_capacity_sects, dev->zone_size_sects) >>ilog2 (dev->zone_size_sects);
drivers/gpio/gpio-ml-ioh.c +18 -18
@@ -84,7 +84,7 @@ struct ioh_gpio {u32 gpio_use_sel;int ch;int irq_base; -spinlock_t spinlock; +raw_spinlock_t spinlock; };static const int num_ports[] = {6 ,12 ,16 ,16 ,15 ,16 ,16 ,12 };
@@ -95,7 +95,7 @@ static void ioh_gpio_set(struct gpio_chip *gpio, unsigned nr, int val)struct ioh_gpio *chip =gpiochip_get_data (gpio);unsigned long flags; -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags); reg_val =ioread32 (&chip->reg->regs[chip->ch].po);if (val) reg_val |=BIT (nr);
@@ -103,7 +103,7 @@ static void ioh_gpio_set(struct gpio_chip *gpio, unsigned nr, int val) reg_val &= ~BIT (nr);iowrite32 (reg_val, &chip->reg->regs[chip->ch].po); -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags); }static int ioh_gpio_get (struct gpio_chip *gpio,unsigned nr)
@@ -121,7 +121,7 @@ static int ioh_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,u32 reg_val;unsigned long flags; -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags); pm =ioread32 (&chip->reg->regs[chip->ch].pm); pm &=BIT (num_ports[chip->ch]) -1 ; pm |=BIT (nr);
@@ -134,7 +134,7 @@ static int ioh_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, reg_val &= ~BIT (nr);iowrite32 (reg_val, &chip->reg->regs[chip->ch].po); -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags);return 0 ; }
@@ -145,12 +145,12 @@ static int ioh_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)u32 pm;unsigned long flags; -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags); pm =ioread32 (&chip->reg->regs[chip->ch].pm); pm &=BIT (num_ports[chip->ch]) -1 ; pm &= ~BIT (nr);iowrite32 (pm, &chip->reg->regs[chip->ch].pm); -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags);return 0 ; }
@@ -254,7 +254,7 @@ static int ioh_irq_type(struct irq_data *d, unsigned int type)dev_dbg (chip->dev,"%s:irq=%d type=%d ch=%d pos=%d type=%d\n" , __func__, irq, type, ch, im_pos, type); -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags);switch (type) {case IRQ_TYPE_EDGE_RISING :
@@ -294,7 +294,7 @@ static int ioh_irq_type(struct irq_data *d, unsigned int type) ien =ioread32 (&chip->reg->regs[chip->ch].ien);iowrite32 (ien |BIT (ch), &chip->reg->regs[chip->ch].ien); end: -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags);return 0 ; }
@@ -324,11 +324,11 @@ static void ioh_irq_disable(struct irq_data *d)unsigned long flags;u32 ien; -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags); ien =ioread32 (&chip->reg->regs[chip->ch].ien); ien &= ~BIT (d->irq - chip->irq_base);iowrite32 (ien, &chip->reg->regs[chip->ch].ien); -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags); }static void ioh_irq_enable (struct irq_data *d)
@@ -338,11 +338,11 @@ static void ioh_irq_enable(struct irq_data *d)unsigned long flags;u32 ien; -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags); ien =ioread32 (&chip->reg->regs[chip->ch].ien); ien |=BIT (d->irq - chip->irq_base);iowrite32 (ien, &chip->reg->regs[chip->ch].ien); -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags); }static irqreturn_t ioh_gpio_handler (int irq,void *dev_id)
@@ -438,7 +438,7 @@ static int ioh_gpio_probe(struct pci_dev *pdev, chip->base = base; chip->reg = chip->base; chip->ch = i; -spin_lock_init (&chip->spinlock); +raw_spin_lock_init (&chip->spinlock);ioh_gpio_setup (chip, num_ports[i]); ret =devm_gpiochip_add_data (dev, &chip->gpio, chip);if (ret) {
@@ -482,9 +482,9 @@ static int __maybe_unused ioh_gpio_suspend(struct device *dev)struct ioh_gpio *chip =dev_get_drvdata (dev);unsigned long flags; -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags);ioh_gpio_save_reg_conf (chip); -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags);return 0 ; }
@@ -494,11 +494,11 @@ static int __maybe_unused ioh_gpio_resume(struct device *dev)struct ioh_gpio *chip =dev_get_drvdata (dev);unsigned long flags; -spin_lock_irqsave (&chip->spinlock, flags); +raw_spin_lock_irqsave (&chip->spinlock, flags);iowrite32 (0x01 , &chip->reg->srst);iowrite32 (0x00 , &chip->reg->srst);ioh_gpio_restore_reg_conf (chip); -spin_unlock_irqrestore (&chip->spinlock, flags); +raw_spin_unlock_irqrestore (&chip->spinlock, flags);return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +4 -0
@@ -247,6 +247,10 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,if (size <sizeof (struct drm_amdgpu_cs_chunk_fence )) goto free_partial_kdata; +/* Only a single user fence is allowed to simplify handling. */ +if (p->uf_entry.tv.bo) + goto free_partial_kdata; + ret =amdgpu_cs_p1_user_fence (p, p->chunks[i].kdata, &uf_offset);if (ret)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +49 -1
68 lines not on this page · raw message
drivers/hid/hid-core.c +9 -2
@@ -349,6 +349,9 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsignstatic u32 item_udata (struct hid_item *item) { +if (item->format !=HID_ITEM_FORMAT_SHORT ) +return 0 ; +switch (item->size) {case 1 :return item->data.u8;case 2 :return item->data.u16;
@@ -359,6 +362,9 @@ static u32 item_udata(struct hid_item *item)static s32 item_sdata (struct hid_item *item) { +if (item->format !=HID_ITEM_FORMAT_SHORT ) +return 0 ; +switch (item->size) {case 1 :return item->data.s8;case 2 :return item->data.s16;
@@ -1910,13 +1916,14 @@ int hid_set_field(struct hid_field *field, unsigned offset, __s32 value) size = field->report_size; -hid_dump_input (field->report->device, field->usage + offset, value); -if (offset >= field->report_count) {hid_err (field->report->device,"offset (%d) exceeds report_count (%d)\n" , offset, field->report_count);return -1 ; } + +hid_dump_input (field->report->device, field->usage + offset, value); +if (field->logical_minimum <0 ) {if (value !=snto32 (s32ton (value, size), size)) {hid_err (field->report->device,"value %d is out of range\n" , value);
drivers/hid/hid-hyperv.c +24 -3
@@ -179,18 +179,32 @@ static void mousevsc_free_device(struct mousevsc_dev *device) }static void mousevsc_on_receive_device_info (struct mousevsc_dev *input_device, -struct synthhid_device_info *device_info) +struct synthhid_device_info *device_info, +u32 device_info_size) {int ret =0 ;struct hid_descriptor *desc;struct mousevsc_prt_msg ack; +size_t desc_offset; +size_t desc_size; input_device->dev_info_status = -ENOMEM ; +if (device_info_size <sizeof (*device_info)) { + input_device->dev_info_status = -EINVAL ; + goto cleanup; + } + input_device->hid_dev_info = device_info->hid_dev_info; desc = &device_info->hid_descriptor; + desc_offset = offsetof(struct synthhid_device_info , hid_descriptor); + desc_size = device_info_size - desc_offset;if (desc->bLength ==0 ) goto cleanup; +if (desc->bLength <sizeof (*desc) || desc->bLength > desc_size) { + input_device->dev_info_status = -EINVAL ; + goto cleanup; + }/* The pointer is not NULL when we resume from hibernation */ kfree (input_device->hid_desc);
@@ -205,6 +219,10 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device, input_device->dev_info_status = -EINVAL ; goto cleanup; } +if (input_device->report_desc_size > desc_size - desc->bLength) { + input_device->dev_info_status = -EINVAL ; + goto cleanup; + }/* The pointer is not NULL when we resume from hibernation */ kfree (input_device->report_desc);
@@ -285,14 +303,17 @@ static void mousevsc_on_receive(struct hv_device *device,break ;case SYNTH_HID_INITIAL_DEVICE_INFO : -WARN_ON (pipe_msg->size <sizeof (struct hv_input_dev_info )); +if (WARN_ON_ONCE (pipe_msg->size < +sizeof (struct synthhid_device_info ))) +break ;/* * Parse out the device info into device attr, * hid desc and report desc */ mousevsc_on_receive_device_info (input_dev, - (struct synthhid_device_info *)pipe_msg->data); + (struct synthhid_device_info *)pipe_msg->data, + pipe_msg->size);break ;case SYNTH_HID_INPUT_REPORT : input_report =
drivers/hid/hid-magicmouse.c +26 -0
@@ -384,6 +384,10 @@ static int magicmouse_raw_event(struct hid_device *hdev,struct input_dev *input = msc->input;int x =0 , y =0 , ii, clicks =0 , npoints; +/* Protect against zero sized recursive calls from DOUBLE_REPORT_ID */ +if (size <1 ) +return 0 ; +switch (data[0 ]) {case TRACKPAD_REPORT_ID :case TRACKPAD2_BT_REPORT_ID :
@@ -484,6 +488,18 @@ static int magicmouse_raw_event(struct hid_device *hdev,/* Sometimes the trackpad sends two touch reports in one * packet. */ + +/* Ensure that we have at least 2 elements (report type and size) */ +if (size <2 ) +return 0 ; + +if (size < data[1 ] +2 ) { +hid_warn (hdev, +"received report length (%d) was smaller than specified (%d)" , + size, data[1 ] +2 ); +return 0 ; + } +magicmouse_raw_event (hdev, report, data +2 , data[1 ]);magicmouse_raw_event (hdev, report, data +2 + data[1 ], size -2 - data[1 ]);
@@ -862,6 +878,16 @@ static int magicmouse_probe(struct hid_device *hdev,return ret; } +/* +* When hidinput_connect() fails it frees every input device it +* created, but that does not fail hid_hw_start(): the core simply +* does not claim an input. msc->input, cached in ->input_mapping +* while the report descriptor was parsed, would then be a dangling +* pointer that passes every NULL check. Trust the core's claim. +*/ +if (!(hdev->claimed &HID_CLAIMED_INPUT )) + msc->input =NULL ; +if (is_usb_magicmouse2 (id->vendor, id->product) ||is_usb_magictrackpad2 (id->vendor, id->product)) {timer_setup (&msc->battery_timer, magicmouse_battery_timer_tick,0 );
drivers/hid/hid-nintendo.c +6 -1
@@ -2140,7 +2140,12 @@ static int joycon_ctlr_read_handler(struct joycon_ctlr *ctlr, u8 *data, {if (data[0 ] ==JC_INPUT_SUBCMD_REPLY || data[0 ] ==JC_INPUT_IMU_DATA || data[0 ] ==JC_INPUT_MCU_DATA ) { -if (size >=12 )/* make sure it contains the input report */ +/* +* The whole struct is cast and parsed below, including the +* IMU/subcmd union, not just the 12-byte partial header this +* used to check for. +*/ +if (size >=sizeof (struct joycon_input_report ))joycon_parse_report (ctlr, (struct joycon_input_report *)data); }
drivers/hid/hid-sensor-custom.c +9 -8
@@ -910,26 +910,26 @@ static int hid_sensor_custom_probe(struct platform_device *pdev)return ret; } - ret =sysfs_create_group (&sensor_inst->pdev->dev.kobj, - &enable_sensor_attr_group); + ret =hid_sensor_custom_add_attributes (sensor_inst);if (ret) goto err_remove_callback; - ret =hid_sensor_custom_add_attributes (sensor_inst); + ret =sysfs_create_group (&sensor_inst->pdev->dev.kobj, + &enable_sensor_attr_group);if (ret) - goto err_remove_group; + goto err_remove_attributes; ret =hid_sensor_custom_dev_if_add (sensor_inst);if (ret) - goto err_remove_attributes; + goto err_remove_group;return 0 ; -err_remove_attributes: -hid_sensor_custom_remove_attributes (sensor_inst); err_remove_group:sysfs_remove_group (&sensor_inst->pdev->dev.kobj, &enable_sensor_attr_group); +err_remove_attributes: +hid_sensor_custom_remove_attributes (sensor_inst); err_remove_callback:sensor_hub_remove_callback (hsdev, hsdev->usage);
@@ -947,9 +947,10 @@ static int hid_sensor_custom_remove(struct platform_device *pdev) }hid_sensor_custom_dev_if_remove (sensor_inst); -hid_sensor_custom_remove_attributes (sensor_inst); +/* Remove enable_sensor first as it uses fields via power_state/report_state. */ sysfs_remove_group (&sensor_inst->pdev->dev.kobj, &enable_sensor_attr_group); +hid_sensor_custom_remove_attributes (sensor_inst);sensor_hub_remove_callback (hsdev, hsdev->usage);return 0 ;
drivers/input/keyboard/atkbd.c +19 -4
@@ -1925,17 +1925,32 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { .callback = atkbd_deactivate_fixup, }, { - /* Lenovo Yoga Air 14 (83QK) */ .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83QK"), + DMI_MATCH(DMI_SYS_VENDOR, "HONOR"), + DMI_MATCH(DMI_PRODUCT_NAME, "BCC-N"), }, .callback = atkbd_deactivate_fixup, }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "HONOR"), - DMI_MATCH(DMI_PRODUCT_NAME, "BCC-N"), + DMI_MATCH(DMI_PRODUCT_NAME, "FMB-P"), + }, + .callback = atkbd_deactivate_fixup, + }, + { + /* HONOR MagicBook Pro 14 2026 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HONOR"), + DMI_MATCH(DMI_PRODUCT_NAME, "ZQC-P"), + }, + .callback = atkbd_deactivate_fixup, + }, + { + /* Lenovo Yoga Air 14 (83QK) */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83QK"), }, .callback = atkbd_deactivate_fixup, },
drivers/input/mouse/byd.c +1 -1
@@ -426,7 +426,7 @@ static void byd_disconnect(struct psmouse *psmouse)struct byd_data *priv = psmouse->private;if (priv) { -del_timer (&priv->timer); +timer_shutdown_sync (&priv->timer);kfree (psmouse->private); psmouse->private =NULL ; }
drivers/misc/fastrpc.c +34 -30
118 lines not on this page · raw message
drivers/net/can/dev/skb.c +0 -2
@@ -202,7 +202,6 @@ static void init_can_skb_reserve(struct sk_buff *skb)skb_reset_transport_header (skb);can_skb_reserve (skb); -can_skb_prv (skb)->skbcnt =0 ; }struct sk_buff *alloc_can_skb (struct net_device *dev,struct can_frame **cf)
@@ -312,7 +311,6 @@ static bool can_skb_headroom_valid(struct net_device *dev, struct sk_buff *skb)if (skb->ip_summed ==CHECKSUM_NONE ) {/* init headroom */ can_skb_prv (skb)->ifindex = dev->ifindex; -can_skb_prv (skb)->skbcnt =0 ; skb->ip_summed =CHECKSUM_UNNECESSARY ;
drivers/net/ntb_netdev.c +8 -7
@@ -100,7 +100,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len) {struct net_device *ndev = qp_data; -struct sk_buff *skb; +struct sk_buff *skb, *new_skb;int rc; skb = data;
@@ -115,6 +115,12 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, goto enqueue_again; } + new_skb =netdev_alloc_skb (ndev, ndev->mtu +ETH_HLEN ); +if (!new_skb) { + ndev->stats.rx_dropped++; + goto enqueue_again; + } +skb_put (skb, len); skb->protocol =eth_type_trans (skb, ndev); skb->ip_summed =CHECKSUM_NONE ;
@@ -127,12 +133,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, ndev->stats.rx_bytes += len; } - skb =netdev_alloc_skb (ndev, ndev->mtu +ETH_HLEN ); -if (!skb) { - ndev->stats.rx_errors++; - ndev->stats.rx_frame_errors++; -return ; - } + skb = new_skb; enqueue_again: rc =ntb_transport_rx_enqueue (qp, skb, skb->data, ndev->mtu +ETH_HLEN );
drivers/net/usb/rndis_host.c +5 -1
@@ -14,6 +14,7 @@#include <linux/usb/cdc.h> #include <linux/usb/usbnet.h> #include <linux/usb/rndis_host.h> +#include <linux/overflow.h> /*
@@ -506,6 +507,7 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb)struct rndis_data_hdr *hdr = (void *)skb->data;struct sk_buff *skb2;u32 msg_type, msg_len, data_offset, data_len; +u32 overflow_check; msg_type =le32_to_cpu (hdr->msg_type); msg_len =le32_to_cpu (hdr->msg_len);
@@ -514,7 +516,9 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb)/* don't choke if we see oob, per-packet data, etc */ if (unlikely (msg_type !=RNDIS_MSG_PACKET || skb->len < msg_len - || (data_offset + data_len +8 ) > msg_len)) { + || (data_offset + data_len +8 ) > msg_len + ||check_add_overflow (data_offset, data_len, &overflow_check) + ||check_add_overflow (overflow_check,8 , &overflow_check))) { dev->net->stats.rx_frame_errors++; netdev_dbg(dev->net, "bad rndis message %d/%d/%d/%d, len %d\n", le32_to_cpu(hdr->msg_type),
drivers/nfc/fdp/i2c.c +27 -0
@@ -166,9 +166,36 @@ static int fdp_nci_i2c_read(struct fdp_i2c_phy *phy, struct sk_buff **skb)/* Packet that contains a length */ if (tmp[0 ] ==0 && tmp[1 ] ==0 ) { phy->next_read_size = (tmp[2 ] <<8 ) + tmp[3 ] +3 ; + +/* +* next_read_size is taken from the device and is used +* as the i2c_master_recv() count for the next packet +* and as the data skb size. A value above the receive +* buffer overflows tmp[]; one below the minimum frame +* size runs the header/LRC strip and the length-field +* read past a short receive. Either way the packet is +* corrupt: drop it and force resynchronization. +*/ +if (phy->next_read_size <FDP_NCI_I2C_MIN_PAYLOAD || + phy->next_read_size >FDP_NCI_I2C_MAX_PAYLOAD ) { +dev_dbg (&client->dev,"%s: corrupted packet\n" , + __func__); + phy->next_read_size =FDP_NCI_I2C_MIN_PAYLOAD ; + goto flush; + } }else { phy->next_read_size =FDP_NCI_I2C_MIN_PAYLOAD ; +/* +* Only one data packet is delivered per call; if the +* device sends another, do not overwrite and leak the +* skb allocated for the previous one. +*/ +if (*skb) { +kfree_skb (*skb); + *skb =NULL ; + } + *skb =alloc_skb (len,GFP_KERNEL );if (*skb ==NULL ) { r = -ENOMEM ;
drivers/nfc/microread/microread.c +29 -2
@@ -483,13 +483,19 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate,switch (gate) {case MICROREAD_GATE_ID_MREAD_ISO_A : +if (skb->len <=MICROREAD_EMCF_A_LEN ) { + r = -EINVAL ; + goto exit_free; + } + targets->supported_protocols =nfc_hci_sak_to_protocol (skb->data[MICROREAD_EMCF_A_SAK ]); targets->sens_res =be16_to_cpu (*(u16 *)&skb->data[MICROREAD_EMCF_A_ATQA ]); targets->sel_res = skb->data[MICROREAD_EMCF_A_SAK ]; targets->nfcid1_len = skb->data[MICROREAD_EMCF_A_LEN ]; -if (targets->nfcid1_len >sizeof (targets->nfcid1)) { +if (targets->nfcid1_len >sizeof (targets->nfcid1) || + targets->nfcid1_len > skb->len -MICROREAD_EMCF_A_UID ) { r = -EINVAL ; goto exit_free; }
@@ -497,13 +503,19 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate, targets->nfcid1_len);break ;case MICROREAD_GATE_ID_MREAD_ISO_A_3 : +if (skb->len <=MICROREAD_EMCF_A3_LEN ) { + r = -EINVAL ; + goto exit_free; + } + targets->supported_protocols =nfc_hci_sak_to_protocol (skb->data[MICROREAD_EMCF_A3_SAK ]); targets->sens_res =be16_to_cpu (*(u16 *)&skb->data[MICROREAD_EMCF_A3_ATQA ]); targets->sel_res = skb->data[MICROREAD_EMCF_A3_SAK ]; targets->nfcid1_len = skb->data[MICROREAD_EMCF_A3_LEN ]; -if (targets->nfcid1_len >sizeof (targets->nfcid1)) { +if (targets->nfcid1_len >sizeof (targets->nfcid1) || + targets->nfcid1_len > skb->len -MICROREAD_EMCF_A3_UID ) { r = -EINVAL ; goto exit_free; }
@@ -511,11 +523,21 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate, targets->nfcid1_len);break ;case MICROREAD_GATE_ID_MREAD_ISO_B : +if (skb->len <MICROREAD_EMCF_B_UID +4 ) { + r = -EINVAL ; + goto exit_free; + } + targets->supported_protocols =NFC_PROTO_ISO14443_B_MASK ;memcpy (targets->nfcid1, &skb->data[MICROREAD_EMCF_B_UID ],4 ); targets->nfcid1_len =4 ;break ;case MICROREAD_GATE_ID_MREAD_NFC_T1 : +if (skb->len <MICROREAD_EMCF_T1_UID +4 ) { + r = -EINVAL ; + goto exit_free; + } + targets->supported_protocols =NFC_PROTO_JEWEL_MASK ; targets->sens_res =le16_to_cpu (*(u16 *)&skb->data[MICROREAD_EMCF_T1_ATQA ]);
@@ -523,6 +545,11 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate, targets->nfcid1_len =4 ;break ;case MICROREAD_GATE_ID_MREAD_NFC_T3 : +if (skb->len <MICROREAD_EMCF_T3_UID +8 ) { + r = -EINVAL ; + goto exit_free; + } + targets->supported_protocols =NFC_PROTO_FELICA_MASK ;memcpy (targets->nfcid1, &skb->data[MICROREAD_EMCF_T3_UID ],8 ); targets->nfcid1_len =8 ;
drivers/nfc/pn533/pn533.c +1 -0
@@ -2803,6 +2803,7 @@ void pn53x_common_clean(struct pn533 *priv)destroy_workqueue (priv->wq);skb_queue_purge (&priv->resp_q); +skb_queue_purge (&priv->fragment_skb);list_for_each_entry_safe (cmd, n, &priv->cmd_queue, queue) {list_del (&cmd->queue);
drivers/nfc/st21nfca/dep.c +3 -0
@@ -207,6 +207,9 @@ static int st21nfca_tm_recv_atr_req(struct nfc_hci_dev *hdev,if (atr_req->length <sizeof (struct st21nfca_atr_req ))return -EPROTO ; +if (atr_req->length > skb->len) +return -EPROTO ; + r =st21nfca_tm_send_atr_res (hdev, atr_req);if (r)return r;
drivers/nvme/target/fabrics-cmd-auth.c +1 -1
@@ -469,7 +469,7 @@ void nvmet_execute_auth_receive(struct nvmet_req *req)return ; } - d =kmalloc (al,GFP_KERNEL ); + d =kzalloc (al,GFP_KERNEL );if (!d) { status =NVME_SC_INTERNAL ; goto done;
drivers/nvme/target/fc.c +1 -1
@@ -571,7 +571,7 @@ nvmet_fc_alloc_ls_iodlist(struct nvmet_fc_tgtport *tgtport)list_del (&iod->ls_rcv_list); } -kfree (iod); +kfree (tgtport->iod);return -EFAULT ; }
drivers/nvme/target/tcp.c +3 -2
@@ -401,14 +401,15 @@ static int nvmet_tcp_map_data(struct nvmet_tcp_cmd *cmd) } cmd->req.transfer_len += len; - cmd->req.sg =sgl_alloc (len,GFP_KERNEL , &cmd->req.sg_cnt); + cmd->req.sg =sgl_alloc (len,GFP_KERNEL | __GFP_NOWARN, + &cmd->req.sg_cnt);if (!cmd->req.sg)return NVME_SC_INTERNAL ; cmd->cur_sg = cmd->req.sg;if (nvmet_tcp_has_data_in (cmd)) { cmd->iov =kmalloc_array (cmd->req.sg_cnt, -sizeof (*cmd->iov),GFP_KERNEL ); +sizeof (*cmd->iov),GFP_KERNEL | __GFP_NOWARN);if (!cmd->iov) goto err; }
drivers/pci/controller/pci-host-generic.c +1 -10
@@ -14,15 +14,6 @@#include <linux/pci-ecam.h> #include <linux/platform_device.h> -static const struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = { - .bus_shift =16 , - .pci_ops = { - .map_bus = pci_ecam_map_bus, - .read = pci_generic_config_read, - .write = pci_generic_config_write, - } -}; -static bool pci_dw_valid_device (struct pci_bus *bus,unsigned int devfn) {struct pci_config_window *cfg = bus->sysdata;
@@ -58,7 +49,7 @@ static const struct pci_ecam_ops pci_dw_ecam_bus_ops = {static const struct of_device_id gen_pci_of_match[] = { { .compatible ="pci-host-cam-generic" , - .data = &gen_pci_cfg_cam_bus_ops }, + .data = &pci_generic_cam_ops }, { .compatible ="pci-host-ecam-generic" , .data = &pci_generic_ecam_ops },
drivers/pci/ecam.c +13 -0
@@ -208,6 +208,19 @@ const struct pci_ecam_ops pci_generic_ecam_ops = { };EXPORT_SYMBOL_GPL (pci_generic_ecam_ops); +/* CAM ops */ +const struct pci_ecam_ops pci_generic_cam_ops = { + .bus_shift =16 , + .pci_ops = { + .add_bus = pci_ecam_add_bus, + .remove_bus = pci_ecam_remove_bus, + .map_bus = pci_ecam_map_bus, + .read = pci_generic_config_read, + .write = pci_generic_config_write, + } +}; +EXPORT_SYMBOL_GPL (pci_generic_cam_ops); +#if defined(CONFIG_ACPI ) && defined(CONFIG_PCI_QUIRKS )/* ECAM ops for 32-bit access only (non-compliant) */ const struct pci_ecam_ops pci_32b_ops = {
drivers/s390/cio/vfio_ccw_chp.c +16 -10
@@ -92,17 +92,12 @@ static ssize_t vfio_ccw_crw_region_read(struct vfio_ccw_private *private,loff_t pos = *ppos &VFIO_CCW_OFFSET_MASK ;struct ccw_crw_region *region;struct vfio_ccw_crw *crw; +unsigned long flags;int ret;if (pos + count >sizeof (*region))return -EINVAL ; - crw =list_first_entry_or_null (&private->crw, - struct vfio_ccw_crw, next); - -if (crw) -list_del (&crw->next); -mutex_lock (&private->io_mutex);if (i >= private->num_regions) { ret = -EINVAL ;
@@ -112,6 +107,16 @@ static ssize_t vfio_ccw_crw_region_read(struct vfio_ccw_private *private, i =array_index_nospec (i, private->num_regions); region = private->region[i].data; +spin_lock_irqsave (&private->crw_lock, flags); + crw =list_first_entry_or_null (&private->crw, + struct vfio_ccw_crw, next); + +if (crw) +list_del (&crw->next); + +/* Drop CRW lock while copying to userspace */ +spin_unlock_irqrestore (&private->crw_lock, flags); +if (crw)memcpy (®ion->crw, &crw->crw,sizeof (region->crw));
@@ -121,15 +126,16 @@ static ssize_t vfio_ccw_crw_region_read(struct vfio_ccw_private *private, ret = count; region->crw =0 ; - -out: -mutex_unlock (&private->io_mutex); -kfree (crw);/* Notify the guest if more CRWs are on our queue */ +spin_lock_irqsave (&private->crw_lock, flags);if (!list_empty (&private->crw) && private->crw_trigger)eventfd_signal (private->crw_trigger,1 ); +spin_unlock_irqrestore (&private->crw_lock, flags); + +out: +mutex_unlock (&private->io_mutex);return ret; }
drivers/s390/cio/vfio_ccw_cp.c +25 -5
@@ -490,9 +490,6 @@ static int ccwchain_handle_ccw(u32 cda, struct channel_program *cp)/* Loop for tics on this new chain. */ ret =ccwchain_loop_tic (chain, cp); -if (ret) -ccwchain_free (chain); -return ret; }
@@ -521,6 +518,23 @@ static int ccwchain_loop_tic(struct ccwchain *chain, struct channel_program *cp)return 0 ; } +static int ccwchain_build_ccws (u32 cda,struct channel_program *cp) +{ +struct ccwchain *chain, *temp; +int ret; + + ret =ccwchain_handle_ccw (cda, cp); + +if (ret) { +/* Cleanup if an error occurred */ +list_for_each_entry_safe (chain, temp, &cp->ccwchain_list, next) { +ccwchain_free (chain); + } + } + +return ret; +} +static int ccwchain_fetch_tic (struct ccwchain *chain,int idx,struct channel_program *cp)
@@ -699,7 +713,7 @@ int cp_init(struct channel_program *cp, union orb *orb)memcpy (&cp->orb, orb,sizeof (*orb));/* Build a ccwchain for the first CCW segment */ - ret =ccwchain_handle_ccw (orb->cmd.cpa, cp); + ret =ccwchain_build_ccws (orb->cmd.cpa, cp);if (!ret) { cp->initialized = true;
@@ -904,17 +918,23 @@ void cp_update_scsw(struct channel_program *cp, union scsw *scsw)*/ bool cp_iova_pinned (struct channel_program *cp,u64 iova,u64 length) { +struct vfio_ccw_private *private = + container_of(cp, struct vfio_ccw_private, cp);struct ccwchain *chain;int i;if (!cp->initialized)return false; +mutex_lock (&private->io_mutex);list_for_each_entry (chain, &cp->ccwchain_list, next) {for (i =0 ; i < chain->ch_len; i++) -if (page_array_iova_pinned (chain->ch_pa + i, iova, length)) +if (page_array_iova_pinned (chain->ch_pa + i, iova, length)) { +mutex_unlock (&private->io_mutex);return true; + } } +mutex_unlock (&private->io_mutex);return false; }
drivers/s390/cio/vfio_ccw_drv.c +24 -2
@@ -82,6 +82,7 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work) is_final = !(scsw_actl (&irb->scsw) & (SCSW_ACTL_DEVACT |SCSW_ACTL_SCHACT )); +mutex_lock (&private->io_mutex);if (scsw_is_solicited (&irb->scsw)) {cp_update_scsw (&private->cp, &irb->scsw);if (is_final && private->state ==VFIO_CCW_STATE_CP_PENDING ) {
@@ -89,9 +90,7 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work) cp_is_finished = true; } } -mutex_lock (&private->io_mutex);memcpy (private->io_region->irb_area, irb,sizeof (*irb)); -mutex_unlock (&private->io_mutex);/* * Reset to IDLE only if processing of a channel program
@@ -101,6 +100,7 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work)*/ if (cp_is_finished) private->state =VFIO_CCW_STATE_IDLE ; +mutex_unlock (&private->io_mutex);if (private->io_trigger)eventfd_signal (private->io_trigger,1 );
@@ -109,11 +109,25 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work)static void vfio_ccw_crw_todo (struct work_struct *work) {struct vfio_ccw_private *private; +unsigned long flags; private = container_of(work, struct vfio_ccw_private, crw_work); +spin_lock_irqsave (&private->crw_lock, flags);if (!list_empty (&private->crw) && private->crw_trigger)eventfd_signal (private->crw_trigger,1 ); +spin_unlock_irqrestore (&private->crw_lock, flags); +} + +static void vfio_ccw_notoper_todo (struct work_struct *work) +{ +struct vfio_ccw_private *private; + + private = container_of(work, struct vfio_ccw_private, notoper_work); + +mutex_lock (&private->io_mutex); +cp_free (&private->cp); +mutex_unlock (&private->io_mutex); }/*
@@ -141,6 +155,8 @@ static struct vfio_ccw_private *vfio_ccw_alloc_private(struct subchannel *sch)INIT_LIST_HEAD (&private->crw);INIT_WORK (&private->io_work, vfio_ccw_sch_io_todo);INIT_WORK (&private->crw_work, vfio_ccw_crw_todo); +INIT_WORK (&private->notoper_work, vfio_ccw_notoper_todo); +spin_lock_init (&private->crw_lock); private->cp.guest_cp =kcalloc (CCWCHAIN_LEN_MAX ,sizeof (struct ccw1 ),GFP_KERNEL );
@@ -187,11 +203,14 @@ static struct vfio_ccw_private *vfio_ccw_alloc_private(struct subchannel *sch)static void vfio_ccw_free_private (struct vfio_ccw_private *private) {struct vfio_ccw_crw *crw, *temp; +unsigned long flags; +spin_lock_irqsave (&private->crw_lock, flags);list_for_each_entry_safe (crw, temp, &private->crw, next) {list_del (&crw->next);kfree (crw); } +spin_unlock_irqrestore (&private->crw_lock, flags);kmem_cache_free (vfio_ccw_crw_region, private->crw_region);kmem_cache_free (vfio_ccw_schib_region, private->schib_region);
@@ -302,6 +321,7 @@ static void vfio_ccw_queue_crw(struct vfio_ccw_private *private, unsigned int rsid) {struct vfio_ccw_crw *crw; +unsigned long flags;/* * If unable to allocate a CRW, just drop the event and
@@ -319,7 +339,9 @@ static void vfio_ccw_queue_crw(struct vfio_ccw_private *private, crw->crw.erc = erc; crw->crw.rsid = rsid; +spin_lock_irqsave (&private->crw_lock, flags);list_add_tail (&crw->next, &private->crw); +spin_unlock_irqrestore (&private->crw_lock, flags);queue_work (vfio_ccw_work_q, &private->crw_work); }
drivers/s390/cio/vfio_ccw_fsm.c +6 -2
@@ -176,8 +176,8 @@ static void fsm_notoper(struct vfio_ccw_private *private,css_sched_sch_todo (sch,SCH_TODO_UNREG ); private->state =VFIO_CCW_STATE_NOT_OPER ; -/* This is usually handled during CLOSE event */ -cp_free (&private->cp); +/* This routine could be called from IRQ context, so defer */ +queue_work (vfio_ccw_work_q, &private->notoper_work); }/*
@@ -413,7 +413,11 @@ static void fsm_close(struct vfio_ccw_private *private, private->state =VFIO_CCW_STATE_STANDBY ;spin_unlock_irq (sch->lock); + +mutex_lock (&private->io_mutex);cp_free (&private->cp); +mutex_unlock (&private->io_mutex); +return ; err_unlock:
drivers/s390/cio/vfio_ccw_ops.c +27 -0
@@ -86,6 +86,20 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)struct vfio_ccw_private *private = container_of(vdev, struct vfio_ccw_private, vdev); +/* +* Ensure these work items are fully drained, so none can +* fire after being released. +* +* notoper_work should have nothing to do here, because only +* open devices could have channel_program resources in use +* and those would be released during close. Nevertheless, +* call flush here as well to be certain anything that was +* allocated is freed. +*/ +cancel_work_sync (&private->io_work); +cancel_work_sync (&private->crw_work); +flush_work (&private->notoper_work); +/* * We cannot free vfio_ccw_private here because it includes * parent info which must be free'ed by css driver.
@@ -162,6 +176,19 @@ static void vfio_ccw_mdev_close_device(struct vfio_device *vdev) container_of(vdev, struct vfio_ccw_private, vdev);vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_CLOSE ); + +/* +* Ensure these work items are drained, in the event the +* device is re-opened instead of released. +* +* notoper_work needs to be given a chance to run if it +* is queued, so any memory associated with the channel +* program can be returned. +*/ +cancel_work_sync (&private->io_work); +cancel_work_sync (&private->crw_work); +flush_work (&private->notoper_work); +vfio_ccw_unregister_dev_regions (private); }
drivers/s390/cio/vfio_ccw_private.h +8 -1
@@ -74,7 +74,8 @@ struct vfio_ccw_crw {* @state: internal state of the device * @completion: synchronization helper of the I/O completion * @io_region: MMIO region to input/output I/O arguments/results -* @io_mutex: protect against concurrent update of I/O regions +* @io_mutex: protect against concurrent update of I/O resources +* and @cp lifecycle * @region: additional regions for other subchannel operations * @cmd_region: MMIO region for asynchronous I/O commands other than START * @schib_region: MMIO region for SCHIB information
@@ -83,11 +84,14 @@ struct vfio_ccw_crw {* @cp: channel program for the current I/O operation * @irb: irb info received from interrupt * @scsw: scsw info +* @crw_lock: serialization of CRW list information +* @crw: list of Channel Report Word elements * @io_trigger: eventfd ctx for signaling userspace I/O results * @crw_trigger: eventfd ctx for signaling userspace CRW information * @req_trigger: eventfd ctx for signaling userspace to return device * @io_work: work for deferral process of I/O handling * @crw_work: work for deferral process of CRW handling +* @notoper_work: work for deferred processing in not-operational state * @release_comp: synchronization helper for vfio device release * @parent: parent data structures for mdevs created */
@@ -107,6 +111,8 @@ struct vfio_ccw_private {struct channel_program cp;struct irb irb;union scsw scsw; + +spinlock_t crw_lock;struct list_head crw;struct eventfd_ctx *io_trigger;
@@ -114,6 +120,7 @@ struct vfio_ccw_private {struct eventfd_ctx *req_trigger;struct work_struct io_work;struct work_struct crw_work; +struct work_struct notoper_work;struct completion release_comp;
drivers/tty/serial/amba-pl011.c +4 -4
@@ -1193,7 +1193,7 @@ static void pl011_dma_shutdown(struct uart_amba_port *uap)if (uap->using_tx_dma) {/* In theory, this should already be done by pl011_dma_flush_buffer */ -dmaengine_terminate_all (uap->dmatx.chan); +dmaengine_terminate_sync (uap->dmatx.chan);if (uap->dmatx.queued) { dma_unmap_single(uap->dmatx.chan->device->dev, uap->dmatx.dma, uap->dmatx.len,
@@ -1206,12 +1206,12 @@ static void pl011_dma_shutdown(struct uart_amba_port *uap) }if (uap->using_rx_dma) { -dmaengine_terminate_all (uap->dmarx.chan); +if (uap->dmarx.poll_rate) +timer_delete_sync (&uap->dmarx.timer); +dmaengine_terminate_sync (uap->dmarx.chan);/* Clean up the RX DMA */ pl011_dmabuf_free (uap->dmarx.chan, &uap->dmarx.dbuf_a,DMA_FROM_DEVICE );pl011_dmabuf_free (uap->dmarx.chan, &uap->dmarx.dbuf_b,DMA_FROM_DEVICE ); -if (uap->dmarx.poll_rate) -del_timer_sync (&uap->dmarx.timer); uap->using_rx_dma = false; } }
drivers/tty/serial/sc16is7xx.c +112 -110
395 lines not on this page · raw message
fs/ext4/xattr.c +5 -2
@@ -2017,12 +2017,13 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,* stable so we can check the additional * reference fits. */ - ref =le32_to_cpu (BHDR (new_bh)->h_refcount) +1 ; -if (ref >EXT4_XATTR_REFCOUNT_MAX ) { + ref =le32_to_cpu (BHDR (new_bh)->h_refcount); +if (ref >=EXT4_XATTR_REFCOUNT_MAX ) {/* * Undo everything and check mbcache * again. */ +clear_bit (MBE_REUSABLE_B , &ce->e_flags);unlock_buffer (new_bh); dquot_free_block(inode, EXT4_C2B(EXT4_SB(sb),
@@ -2033,6 +2034,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, new_bh =NULL ; goto inserted; } + ref++;BHDR (new_bh)->h_refcount =cpu_to_le32 (ref);if (ref ==EXT4_XATTR_REFCOUNT_MAX )clear_bit (MBE_REUSABLE_B , &ce->e_flags);
@@ -2781,6 +2783,7 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize, s_min_extra_isize) { tried_min_extra_isize++; new_extra_isize = s_min_extra_isize; + error =0 ; goto retry; } goto cleanup;
fs/iomap/buffered-io.c +13 -6
@@ -107,17 +107,24 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,* to avoid reading in already uptodate ranges. */ if (iop) { -unsigned int i; +unsigned int i, blocks_skipped;/* move forward for each leading block marked uptodate */ -for (i = first; i <= last; i++) { +for (i = first; i <= last; i++)if (!test_bit (i, iop->uptodate))break ; - *pos += block_size; - poff += block_size; - plen -= block_size; - first++; + + blocks_skipped = i - first; +if (blocks_skipped) { +unsigned long block_offset = *pos & (block_size -1 ); +unsigned bytes_skipped = + (blocks_skipped << block_bits) - block_offset; + + *pos += bytes_skipped; + poff += bytes_skipped; + plen -= bytes_skipped; } + first = i;/* truncate len if we find any trailing uptodate block(s) */ for ( ; i <= last; i++) {
fs/ocfs2/xattr.c +12 -6
@@ -740,12 +740,10 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, prev_clusters;if (why !=RESTART_NONE && clusters_to_add) { -/* -* We can only fail in case the alloc file doesn't give -* up enough clusters. -*/ -BUG_ON (why ==RESTART_META ); - +if (why ==RESTART_META ) { + status = -ENOSPC ; +break ; + } credits =ocfs2_calc_extend_credits (inode->i_sb, &vb->vb_xv->xr_list); status =ocfs2_extend_trans (handle, credits);
@@ -3214,6 +3212,14 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode, }else credits +=OCFS2_SUBALLOC_ALLOC +1 ; +/* +* Reserve metadata for the new xattr's value extent tree. +* The not_found path above adds credits for this tree but +* omits meta_add, leaving meta_ac NULL for large values. +*/ +if (xi->xi_value_len >OCFS2_XATTR_INLINE_SIZE ) + meta_add +=ocfs2_extend_meta_needed (&def_xv.xv.xr_list); +/* * This cluster will be used either for new bucket or for * new xattr block.
fs/xfs/libxfs/xfs_attr_leaf.c +14 -0
@@ -267,6 +267,13 @@ xfs_attr3_leaf_verify_entry(*/ if (ent->flags &XFS_ATTR_LOCAL ) { lentry =xfs_attr3_leaf_name_local (leaf, idx); + +/* Validate lentry pointer is within bounds before field access */ +if ((char *)lentry >= buf_end) +return __this_address; +if ((char *)lentry + offsetof(struct xfs_attr_leaf_name_local , nameval) > buf_end) +return __this_address; + namesize =xfs_attr_leaf_entsize_local (lentry->namelen,be16_to_cpu (lentry->valuelen)); name_end = (char *)lentry + namesize;
@@ -274,6 +281,13 @@ xfs_attr3_leaf_verify_entry(return __this_address; }else { rentry =xfs_attr3_leaf_name_remote (leaf, idx); + +/* Validate rentry pointer is within bounds before field access */ +if ((char *)rentry >= buf_end) +return __this_address; +if ((char *)rentry + offsetof(struct xfs_attr_leaf_name_remote , name) > buf_end) +return __this_address; + namesize =xfs_attr_leaf_entsize_remote (rentry->namelen); name_end = (char *)rentry + namesize;if (rentry->namelen ==0 )
fs/xfs/libxfs/xfs_log_recover.h +2 -2
@@ -95,7 +95,7 @@ struct xlog_recover_item {struct list_head ri_list;int ri_cnt;/* count of regions found */ int ri_total;/* total regions */ -struct xfs_log_iovec *ri_buf;/* ptr to regions buffer */ +struct kvec *ri_buf;/* ptr to regions buffer */ const struct xlog_recover_item_ops *ri_ops; };
@@ -108,7 +108,7 @@ struct xlog_recover {struct list_head r_itemq;/* q for items */ }; -#define ITEM_TYPE (i) (*(unsigned short *)(i)->ri_buf[0].i_addr) +#define ITEM_TYPE (i) (*(unsigned short *)(i)->ri_buf[0].iov_base)#define XLOG_RECOVER_CRCPASS 0#define XLOG_RECOVER_PASS1 1
fs/xfs/xfs_attr_item.c +12 -12
@@ -721,13 +721,13 @@ xlog_recover_attri_commit_pass2(/* Validate xfs_attri_log_format before the large memory allocation */ len =sizeof (struct xfs_attri_log_format ); -if (item->ri_buf[i].i_len != len) { +if (item->ri_buf[i].iov_len != len) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; } - attri_formatp = item->ri_buf[i].i_addr; + attri_formatp = item->ri_buf[i].iov_base;if (!xfs_attri_validate (mp, attri_formatp)) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, attri_formatp, len);
@@ -762,14 +762,14 @@ xlog_recover_attri_commit_pass2( i++;/* Validate the attr name */ -if (item->ri_buf[i].i_len != +if (item->ri_buf[i].iov_len !=xlog_calc_iovec_len (attri_formatp->alfi_name_len)) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, attri_formatp, len);return -EFSCORRUPTED ; } - attr_name = item->ri_buf[i].i_addr; + attr_name = item->ri_buf[i].iov_base;if (!xfs_attr_namecheck (attr_name, attri_formatp->alfi_name_len)) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, attri_formatp, len);
@@ -779,14 +779,14 @@ xlog_recover_attri_commit_pass2(/* Validate the attr value, if present */ if (attri_formatp->alfi_value_len !=0 ) { -if (item->ri_buf[i].i_len !=xlog_calc_iovec_len (attri_formatp->alfi_value_len)) { +if (item->ri_buf[i].iov_len !=xlog_calc_iovec_len (attri_formatp->alfi_value_len)) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, - item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, + item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; } - attr_value = item->ri_buf[i].i_addr; + attr_value = item->ri_buf[i].iov_base; i++; }
@@ -908,10 +908,10 @@ xlog_recover_attrd_commit_pass2( {struct xfs_attrd_log_format *attrd_formatp; - attrd_formatp = item->ri_buf[0 ].i_addr; -if (item->ri_buf[0 ].i_len !=sizeof (struct xfs_attrd_log_format )) { + attrd_formatp = item->ri_buf[0 ].iov_base; +if (item->ri_buf[0 ].iov_len !=sizeof (struct xfs_attrd_log_format )) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , log->l_mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }
fs/xfs/xfs_bmap_item.c +9 -9
@@ -623,24 +623,24 @@ xlog_recover_bui_commit_pass2(struct xfs_bui_log_format *bui_formatp;size_t len; - bui_formatp = item->ri_buf[0 ].i_addr; + bui_formatp = item->ri_buf[0 ].iov_base; -if (item->ri_buf[0 ].i_len <xfs_bui_log_format_sizeof (0 )) { +if (item->ri_buf[0 ].iov_len <xfs_bui_log_format_sizeof (0 )) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }if (bui_formatp->bui_nextents !=XFS_BUI_MAX_FAST_EXTENTS ) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; } len =xfs_bui_log_format_sizeof (bui_formatp->bui_nextents); -if (item->ri_buf[0 ].i_len != len) { +if (item->ri_buf[0 ].iov_len != len) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }
@@ -677,10 +677,10 @@ xlog_recover_bud_commit_pass2( {struct xfs_bud_log_format *bud_formatp; - bud_formatp = item->ri_buf[0 ].i_addr; -if (item->ri_buf[0 ].i_len !=sizeof (struct xfs_bud_log_format )) { + bud_formatp = item->ri_buf[0 ].iov_base; +if (item->ri_buf[0 ].iov_len !=sizeof (struct xfs_bud_log_format )) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , log->l_mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }
fs/xfs/xfs_buf_item.c +4 -4
@@ -35,16 +35,16 @@ static inline struct xfs_buf_log_item *BUF_ITEM(struct xfs_log_item *lip)/* Is this log iovec plausibly large enough to contain the buffer log format? */ bool xfs_buf_log_check_iovec ( -struct xfs_log_iovec *iovec) +struct kvec *iovec) { -struct xfs_buf_log_format *blfp = iovec->i_addr; +struct xfs_buf_log_format *blfp = iovec->iov_base;char *bmp_end;char *item_end; -if (offsetof(struct xfs_buf_log_format , blf_data_map) > iovec->i_len) +if (offsetof(struct xfs_buf_log_format , blf_data_map) > iovec->iov_len)return false; - item_end = (char *)iovec->i_addr + iovec->i_len; + item_end = (char *)iovec->iov_base + iovec->iov_len; bmp_end = (char *)&blfp->blf_data_map[blfp->blf_map_size];return bmp_end <= item_end; }
fs/xfs/xfs_buf_item.h +1 -1
@@ -67,7 +67,7 @@ static inline void xfs_buf_dquot_io_fail(struct xfs_buf *bp) }#endif /* CONFIG_XFS_QUOTA */ void xfs_buf_iodone (struct xfs_buf *); -bool xfs_buf_log_check_iovec (struct xfs_log_iovec *iovec); +bool xfs_buf_log_check_iovec (struct kvec *iovec);extern struct kmem_cache *xfs_buf_item_cache;
fs/xfs/xfs_buf_item_recover.c +57 -34
206 lines not on this page · raw message
fs/xfs/xfs_dquot_item_recover.c +10 -10
@@ -34,10 +34,10 @@ xlog_recover_dquot_ra_pass2(if (mp->m_qflags ==0 )return ; - recddq = item->ri_buf[1 ].i_addr; + recddq = item->ri_buf[1 ].iov_base;if (recddq ==NULL )return ; -if (item->ri_buf[1 ].i_len <sizeof (struct xfs_disk_dquot )) +if (item->ri_buf[1 ].iov_len <sizeof (struct xfs_disk_dquot ))return ; type = recddq->d_type &XFS_DQTYPE_REC_MASK ;
@@ -45,7 +45,7 @@ xlog_recover_dquot_ra_pass2(if (log->l_quotaoffs_flag & type)return ; - dq_f = item->ri_buf[0 ].i_addr; + dq_f = item->ri_buf[0 ].iov_base;ASSERT (dq_f);ASSERT (dq_f->qlf_len ==1 );
@@ -79,14 +79,14 @@ xlog_recover_dquot_commit_pass2(if (mp->m_qflags ==0 )return 0 ; - recddq = item->ri_buf[1 ].i_addr; + recddq = item->ri_buf[1 ].iov_base;if (recddq ==NULL ) {xfs_alert (log->l_mp,"NULL dquot in %s." , __func__);return -EFSCORRUPTED ; } -if (item->ri_buf[1 ].i_len <sizeof (struct xfs_disk_dquot )) { -xfs_alert (log->l_mp,"dquot too small (%d) in %s." , - item->ri_buf[1 ].i_len, __func__); +if (item->ri_buf[1 ].iov_len <sizeof (struct xfs_disk_dquot )) { +xfs_alert (log->l_mp,"dquot too small (%zd) in %s." , + item->ri_buf[1 ].iov_len, __func__);return -EFSCORRUPTED ; }
@@ -108,7 +108,7 @@ xlog_recover_dquot_commit_pass2(* The other possibility, of course, is that the quota subsystem was * removed since the last mount - ENOSYS. */ - dq_f = item->ri_buf[0 ].i_addr; + dq_f = item->ri_buf[0 ].iov_base;ASSERT (dq_f); fa =xfs_dquot_verify (mp, recddq, dq_f->qlf_id);if (fa) {
@@ -147,7 +147,7 @@ xlog_recover_dquot_commit_pass2( } } -memcpy (ddq, recddq, item->ri_buf[1 ].i_len); +memcpy (ddq, recddq, item->ri_buf[1 ].iov_len);if (xfs_has_crc (mp)) {xfs_update_cksum ((char *)dqb,sizeof (struct xfs_dqblk ),XFS_DQUOT_CRC_OFF );
@@ -192,7 +192,7 @@ xlog_recover_quotaoff_commit_pass1(struct xlog *log, struct xlog_recover_item *item) { - struct xfs_qoff_logformat *qoff_f = item->ri_buf[0].i_addr; + struct xfs_qoff_logformat *qoff_f = item->ri_buf[0].iov_base;ASSERT (qoff_f);/*
fs/xfs/xfs_extfree_item.c +23 -20
91 lines not on this page · raw message
fs/xfs/xfs_icreate_item.c +1 -1
@@ -158,7 +158,7 @@ xlog_recover_icreate_commit_pass2(int nbufs;int i; - icl = (struct xfs_icreate_log *)item->ri_buf[0 ].i_addr; + icl = (struct xfs_icreate_log *)item->ri_buf[0 ].iov_base;if (icl->icl_type !=XFS_LI_ICREATE ) {xfs_warn (log->l_mp,"xlog_recover_do_icreate_trans: bad type" );return -EINVAL ;
fs/xfs/xfs_inode_item.c +3 -3
@@ -1177,12 +1177,12 @@ xfs_iflush_shutdown_abort(*/ int xfs_inode_item_format_convert ( -struct xfs_log_iovec *buf, +struct kvec *buf,struct xfs_inode_log_format *in_f) { -struct xfs_inode_log_format_32 *in_f32 = buf->i_addr; +struct xfs_inode_log_format_32 *in_f32 = buf->iov_base; -if (buf->i_len !=sizeof (*in_f32)) { +if (buf->iov_len !=sizeof (*in_f32)) {XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW ,NULL );return -EFSCORRUPTED ; }
fs/xfs/xfs_inode_item.h +2 -2
@@ -46,8 +46,8 @@ extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);extern void xfs_inode_item_destroy (struct xfs_inode *);extern void xfs_iflush_abort (struct xfs_inode *);extern void xfs_iflush_shutdown_abort (struct xfs_inode *); -extern int xfs_inode_item_format_convert (xfs_log_iovec_t *, -struct xfs_inode_log_format *); +int xfs_inode_item_format_convert (struct kvec *buf, +struct xfs_inode_log_format *in_f);extern struct kmem_cache *xfs_ili_cache;
fs/xfs/xfs_inode_item_recover.c +13 -13
@@ -28,13 +28,13 @@ xlog_recover_inode_ra_pass2( struct xlog *log, struct xlog_recover_item *item) { -if (item->ri_buf[0 ].i_len ==sizeof (struct xfs_inode_log_format )) { -struct xfs_inode_log_format *ilfp = item->ri_buf[0 ].i_addr; +if (item->ri_buf[0 ].iov_len ==sizeof (struct xfs_inode_log_format )) { +struct xfs_inode_log_format *ilfp = item->ri_buf[0 ].iov_base;xlog_buf_readahead (log, ilfp->ilf_blkno, ilfp->ilf_len, &xfs_inode_buf_ra_ops); }else { -struct xfs_inode_log_format_32 *ilfp = item->ri_buf[0 ].i_addr; +struct xfs_inode_log_format_32 *ilfp = item->ri_buf[0 ].iov_base;xlog_buf_readahead (log, ilfp->ilf_blkno, ilfp->ilf_len, &xfs_inode_buf_ra_ops);
@@ -288,8 +288,8 @@ xlog_recover_inode_commit_pass2(int need_free =0 ;xfs_failaddr_t fa; -if (item->ri_buf[0 ].i_len ==sizeof (struct xfs_inode_log_format )) { - in_f = item->ri_buf[0 ].i_addr; +if (item->ri_buf[0 ].iov_len ==sizeof (struct xfs_inode_log_format )) { + in_f = item->ri_buf[0 ].iov_base; }else { in_f =kmem_alloc (sizeof (struct xfs_inode_log_format ),0 ); need_free =1 ;
@@ -327,7 +327,7 @@ xlog_recover_inode_commit_pass2( error = -EFSCORRUPTED ; goto out_release; } - ldip = item->ri_buf[1 ].i_addr; + ldip = item->ri_buf[1 ].iov_base;if (XFS_IS_CORRUPT (mp, ldip->di_magic !=XFS_DINODE_MAGIC )) { xfs_alert(mp, "%s: Bad inode log record, rec ptr "PTR_FMT", ino %lld",
@@ -432,12 +432,12 @@ xlog_recover_inode_commit_pass2( goto out_release; } isize =xfs_log_dinode_size (mp); -if (unlikely (item->ri_buf[1 ].i_len > isize)) { +if (unlikely (item->ri_buf[1 ].iov_len > isize)) {XFS_CORRUPTION_ERROR ("Bad log dinode size" ,XFS_ERRLEVEL_LOW , mp, ldip,sizeof (*ldip));xfs_alert (mp, -"Bad inode 0x%llx log dinode size 0x%x" , - in_f->ilf_ino, item->ri_buf[1 ].i_len); +"Bad inode 0x%llx log dinode size 0x%zx" , + in_f->ilf_ino, item->ri_buf[1 ].iov_len); error = -EFSCORRUPTED ; goto out_release; }
@@ -460,8 +460,8 @@ xlog_recover_inode_commit_pass2(if (in_f->ilf_size ==2 ) goto out_owner_change; - len = item->ri_buf[2 ].i_len; - src = item->ri_buf[2 ].i_addr; + len = item->ri_buf[2 ].iov_len; + src = item->ri_buf[2 ].iov_base;ASSERT (in_f->ilf_size <=4 );ASSERT ((in_f->ilf_size ==3 ) || (fields &XFS_ILOG_AFORK )); ASSERT(!(fields & XFS_ILOG_DFORK) ||
@@ -498,8 +498,8 @@ xlog_recover_inode_commit_pass2( }else { attr_index =2 ; } - len = item->ri_buf[attr_index].i_len; - src = item->ri_buf[attr_index].i_addr; + len = item->ri_buf[attr_index].iov_len; + src = item->ri_buf[attr_index].iov_base;ASSERT (len ==xlog_calc_iovec_len (in_f->ilf_asize));switch (in_f->ilf_fields &XFS_ILOG_AFORK ) {
fs/xfs/xfs_log_recover.c +8 -8
@@ -2088,15 +2088,15 @@ xlog_recover_add_to_cont_trans( item = list_entry(trans->r_itemq.prev, struct xlog_recover_item, ri_list); - old_ptr = item->ri_buf[item->ri_cnt-1 ].i_addr; - old_len = item->ri_buf[item->ri_cnt-1 ].i_len; + old_ptr = item->ri_buf[item->ri_cnt-1 ].iov_base; + old_len = item->ri_buf[item->ri_cnt-1 ].iov_len; ptr =kvrealloc (old_ptr, old_len, len + old_len,GFP_KERNEL );if (!ptr)return -ENOMEM ;memcpy (&ptr[old_len], dp, len); - item->ri_buf[item->ri_cnt-1 ].i_len += len; - item->ri_buf[item->ri_cnt-1 ].i_addr = ptr; + item->ri_buf[item->ri_cnt-1 ].iov_len += len; + item->ri_buf[item->ri_cnt-1 ].iov_base = ptr;trace_xfs_log_recover_item_add_cont (log, trans, item,0 );return 0 ; }
@@ -2181,7 +2181,7 @@ xlog_recover_add_to_trans( item->ri_total = in_f->ilf_size; item->ri_buf = -kmem_zalloc (item->ri_total *sizeof (xfs_log_iovec_t), +kmem_zalloc (item->ri_total *sizeof (*item->ri_buf),0 ); }
@@ -2195,8 +2195,8 @@ xlog_recover_add_to_trans( }/* Description region is ri_buf[0] */ - item->ri_buf[item->ri_cnt].i_addr = ptr; - item->ri_buf[item->ri_cnt].i_len = len; + item->ri_buf[item->ri_cnt].iov_base = ptr; + item->ri_buf[item->ri_cnt].iov_len = len; item->ri_cnt++;trace_xfs_log_recover_item_add (log, trans, item,0 );return 0 ;
@@ -2220,7 +2220,7 @@ xlog_recover_free_trans(/* Free the regions in the item. */ list_del (&item->ri_list);for (i =0 ; i < item->ri_cnt; i++) -kmem_free (item->ri_buf[i].i_addr); +kmem_free (item->ri_buf[i].iov_base);/* Free the item itself */ kmem_free (item->ri_buf);kmem_free (item);
fs/xfs/xfs_refcount_item.c +8 -8
@@ -650,18 +650,18 @@ xlog_recover_cui_commit_pass2(struct xfs_cui_log_format *cui_formatp;size_t len; - cui_formatp = item->ri_buf[0 ].i_addr; + cui_formatp = item->ri_buf[0 ].iov_base; -if (item->ri_buf[0 ].i_len <xfs_cui_log_format_sizeof (0 )) { +if (item->ri_buf[0 ].iov_len <xfs_cui_log_format_sizeof (0 )) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; } len =xfs_cui_log_format_sizeof (cui_formatp->cui_nextents); -if (item->ri_buf[0 ].i_len != len) { +if (item->ri_buf[0 ].iov_len != len) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }
@@ -698,10 +698,10 @@ xlog_recover_cud_commit_pass2( {struct xfs_cud_log_format *cud_formatp; - cud_formatp = item->ri_buf[0 ].i_addr; -if (item->ri_buf[0 ].i_len !=sizeof (struct xfs_cud_log_format )) { + cud_formatp = item->ri_buf[0 ].iov_base; +if (item->ri_buf[0 ].iov_len !=sizeof (struct xfs_cud_log_format )) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , log->l_mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }
fs/xfs/xfs_rmap_item.c +8 -8
@@ -664,18 +664,18 @@ xlog_recover_rui_commit_pass2(struct xfs_rui_log_format *rui_formatp;size_t len; - rui_formatp = item->ri_buf[0 ].i_addr; + rui_formatp = item->ri_buf[0 ].iov_base; -if (item->ri_buf[0 ].i_len <xfs_rui_log_format_sizeof (0 )) { +if (item->ri_buf[0 ].iov_len <xfs_rui_log_format_sizeof (0 )) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; } len =xfs_rui_log_format_sizeof (rui_formatp->rui_nextents); -if (item->ri_buf[0 ].i_len != len) { +if (item->ri_buf[0 ].iov_len != len) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - item->ri_buf[0 ].i_addr, item->ri_buf[0 ].i_len); + item->ri_buf[0 ].iov_base, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }
@@ -712,10 +712,10 @@ xlog_recover_rud_commit_pass2( {struct xfs_rud_log_format *rud_formatp; - rud_formatp = item->ri_buf[0 ].i_addr; -if (item->ri_buf[0 ].i_len !=sizeof (struct xfs_rud_log_format )) { + rud_formatp = item->ri_buf[0 ].iov_base; +if (item->ri_buf[0 ].iov_len !=sizeof (struct xfs_rud_log_format )) {XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , log->l_mp, - rud_formatp, item->ri_buf[0 ].i_len); + rud_formatp, item->ri_buf[0 ].iov_len);return -EFSCORRUPTED ; }
fs/xfs/xfs_trans.h +0 -1
@@ -15,7 +15,6 @@ struct xfs_efd_log_item;struct xfs_efi_log_item ;struct xfs_inode ;struct xfs_item_ops ; -struct xfs_log_iovec ;struct xfs_mount ;struct xfs_trans ;struct xfs_trans_res ;
include/linux/can/core.h +1 -0
@@ -58,6 +58,7 @@ extern void can_rx_unregister(struct net *net, struct net_device *dev, void *data);extern int can_send (struct sk_buff *skb,int loop); +void can_set_skb_uid (struct sk_buff *skb);void can_sock_destruct (struct sock *sk);#endif /* !_CAN_CORE_H */
include/linux/can/skb.h +0 -2
@@ -49,13 +49,11 @@ bool can_dropped_invalid_skb(struct net_device *dev, struct sk_buff *skb);/** * struct can_skb_priv - private additional data inside CAN sk_buffs * @ifindex: ifindex of the first interface the CAN frame appeared on -* @skbcnt: atomic counter to have an unique id together with skb pointer * @frame_len: length of CAN frame in data link layer * @cf: align to the following CAN frame at skb->data */ struct can_skb_priv {int ifindex; -int skbcnt;unsigned int frame_len;struct can_frame cf[]; };
include/linux/netdevice.h +4 -2
@@ -293,9 +293,11 @@ struct hh_cache {* We could use other alignment values, but we must maintain the * relationship HH alignment <= LL alignment. */ -#define LL_RESERVED_SPACE (dev) \ - ((((dev)->hard_header_len + READ_ONCE((dev)->needed_headroom)) \ +#define LL_RESERVED_SPACE_EX (dev, hlen) \ + ((((hlen) + READ_ONCE((dev)->needed_headroom)) \ & ~(HH_DATA_MOD - 1)) + HH_DATA_MOD) +#define LL_RESERVED_SPACE (dev) \ + LL_RESERVED_SPACE_EX(dev, (dev)->hard_header_len)#define LL_RESERVED_SPACE_EXTRA (dev,extra) \ ((((dev)->hard_header_len + READ_ONCE((dev)->needed_headroom) + (extra)) \ & ~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
include/linux/pci-ecam.h +3 -0
@@ -77,6 +77,9 @@ void __iomem *pci_ecam_map_bus(struct pci_bus *bus, unsigned int devfn,/* default ECAM ops */ extern const struct pci_ecam_ops pci_generic_ecam_ops; +/* default CAM ops */ +extern const struct pci_ecam_ops pci_generic_cam_ops; +#if defined(CONFIG_ACPI ) && defined(CONFIG_PCI_QUIRKS )extern const struct pci_ecam_ops pci_32b_ops;/* 32-bit accesses only */ extern const struct pci_ecam_ops pci_32b_read_ops;/* 32-bit read only */
include/linux/sched.h +8 -0
@@ -1428,6 +1428,14 @@ struct task_struct {/* Collect coverage from softirq context: */ unsigned int kcov_softirq; + +/* Temporary storage for preempting remote coverage collection: */ +unsigned int kcov_saved_mode; +unsigned int kcov_saved_size; +void *kcov_saved_area; +struct kcov *kcov_saved_kcov; +int kcov_saved_sequence; +#endif #ifdef CONFIG_MEMCG
include/net/tls.h +2 -1
@@ -122,7 +122,8 @@ struct tls_strparser { u32 stopped : 1; u32 copy_mode : 1; u32 mixed_decrypted : 1; - u32 msg_ready : 1; + +bool msg_ready;struct strp_msg stm;
kernel/events/core.c +63 -58
214 lines not on this page · raw message
kernel/kcov.c +47 -43
169 lines not on this page · raw message
lib/Kconfig.debug +3 -2
@@ -2044,10 +2044,11 @@ config KCOV_INSTRUMENT_ALL config KCOV_IRQ_AREA_SIZE hex "Size of interrupt coverage collection area in words" depends on KCOV + range 0x80 0x1000000 default 0x40000 help - KCOV uses preallocated per-cpu areas to collect coverage from - soft interrupts. This specifies the size of those areas in the + KCOV uses preallocated areas to collect coverage from soft + interrupts. This specifies the size of those areas in the number of unsigned long words. menuconfig RUNTIME_TESTING_MENU
net/bluetooth/hci_event.c +2 -0
@@ -297,8 +297,10 @@ static u8 hci_cc_reset(struct hci_dev *hdev, void *data, struct sk_buff *skb) hdev->ssp_debug_mode =0 ; +hci_dev_lock (hdev);hci_bdaddr_list_clear (&hdev->le_accept_list);hci_bdaddr_list_clear (&hdev->le_resolv_list); +hci_dev_unlock (hdev);return rp->status; }
net/bluetooth/rfcomm/core.c +21 -3
@@ -1330,7 +1330,10 @@ static struct rfcomm_session *rfcomm_recv_disc(struct rfcomm_session *s,return s; } -void rfcomm_dlc_accept (struct rfcomm_dlc *d) +/* Must be called with rfcomm_mutex held, so that the session cannot be +* unlinked from under us. +*/ +static void __rfcomm_dlc_accept (struct rfcomm_dlc *d) {struct sock *sk = d->session->sock->sk;struct l2cap_conn *conn =l2cap_pi (sk)->chan->conn;
@@ -1352,6 +1355,21 @@ void rfcomm_dlc_accept(struct rfcomm_dlc *d)rfcomm_send_msc (d->session,1 , d->dlci, d->v24_sig); } +void rfcomm_dlc_accept (struct rfcomm_dlc *d) +{ +rfcomm_lock (); + +/* rfcomm_recv_disc() sets the dlc state to BT_CLOSED before calling +* __rfcomm_dlc_close(), so the RFCOMM_DEFER_SETUP handshake there is +* skipped and the session can already be unlinked by the time the +* deferred accept runs from rfcomm_sock_recvmsg(). +*/ +if (d->session) +__rfcomm_dlc_accept (d); + +rfcomm_unlock (); +} +static void rfcomm_check_accept (struct rfcomm_dlc *d) {if (rfcomm_check_security (d)) {
@@ -1364,7 +1382,7 @@ static void rfcomm_check_accept(struct rfcomm_dlc *d) d->state_change (d,0 );rfcomm_dlc_unlock (d); }else -rfcomm_dlc_accept (d); +__rfcomm_dlc_accept (d); }else {set_bit (RFCOMM_AUTH_PENDING , &d->flags);rfcomm_dlc_set_timer (d,RFCOMM_AUTH_TIMEOUT );
@@ -1949,7 +1967,7 @@ static void rfcomm_process_dlcs(struct rfcomm_session *s) d->state_change (d,0 );rfcomm_dlc_unlock (d); }else -rfcomm_dlc_accept (d); +__rfcomm_dlc_accept (d); }continue ; }else if (test_and_clear_bit (RFCOMM_AUTH_REJECT , &d->flags)) {
net/can/af_can.c +11 -3
@@ -640,6 +640,16 @@ static int can_rcv_filter(struct can_dev_rcv_lists *dev_rcv_lists, struct sk_bufreturn matches; } +void can_set_skb_uid (struct sk_buff *skb) +{ +/* create non-zero unique skb identifier together with *skb */ +while (!(skb->hash)) + skb->hash =atomic_inc_return (&skbcounter); + + skb->sw_hash =1 ; +} +EXPORT_SYMBOL (can_set_skb_uid); +static void can_receive (struct sk_buff *skb,struct net_device *dev) {struct can_dev_rcv_lists *dev_rcv_lists;
@@ -651,9 +661,7 @@ static void can_receive(struct sk_buff *skb, struct net_device *dev)atomic_long_inc (&pkg_stats->rx_frames);atomic_long_inc (&pkg_stats->rx_frames_delta); -/* create non-zero unique skb identifier together with *skb */ -while (!(can_skb_prv (skb)->skbcnt)) -can_skb_prv (skb)->skbcnt =atomic_inc_return (&skbcounter); +can_set_skb_uid (skb);rcu_read_lock ();
net/can/bcm.c +0 -2
@@ -338,7 +338,6 @@ static void bcm_can_tx(struct bcm_op *op, struct canfd_frame *cf)can_skb_reserve (skb);can_skb_prv (skb)->ifindex = dev->ifindex; -can_skb_prv (skb)->skbcnt =0 ;skb_put_data (skb, cf, op->cfsiz);
@@ -1582,7 +1581,6 @@ static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk, }can_skb_prv (skb)->ifindex = dev->ifindex; -can_skb_prv (skb)->skbcnt =0 ; skb->dev = dev;can_skb_set_owner (skb, sk); err =can_send (skb,1 );/* send with loopback */
net/can/isotp.c +230 -90
320 lines not on this page · raw message
net/packet/af_packet.c +51 -28
79 lines not on this page · 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.