Linux 5.15.177
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.15.177 kernel.
All users of the 5.15 kernel series must upgrade.
The updated 5.15.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.15.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/arm64/boot/dts/rockchip/rk3328.dtsi | 1 arch/riscv/kernel/traps.c | 6 - arch/x86/include/asm/special_insns.h | 2 arch/x86/xen/xen-asm.S | 2 block/bfq-iosched.c | 12 +- drivers/acpi/resource.c | 24 +++- drivers/base/regmap/regmap.c | 12 -- drivers/base/topology.c | 24 +++- drivers/gpio/gpiolib-cdev.c | 2 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 45 ------- drivers/gpu/drm/amd/display/dc/dc.h | 2 drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h | 8 + drivers/gpu/drm/i915/display/intel_fb.c | 2 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 12 +- drivers/gpu/drm/v3d/v3d_irq.c | 4 drivers/hwmon/tmp513.c | 7 - drivers/i2c/busses/i2c-rcar.c | 20 ++- drivers/i2c/muxes/i2c-demux-pinctrl.c | 4 drivers/iio/adc/ad7124.c | 3 drivers/iio/adc/at91_adc.c | 2 drivers/iio/adc/rockchip_saradc.c | 2 drivers/iio/adc/ti-ads124s08.c | 4 drivers/iio/adc/ti-ads8688.c | 2 drivers/iio/dummy/iio_simple_dummy_buffer.c | 2 drivers/iio/gyro/fxas21002c_core.c | 9 + drivers/iio/imu/inv_icm42600/inv_icm42600.h | 1 drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 18 ++- drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 3 drivers/iio/imu/kmx61.c | 2 drivers/iio/inkern.c | 2 drivers/iio/light/vcnl4035.c | 2 drivers/iio/pressure/zpa2326.c | 2 drivers/irqchip/irq-gic-v3.c | 2 drivers/md/dm-ebs-target.c | 2 drivers/md/dm-thin.c | 5 drivers/md/persistent-data/dm-array.c | 19 ++- drivers/md/raid5.c | 14 +- drivers/mtd/spi-nor/core.c | 2 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 19 --- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 3 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 5 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 95 +++++++++++++--- drivers/net/ethernet/netronome/nfp/bpf/offload.c | 3 drivers/net/ethernet/ti/cpsw_ale.c | 14 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 + drivers/net/gtp.c | 42 ++++--- drivers/net/ieee802154/ca8210.c | 6 - drivers/nvme/target/io-cmd-bdev.c | 2 drivers/of/address.c | 76 +++++++++---- drivers/of/unittest-data/tests-address.dtsi | 9 + drivers/of/unittest.c | 109 +++++++++++++++++++ drivers/pci/controller/pci-host-common.c | 4 drivers/pci/probe.c | 20 +-- drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c | 53 +++++++-- drivers/phy/broadcom/phy-brcm-usb-init.h | 1 drivers/phy/broadcom/phy-brcm-usb.c | 8 - drivers/scsi/sg.c | 2 drivers/staging/iio/frequency/ad9832.c | 2 drivers/staging/iio/frequency/ad9834.c | 2 drivers/usb/class/usblp.c | 7 - drivers/usb/core/hub.c | 6 - drivers/usb/core/port.c | 7 - drivers/usb/dwc3/core.h | 1 drivers/usb/dwc3/gadget.c | 4 drivers/usb/gadget/function/f_fs.c | 2 drivers/usb/gadget/function/f_uac2.c | 1 drivers/usb/gadget/function/u_serial.c | 8 - drivers/usb/host/xhci-pci.c | 4 drivers/usb/serial/cp210x.c | 1 drivers/usb/serial/option.c | 4 drivers/usb/storage/unusual_devs.h | 7 + fs/afs/afs.h | 2 fs/afs/afs_vl.h | 1 fs/afs/vl_alias.c | 8 + fs/afs/vlclient.c | 2 fs/ceph/mds_client.c | 9 - fs/exfat/dir.c | 3 fs/exfat/fatent.c | 10 + fs/file.c | 1 fs/hfs/super.c | 4 fs/jbd2/commit.c | 4 fs/ksmbd/smb2pdu.c | 3 fs/nfsd/filecache.c | 18 +-- fs/nfsd/filecache.h | 1 fs/ocfs2/quota_global.c | 2 fs/ocfs2/quota_local.c | 10 - fs/proc/vmcore.c | 2 include/linux/blk-cgroup.h | 6 - include/linux/hrtimer.h | 1 include/linux/mlx5/device.h | 2 include/linux/mlx5/fs.h | 2 include/linux/poll.h | 10 + include/linux/usb.h | 3 include/linux/usb/hcd.h | 2 include/net/inet_connection_sock.h | 2 include/net/net_namespace.h | 3 kernel/cpu.c | 2 kernel/gen_kheaders.sh | 1 kernel/time/hrtimer.c | 11 + mm/filemap.c | 2 net/802/psnap.c | 4 net/core/filter.c | 30 +++-- net/core/net_namespace.c | 31 +++++ net/core/pktgen.c | 6 - net/dccp/ipv6.c | 2 net/ipv6/route.c | 2 net/ipv6/tcp_ipv6.c | 4 net/mac802154/iface.c | 4 net/mptcp/options.c | 12 +- net/mptcp/pm.c | 7 - net/mptcp/protocol.h | 2 net/netfilter/nf_conntrack_core.c | 5 net/netfilter/nf_tables_api.c | 15 +- net/sched/cls_flow.c | 3 net/sctp/sysctl.c | 14 +- net/tls/tls_sw.c | 2 net/vmw_vsock/af_vsock.c | 18 +++ net/vmw_vsock/virtio_transport_common.c | 36 ++++-- scripts/sorttable.h | 6 - sound/soc/mediatek/common/mtk-afe-platform-driver.c | 4 121 files changed, 819 insertions(+), 337 deletions(-)
Aharon Landau (1):
net/mlx5: Add priorities for counters in RDMA namespaces
Akash M (1):
usb: gadget: f_fs: Remove WARN_ON in functionfs_bind
Al Cooper (1):
phy: usb: Add "wake on" functionality for newer Synopsis XHCI controllers
Andrea della Porta (1):
of: address: Preserve the flags portion on 1:1 dma-ranges mapping
André Draszik (1):
usb: dwc3: gadget: fix writing NYET threshold
Antonio Pastor (1):
net: 802: LLC+SNAP OID:PID lookup on start of skb data
Anumula Murali Mohan Reddy (1):
cxgb4: Avoid removal of uninserted tid
Arnd Bergmann (1):
xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals
Artem Chernyshev (1):
pktgen: Avoid out-of-bounds access in get_imix_entries
Benjamin Coddington (1):
tls: Fix tls_sw_sendmsg error handling
Carlos Song (1):
iio: gyro: fxas21002c: Fix missing data update in trigger handler
Chen-Yu Tsai (1):
ASoC: mediatek: disable buffer pre-allocation
Chukun Pan (1):
USB: serial: option: add MeiG Smart SRM815
Dan Carpenter (1):
nfp: bpf: prevent integer overflow in nfp_bpf_event_output()
David Howells (2):
afs: Fix the maximum cell name length
kheaders: Ignore silly-rename files
David Lechner (1):
hwmon: (tmp513) Fix division of negative numbers
Dennis Lam (1):
ocfs2: fix slab-use-after-free due to dangling pointer dqi_priv
Eric Dumazet (4):
net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute
net: add exit_batch_rtnl() method
gtp: use exit_batch_rtnl() method
ipv6: avoid possible NULL deref in rt6_uncached_list_flush_dev()
Fabio Estevam (1):
iio: adc: ti-ads124s08: Use gpiod_set_value_cansleep()
Geliang Tang (1):
mptcp: drop port parameter of mptcp_pm_add_addr_signal
Greg Kroah-Hartman (3):
Revert "drm/amdgpu: rework resume handling for display (v2)" Revert "regmap: detach regmap from dev on regmap_exit" Linux 5.15.177
Gui-Dong Han (1):
md/raid5: fix atomicity violation in raid5_cache_count
Hans de Goede (3):
ACPI: resource: Add TongFang GM5HG0A to irq1_edge_low_force_override[]
ACPI: resource: Add Asus Vivobook X1504VAP to irq1_level_low_skip_override[]
ACPI: resource: acpi_dev_irq_override(): Check DMI match lastHeiner Kallweit (1):
net: ethernet: xgbe: re-add aneg to supported features in PHY quirks
Herve Codina (2):
of: address: Fix address translation when address-size is greater than 2
of: address: Remove duplicated functions
Jason Xing (1):
tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog
Jason-JH.Lin (1):
drm/mediatek: Add support for 180-degree rotation in the display driver
Javier Carrasco (6):
iio: pressure: zpa2326: fix information leak in triggered buffer
iio: dummy: iio_simply_dummy_buffer: fix information leak in triggered buffer
iio: light: vcnl4035: fix information leak in triggered buffer
iio: imu: kmx61: fix information leak in triggered buffer
iio: adc: ti-ads8688: fix information leak in triggered buffer
iio: adc: rockchip_saradc: fix information leak in triggered buffer
Jean-Baptiste Maneyrol (2):
iio: imu: inv_icm42600: fix spi burst write not supported
iio: imu: inv_icm42600: fix timestamps after suspend if sensor is on
Joe Hattori (2):
iio: adc: at91: call input_free_device() on allocated iio_dev
iio: inkern: call iio_device_put() only on mapped devices
Johan Hovold (1):
USB: serial: cp210x: add Phoenix Contact UPS Device
Joseph Qi (1):
ocfs2: correct return value of ocfs2_local_free_info()
Juergen Gross (2):
x86/asm: Make serialize() always_inline x86/xen: fix SLS mitigation in xen_hypercall_iret()
Jun Yan (1):
USB: usblp: return error when setting unsupported protocol
Justin Chen (3):
phy: usb: Toggle the PHY power during init
phy: usb: Use slow clock for wake enabled suspend
phy: usb: Fix clock imbalance for suspend/resume
Kai-Heng Feng (1):
USB: core: Disable LPM only for non-suspended ports
Kalesh AP (1):
bnxt_en: Fix possible memory leak when hwrm_req_replace fails
Keisuke Nishimura (1):
ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe()
Koichiro Den (1):
hrtimers: Handle CPU state correctly on hotplug
Krister Johansen (1):
dm thin: make get_first_thin use rcu-safe list first function
Kuan-Wei Chiu (1):
scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity
Kuniyuki Iwashima (2):
gtp: Use for_each_netdev_rcu() in gtp_genl_dump_pdp().
gtp: Destroy device along with udp socket's netns dismantle.
Leo Stone (1):
hfs: Sanity check the root record
Li Huafei (1):
topology: Keep the cpumask unchanged when printing cpumap
Lianqin Hu (1):
usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null
Lizhi Xu (1):
mac802154: check local interfaces before deleting sdata list
Lubomir Rintel (1):
usb-storage: Add max sectors quirk for Nokia 208
Luis Chamberlain (1):
nvmet: propagate npwg topology
Ma Ke (1):
usb: fix reference leak in usb_new_device()
Maor Gottlieb (1):
net/mlx5: Refactor mlx5_get_flow_namespace
Marco Nelissen (1):
filemap: avoid truncating 64-bit offset to 32 bits
Matthieu Baerts (NGI0) (5):
sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy
sctp: sysctl: rto_min/max: avoid using current->nsproxy
sctp: sysctl: auth_enable: avoid using current->nsproxy
sctp: sysctl: udp_port: avoid using current->nsproxy
sctp: sysctl: plpmtud_probe_interval: avoid using current->nsproxyMax Kellermann (1):
ceph: give up on paths longer than PATH_MAX
Maíra Canal (1):
drm/v3d: Ensure job pointer is set to NULL after job completion
Melissa Wen (1):
drm/amd/display: increase MAX_SURFACES to the value supported by hw
Michal Hrusecky (1):
USB: serial: option: add Neoway N723-EA support
Michal Luczaj (1):
bpf: Fix bpf_sk_select_reuseport() memory leak
Mikulas Patocka (1):
dm-ebs: don't set the flag DM_TARGET_PASSES_INTEGRITY
Ming-Hung Tsai (3):
dm array: fix releasing a faulty array block twice in dm_array_cursor_end dm array: fix unreleased btree blocks on closing a faulty array cursor dm array: fix cursor index when skipping across block boundaries
Nam Cao (1):
riscv: Fix sleeping in invalid context in die()
Oleg Nesterov (1):
poll_wait: add mb() to fix theoretical race between waitqueue_active() and .poll()
Pablo Neira Ayuso (2):
netfilter: nf_tables: imbalance in flowtable binding
netfilter: conntrack: clamp maximum hashtable size to INT_MAX
Paolo Abeni (1):
mptcp: fix TCP options overflow.
Patrisious Haddad (1):
net/mlx5: Fix RDMA TX steering prio
Peter Geis (1):
arm64: dts: rockchip: add hevc power domain clock to rk3328
Prashanth K (1):
usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints
Pratyush Yadav (1):
Revert "mtd: spi-nor: core: replace dummy buswidth from addr to data"
Rik van Riel (1):
fs/proc: fix softlockup in __read_vmcore (part 2)
Rob Herring (3):
of: unittest: Add bus address range parsing tests of/address: Add support for 3 address cell bus
of: address: Store number of bus flag cells rather than bool
Roman Li (1):
drm/amd/display: Add check for granularity in dml ceil/floor helpers
Ron Economos (1):
Partial revert of xhci: use pm_ptr() instead #ifdef for CONFIG_PM conditionals
Sean Anderson (1):
net: xilinx: axienet: Fix IRQ coalescing packet count overflow
Stefano Garzarella (4):
vsock/virtio: cancel close work in the destructor
vsock: reset socket state when de-assigning the transport
vsock: prevent null-ptr-deref in vsock_*[has_data|has_space] vsock/virtio: discard packets if the transport changes
Sudheer Kumar Doredla (1):
net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()
Suraj Sonawane (1):
scsi: sg: Fix slab-use-after-free read in sg_release()
Tejun Heo (1):
blk-cgroup: Fix UAF in blkcg_unpin_online()
Terry Tritton (1):
Revert "PCI: Use preserve_config in place of pci_flags"
Uwe Kleine-König (1):
iio: adc: ad7124: Disable all channels at probe time
Ville Syrjälä (1):
drm/i915/fb: Relax clear color alignment to 64 bytes
Wang Liang (1):
net: fix data-races around sk->sk_forward_alloc
Wentao Liang (1):
ksmbd: fix a missing return value check bug
Wolfram Sang (2):
i2c: mux: demux-pinctrl: check initial mux selection, too
i2c: rcar: fix NACK handling when being a target
Yogesh Lal (1):
irqchip/gic-v3: Handle CPU_PM_ENTER_FAILED correctly
Youzhong Yang (1):
nfsd: add list_head nf_gc to struct nfsd_file
Yu Kuai (1):
block, bfq: fix waker_bfqq UAF after bfq_split_bfqq()
Yuezhang Mo (2):
exfat: fix the infinite loop in exfat_readdir()
exfat: fix the infinite loop in __exfat_free_cluster()
Zhang Kunbo (1):
fs: fix missing declaration of init_files
Zhang Yi (1):
jbd2: flush filesystem device before updating tail sequence
Zhongqiu Duan (1):
tcp/dccp: allow a connection when sk_max_ack_backlog is zero
Zhongqiu Han (1):
gpiolib: cdev: Fix use after free in lineinfo_changed_notify
Zicheng Qu (2):
staging: iio: ad9834: Correct phase range check
staging: iio: ad9832: Correct phase range check
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 15 -SUBLEVEL = 176 +SUBLEVEL = 177 EXTRAVERSION = NAME = Trick or Treat
arch/arm64/boot/dts/rockchip/rk3328.dtsi +1 -0
@@ -302,6 +302,7 @@ power: power-controller { power-domain@RK3328_PD_HEVC { reg = <RK3328_PD_HEVC>; + clocks = <&cru SCLK_VENC_CORE>; #power-domain-cells = <0>; }; power-domain@RK3328_PD_VIDEO {
arch/riscv/kernel/traps.c +3 -3
@@ -27,7 +27,7 @@int show_unhandled_signals =1 ; -static DEFINE_SPINLOCK (die_lock); +static DEFINE_RAW_SPINLOCK (die_lock);void die (struct pt_regs *regs,const char *str) {
@@ -38,7 +38,7 @@ void die(struct pt_regs *regs, const char *str)oops_enter (); -spin_lock_irqsave (&die_lock, flags); +raw_spin_lock_irqsave (&die_lock, flags);console_verbose ();bust_spinlocks (1 );
@@ -55,7 +55,7 @@ void die(struct pt_regs *regs, const char *str)bust_spinlocks (0 );add_taint (TAINT_DIE ,LOCKDEP_NOW_UNRELIABLE ); -spin_unlock_irqrestore (&die_lock, flags); +raw_spin_unlock_irqrestore (&die_lock, flags);oops_exit ();if (in_interrupt ())
arch/x86/include/asm/special_insns.h +1 -1
@@ -224,7 +224,7 @@ static inline void clwb(volatile void *__p)#define nop () asm volatile ("nop") -static inline void serialize (void ) +static __always_inline void serialize(void) {/* Instruction opcode for SERIALIZE; supported in binutils >= 2.35. */ asmvolatile (".byte 0xf, 0x1, 0xe8" :::"memory" );
arch/x86/xen/xen-asm.S +1 -1
@@ -214,7 +214,7 @@ SYM_CODE_END(xen_early_idt_handler_array) push %rax mov $__HYPERVISOR_iret, %eax syscall /* Do the IRET. */ -#ifdef CONFIG_MITIGATION_SLS +#ifdef CONFIG_SLS int3 #endif .endm
block/bfq-iosched.c +10 -2
@@ -6577,16 +6577,24 @@ static struct bfq_queue *bfq_waker_bfqq(struct bfq_queue *bfqq)if (new_bfqq == waker_bfqq) {/* * If waker_bfqq is in the merge chain, and current -* is the only procress. +* is the only process, waker_bfqq can be freed. */ if (bfqq_process_refs (waker_bfqq) ==1 )return NULL ; -break ; + +return waker_bfqq; } new_bfqq = new_bfqq->new_bfqq; } +/* +* If waker_bfqq is not in the merge chain, and it's procress reference +* is 0, waker_bfqq can be freed. +*/ +if (bfqq_process_refs (waker_bfqq) ==0 ) +return NULL ; +return waker_bfqq; }
drivers/acpi/resource.c +21 -3
@@ -442,6 +442,13 @@ static const struct dmi_system_id asus_laptop[] = { DMI_MATCH(DMI_BOARD_NAME, "B1502CBA"), }, }, + { +/* Asus Vivobook X1504VAP */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_BOARD_NAME, "X1504VAP"), + }, + }, {/* Asus Vivobook X1704VAP */ .matches = {
@@ -618,6 +625,17 @@ static const struct dmi_system_id lg_laptop[] = { DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, }, + { +/* +* TongFang GM5HG0A in case of the SKIKK Vanaheim relabel the +* board-name is changed, so check OEM strings instead. Note +* OEM string matches are always exact matches. +* https://bugzilla.kernel.org/show_bug.cgi?id=219614 +*/ + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "GM5HG0A"), + }, + }, { } };
@@ -648,11 +666,11 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,for (i =0 ; i <ARRAY_SIZE (override_table); i++) {const struct irq_override_cmp *entry = &override_table[i]; -if (dmi_check_system (entry->system) && - entry->irq == gsi && +if (entry->irq == gsi && entry->triggering == triggering && entry->polarity == polarity && - entry->shareable == shareable) + entry->shareable == shareable && +dmi_check_system (entry->system))return entry->override; }
drivers/base/regmap/regmap.c +0 -12
@@ -663,17 +663,6 @@ int regmap_attach_dev(struct device *dev, struct regmap *map, }EXPORT_SYMBOL_GPL (regmap_attach_dev); -static int dev_get_regmap_match (struct device *dev,void *res,void *data); - -static int regmap_detach_dev (struct device *dev,struct regmap *map) -{ -if (!dev) -return 0 ; - -return devres_release (dev, dev_get_regmap_release, - dev_get_regmap_match, (void *)map->name); -} -static enum regmap_endian regmap_get_reg_endian (const struct regmap_bus *bus,const struct regmap_config *config) {
@@ -1508,7 +1497,6 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config) {int ret; -regmap_detach_dev (map->dev, map);regcache_exit (map);regmap_debugfs_exit (map);
drivers/base/topology.c +20 -4
@@ -27,9 +27,17 @@ static ssize_t name##_read(struct file *file, struct kobject *kobj, \ loff_t off, size_t count) \ { \struct device *dev =kobj_to_dev (kobj); \ +cpumask_var_t mask; \ +ssize_t n; \ \ - return cpumap_print_bitmask_to_buf(buf, topology_##mask(dev->id), \ - off, count); \ +if (!alloc_cpumask_var (&mask,GFP_KERNEL )) \ +return -ENOMEM ; \ + \ + cpumask_copy(mask, topology_##mask(dev->id)); \ + n = cpumap_print_bitmask_to_buf(buf, mask, off, count); \ + free_cpumask_var(mask); \ + \ + return n; \ } \ \ static ssize_t name##_list_read(struct file *file, struct kobject *kobj, \
@@ -37,9 +45,17 @@ static ssize_t name##_list_read(struct file *file, struct kobject *kobj, \ loff_t off, size_t count) \ { \struct device *dev =kobj_to_dev (kobj); \ +cpumask_var_t mask; \ +ssize_t n; \ + \ +if (!alloc_cpumask_var (&mask,GFP_KERNEL )) \ +return -ENOMEM ; \ + \ + cpumask_copy(mask, topology_##mask(dev->id)); \ + n =cpumap_print_list_to_buf (buf, mask, off, count); \ +free_cpumask_var (mask); \ \ - return cpumap_print_list_to_buf(buf, topology_##mask(dev->id), \ - off, count); \ +return n; \ }define_id_show_func (physical_package_id);
drivers/gpio/gpiolib-cdev.c +1 -1
@@ -2506,9 +2506,9 @@ static int gpio_chrdev_release(struct inode *inode, struct file *file)struct gpio_chardev_data *cdev = file->private_data;struct gpio_device *gdev = cdev->gdev; -bitmap_free (cdev->watched_lines);blocking_notifier_chain_unregister (&gdev->notifier, &cdev->lineinfo_changed_nb); +bitmap_free (cdev->watched_lines);put_device (&gdev->dev);kfree (cdev);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -43
81 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -47,7 +47,7 @@ struct aux_payload;#define DC_VER "3.2.149" -#define MAX_SURFACES 3 +#define MAX_SURFACES 4#define MAX_PLANES 6#define MAX_STREAMS 6#define MAX_SINKS_PER_LINK 4
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h +8 -0
@@ -66,11 +66,15 @@ static inline double dml_max5(double a, double b, double c, double d, double e)static inline double dml_ceil (double a,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_ceil2 (a, granularity); }static inline double dml_floor (double a,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_floor2 (a, granularity); }
@@ -119,11 +123,15 @@ static inline double dml_ceil_2(double f)static inline double dml_ceil_ex (double x,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_ceil2 (x, granularity); }static inline double dml_floor_ex (double x,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_floor2 (x, granularity); }
drivers/gpu/drm/i915/display/intel_fb.c +1 -1
@@ -795,7 +795,7 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer ** arithmetic related to alignment and offset calculation. */ if (is_gen12_ccs_cc_plane (&fb->base, i)) { -if (IS_ALIGNED (fb->base.offsets[i],PAGE_SIZE )) +if (IS_ALIGNED (fb->base.offsets[i],64 ))continue ;else return -EINVAL ;
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +10 -2
@@ -302,6 +302,7 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,unsigned int addr = pending->addr;unsigned int pitch = pending->pitch &0xffff ;unsigned int fmt = pending->format; +unsigned int rotation = pending->rotation;unsigned int offset = (pending->y <<16 ) | pending->x;unsigned int src_size = (pending->height <<16 ) | pending->width;unsigned int con;
@@ -315,12 +316,19 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,if (state->base.fb && state->base.fb->format->has_alpha) con |=OVL_CON_AEN |OVL_CON_ALPHA ; -if (pending->rotation &DRM_MODE_REFLECT_Y ) { +/* +* Treat rotate 180 as flip x + flip y, and XOR the original rotation value +* to flip x + flip y to support both in the same time. +*/ +if (rotation &DRM_MODE_ROTATE_180 ) + rotation ^=DRM_MODE_REFLECT_X |DRM_MODE_REFLECT_Y ; + +if (rotation &DRM_MODE_REFLECT_Y ) { con |=OVL_CON_VIRT_FLIP ; addr += (pending->height -1 ) * pending->pitch; } -if (pending->rotation &DRM_MODE_REFLECT_X ) { +if (rotation &DRM_MODE_REFLECT_X ) { con |=OVL_CON_HORZ_FLIP ; addr += pending->pitch -1 ; }
drivers/gpu/drm/v3d/v3d_irq.c +4 -0
@@ -103,6 +103,7 @@ v3d_irq(int irq, void *arg)trace_v3d_bcl_irq (&v3d->drm, fence->seqno);dma_fence_signal (&fence->base); + v3d->bin_job =NULL ; status =IRQ_HANDLED ; }
@@ -112,6 +113,7 @@ v3d_irq(int irq, void *arg)trace_v3d_rcl_irq (&v3d->drm, fence->seqno);dma_fence_signal (&fence->base); + v3d->render_job =NULL ; status =IRQ_HANDLED ; }
@@ -121,6 +123,7 @@ v3d_irq(int irq, void *arg)trace_v3d_csd_irq (&v3d->drm, fence->seqno);dma_fence_signal (&fence->base); + v3d->csd_job =NULL ; status =IRQ_HANDLED ; }
@@ -157,6 +160,7 @@ v3d_hub_irq(int irq, void *arg)trace_v3d_tfu_irq (&v3d->drm, fence->seqno);dma_fence_signal (&fence->base); + v3d->tfu_job =NULL ; status =IRQ_HANDLED ; }
drivers/hwmon/tmp513.c +4 -3
@@ -203,7 +203,8 @@ static int tmp51x_get_value(struct tmp51x_data *data, u8 reg, u8 pos, *val =sign_extend32 (regval, reg ==TMP51X_SHUNT_CURRENT_RESULT ?16 -tmp51x_get_pga_shift (data) :15 ); - *val =DIV_ROUND_CLOSEST (*val *10 *MILLI , data->shunt_uohms); + *val =DIV_ROUND_CLOSEST (*val *10 * (long )MILLI , (long )data->shunt_uohms); +break ;case TMP51X_BUS_VOLTAGE_RESULT :case TMP51X_BUS_VOLTAGE_H_LIMIT :
@@ -219,7 +220,7 @@ static int tmp51x_get_value(struct tmp51x_data *data, u8 reg, u8 pos,case TMP51X_BUS_CURRENT_RESULT :// Current = (ShuntVoltage * CalibrationRegister) / 4096 *val =sign_extend32 (regval,15 ) * (long )data->curr_lsb_ua; - *val =DIV_ROUND_CLOSEST (*val,MILLI ); + *val =DIV_ROUND_CLOSEST (*val, (long )MILLI );break ;case TMP51X_LOCAL_TEMP_RESULT :case TMP51X_REMOTE_TEMP_RESULT_1 :
@@ -259,7 +260,7 @@ static int tmp51x_set_value(struct tmp51x_data *data, u8 reg, long val)* The user enter current value and we convert it to * voltage. 1lsb = 10uV */ - val =DIV_ROUND_CLOSEST (val * data->shunt_uohms,10 *MILLI ); + val =DIV_ROUND_CLOSEST (val * (long )data->shunt_uohms,10 * (long )MILLI ); max_val =U16_MAX >>tmp51x_get_pga_shift (data); regval =clamp_val (val, -max_val, max_val);break ;
drivers/i2c/busses/i2c-rcar.c +15 -5
@@ -112,6 +112,8 @@#define ID_P_PM_BLOCKED BIT(31)#define ID_P_MASK GENMASK(31, 28) +#define ID_SLAVE_NACK BIT(0) +enum rcar_i2c_type {I2C_RCAR_GEN1 ,I2C_RCAR_GEN2 ,
@@ -146,6 +148,7 @@ struct rcar_i2c_priv {int irq;struct i2c_client *host_notify_client; +u8 slave_flags; };#define rcar_i2c_priv_to_dev (p) ((p)->adap.dev.parent)
@@ -576,6 +579,7 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv) {u32 ssr_raw, ssr_filtered;u8 value; +int ret; ssr_raw =rcar_i2c_read (priv,ICSSR ) &0xff ; ssr_filtered = ssr_raw &rcar_i2c_read (priv,ICSIER );
@@ -591,7 +595,10 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)rcar_i2c_write (priv,ICRXTX , value);rcar_i2c_write (priv,ICSIER ,SDE |SSR |SAR ); }else { -i2c_slave_event (priv->slave,I2C_SLAVE_WRITE_REQUESTED , &value); + ret =i2c_slave_event (priv->slave,I2C_SLAVE_WRITE_REQUESTED , &value); +if (ret) + priv->slave_flags |=ID_SLAVE_NACK ; +rcar_i2c_read (priv,ICRXTX );/* dummy read */ rcar_i2c_write (priv,ICSIER ,SDR |SSR |SAR ); }
@@ -604,18 +611,21 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)if (ssr_filtered &SSR ) {i2c_slave_event (priv->slave,I2C_SLAVE_STOP , &value);rcar_i2c_write (priv,ICSCR ,SIE |SDBS );/* clear our NACK */ + priv->slave_flags &= ~ID_SLAVE_NACK ;rcar_i2c_write (priv,ICSIER ,SAR );rcar_i2c_write (priv,ICSSR , ~SSR &0xff ); }/* master wants to write to us */ if (ssr_filtered &SDR ) { -int ret; - value =rcar_i2c_read (priv,ICRXTX ); ret =i2c_slave_event (priv->slave,I2C_SLAVE_WRITE_RECEIVED , &value); -/* Send NACK in case of error */ -rcar_i2c_write (priv,ICSCR ,SIE |SDBS | (ret <0 ?FNA :0 )); +if (ret) + priv->slave_flags |=ID_SLAVE_NACK ; + +/* Send NACK in case of error, but it will come 1 byte late :( */ +rcar_i2c_write (priv,ICSCR ,SIE |SDBS | + (priv->slave_flags &ID_SLAVE_NACK ?FNA :0 ));rcar_i2c_write (priv,ICSSR , ~SDR &0xff ); }
drivers/i2c/muxes/i2c-demux-pinctrl.c +3 -1
@@ -261,7 +261,9 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev)pm_runtime_no_callbacks (&pdev->dev);/* switch to first parent as active master */ -i2c_demux_activate_master (priv,0 ); + err =i2c_demux_activate_master (priv,0 ); +if (err) + goto err_rollback; err =device_create_file (&pdev->dev, &dev_attr_available_masters);if (err)
drivers/iio/adc/ad7124.c +3 -0
@@ -856,6 +856,9 @@ static int ad7124_setup(struct ad7124_state *st)* set all channels to this default value. */ ad7124_set_channel_odr (st, i,10 ); + +/* Disable all channels to prevent unintended conversions. */ +ad_sd_write_reg (&st->sd,AD7124_CHANNEL (i),2 ,0 ); }return ret;
drivers/iio/adc/at91_adc.c +1 -1
@@ -985,7 +985,7 @@ static int at91_ts_register(struct iio_dev *idev,return ret; err: -input_free_device (st->ts_input); +input_free_device (input);return ret; }
drivers/iio/adc/rockchip_saradc.c +2 -0
@@ -270,6 +270,8 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)int ret;int i, j =0 ; +memset (&data,0 ,sizeof (data)); +mutex_lock (&i_dev->mlock);for_each_set_bit (i, i_dev->active_scan_mask, i_dev->masklength) {
drivers/iio/adc/ti-ads124s08.c +2 -2
@@ -184,9 +184,9 @@ static int ads124s_reset(struct iio_dev *indio_dev)struct ads124s_private *priv =iio_priv (indio_dev);if (priv->reset_gpio) { -gpiod_set_value (priv->reset_gpio,0 ); +gpiod_set_value_cansleep (priv->reset_gpio,0 );udelay (200 ); -gpiod_set_value (priv->reset_gpio,1 ); +gpiod_set_value_cansleep (priv->reset_gpio,1 ); }else {return ads124s_write_cmd (indio_dev,ADS124S08_CMD_RESET ); }
drivers/iio/adc/ti-ads8688.c +1 -1
@@ -384,7 +384,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)struct iio_poll_func *pf = p;struct iio_dev *indio_dev = pf->indio_dev;/* Ensure naturally aligned timestamp */ -u16 buffer[ADS8688_MAX_CHANNELS +sizeof (s64)/sizeof (u16)]__aligned(8) ; +u16 buffer[ADS8688_MAX_CHANNELS +sizeof (s64)/sizeof (u16)]__aligned(8) = { };int i, j =0 ;for (i =0 ; i < indio_dev->masklength; i++) {
drivers/iio/dummy/iio_simple_dummy_buffer.c +1 -1
@@ -48,7 +48,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)int len =0 ;u16 *data; - data =kmalloc (indio_dev->scan_bytes,GFP_KERNEL ); + data =kzalloc (indio_dev->scan_bytes,GFP_KERNEL );if (!data) goto done;
drivers/iio/gyro/fxas21002c_core.c +8 -1
@@ -730,14 +730,21 @@ static irqreturn_t fxas21002c_trigger_handler(int irq, void *p)int ret;mutex_lock (&data->lock); + ret =fxas21002c_pm_get (data); +if (ret <0 ) + goto out_unlock; + ret =regmap_bulk_read (data->regmap,FXAS21002C_REG_OUT_X_MSB , data->buffer,CHANNEL_SCAN_MAX *sizeof (s16));if (ret <0 ) - goto out_unlock; + goto out_pm_put;iio_push_to_buffers_with_timestamp (indio_dev, data->buffer, data->timestamp); +out_pm_put: +fxas21002c_pm_put (data); + out_unlock:mutex_unlock (&data->lock);
drivers/iio/imu/inv_icm42600/inv_icm42600.h +1 -0
@@ -360,6 +360,7 @@ struct inv_icm42600_state {typedef int (*inv_icm42600_bus_setup )(struct inv_icm42600_state *);extern const struct regmap_config inv_icm42600_regmap_config; +extern const struct regmap_config inv_icm42600_spi_regmap_config;extern const struct dev_pm_ops inv_icm42600_pm_ops; const struct iio_mount_matrix *
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c +17 -1
@@ -43,6 +43,17 @@ const struct regmap_config inv_icm42600_regmap_config = { };EXPORT_SYMBOL_GPL (inv_icm42600_regmap_config); +/* define specific regmap for SPI not supporting burst write */ +const struct regmap_config inv_icm42600_spi_regmap_config = { + .reg_bits =8 , + .val_bits =8 , + .max_register =0x4FFF , + .ranges = inv_icm42600_regmap_ranges, + .num_ranges =ARRAY_SIZE (inv_icm42600_regmap_ranges), + .use_single_write = true, +}; +EXPORT_SYMBOL_GPL (inv_icm42600_spi_regmap_config); +struct inv_icm42600_hw {uint8_t whoami;const char *name;
@@ -709,6 +720,8 @@ static int __maybe_unused inv_icm42600_suspend(struct device *dev)static int __maybe_unused inv_icm42600_resume (struct device *dev) {struct inv_icm42600_state *st =dev_get_drvdata (dev); +struct inv_icm42600_timestamp *gyro_ts =iio_priv (st->indio_gyro); +struct inv_icm42600_timestamp *accel_ts =iio_priv (st->indio_accel);int ret;mutex_lock (&st->lock);
@@ -729,9 +742,12 @@ static int __maybe_unused inv_icm42600_resume(struct device *dev) goto out_unlock;/* restore FIFO data streaming */ -if (st->fifo.on) +if (st->fifo.on) { +inv_icm42600_timestamp_reset (gyro_ts); +inv_icm42600_timestamp_reset (accel_ts); ret =regmap_write (st->map,INV_ICM42600_REG_FIFO_CONFIG ,INV_ICM42600_FIFO_CONFIG_STREAM ); + } out_unlock:mutex_unlock (&st->lock);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +2 -1
@@ -59,7 +59,8 @@ static int inv_icm42600_probe(struct spi_device *spi)return -EINVAL ; chip = (enum inv_icm42600_chip )match; - regmap =devm_regmap_init_spi (spi, &inv_icm42600_regmap_config); +/* use SPI specific regmap */ + regmap =devm_regmap_init_spi (spi, &inv_icm42600_spi_regmap_config);if (IS_ERR (regmap))return PTR_ERR (regmap);
drivers/iio/imu/kmx61.c +1 -1
@@ -1192,7 +1192,7 @@ static irqreturn_t kmx61_trigger_handler(int irq, void *p)struct kmx61_data *data =kmx61_get_data (indio_dev);int bit, ret, i =0 ;u8 base; -s16 buffer[8 ]; +s16 buffer[8 ] = { };if (indio_dev == data->acc_indio_dev) base =KMX61_ACC_XOUT_L ;
drivers/iio/inkern.c +1 -1
@@ -469,7 +469,7 @@ struct iio_channel *iio_channel_get_all(struct device *dev)return chans; error_free_chans: -for (i =0 ; i < nummaps; i++) +for (i =0 ; i < mapind; i++)iio_device_put (chans[i].indio_dev);kfree (chans); error_ret:
drivers/iio/light/vcnl4035.c +1 -1
@@ -105,7 +105,7 @@ static irqreturn_t vcnl4035_trigger_consumer_handler(int irq, void *p)struct iio_dev *indio_dev = pf->indio_dev;struct vcnl4035_data *data =iio_priv (indio_dev);/* Ensure naturally aligned timestamp */ -u8 buffer[ALIGN (sizeof (u16),sizeof (s64)) +sizeof (s64)]__aligned(8) ; +u8 buffer[ALIGN (sizeof (u16),sizeof (s64)) +sizeof (s64)]__aligned(8) = { };int ret; ret =regmap_read (data->regmap,VCNL4035_ALS_DATA , (int *)buffer);
drivers/iio/pressure/zpa2326.c +2 -0
@@ -586,6 +586,8 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev, } sample;int err; +memset (&sample,0 ,sizeof (sample)); +if (test_bit (0 , indio_dev->active_scan_mask)) {/* Get current pressure from hardware FIFO. */ err =zpa2326_dequeue_pressure (indio_dev, &sample.pressure);
drivers/irqchip/irq-gic-v3.c +1 -1
@@ -1340,7 +1340,7 @@ static int gic_retrigger(struct irq_data *data)static int gic_cpu_pm_notifier (struct notifier_block *self,unsigned long cmd,void *v) { -if (cmd ==CPU_PM_EXIT ) { +if (cmd ==CPU_PM_EXIT || cmd ==CPU_PM_ENTER_FAILED ) {if (gic_dist_security_disabled ())gic_enable_redist (true);gic_cpu_sys_reg_init ();
drivers/md/dm-ebs-target.c +1 -1
@@ -440,7 +440,7 @@ static int ebs_iterate_devices(struct dm_target *ti,static struct target_type ebs_target = { .name ="ebs" , .version = {1 ,0 ,1 }, - .features =DM_TARGET_PASSES_INTEGRITY , + .features =0 , .module =THIS_MODULE , .ctr = ebs_ctr, .dtr = ebs_dtr,
drivers/md/dm-thin.c +2 -3
@@ -2317,10 +2317,9 @@ static struct thin_c *get_first_thin(struct pool *pool)struct thin_c *tc =NULL ;rcu_read_lock (); -if (!list_empty (&pool->active_thins)) { - tc = list_entry_rcu(pool->active_thins.next, struct thin_c, list); + tc = list_first_or_null_rcu(&pool->active_thins, struct thin_c, list); +if (tc)thin_get (tc); - }rcu_read_unlock ();return tc;
drivers/md/persistent-data/dm-array.c +12 -7
@@ -911,23 +911,27 @@ static int load_ablock(struct dm_array_cursor *c)if (c->block)unlock_ablock (c->info, c->block); - c->block =NULL ; - c->ab =NULL ; c->index =0 ; r =dm_btree_cursor_get_value (&c->cursor, &key, &value_le);if (r) {DMERR ("dm_btree_cursor_get_value failed" ); -dm_btree_cursor_end (&c->cursor); + goto out; }else { r =get_ablock (c->info,le64_to_cpu (value_le), &c->block, &c->ab);if (r) {DMERR ("get_ablock failed" ); -dm_btree_cursor_end (&c->cursor); + goto out; } } +return 0 ; + +out: +dm_btree_cursor_end (&c->cursor); + c->block =NULL ; + c->ab =NULL ;return r; }
@@ -950,10 +954,10 @@ EXPORT_SYMBOL_GPL(dm_array_cursor_begin);void dm_array_cursor_end (struct dm_array_cursor *c) { -if (c->block) { +if (c->block)unlock_ablock (c->info, c->block); -dm_btree_cursor_end (&c->cursor); - } + +dm_btree_cursor_end (&c->cursor); }EXPORT_SYMBOL_GPL (dm_array_cursor_end);
@@ -993,6 +997,7 @@ int dm_array_cursor_skip(struct dm_array_cursor *c, uint32_t count) } count -= remaining; + c->index += (remaining -1 ); r =dm_array_cursor_next (c); }while (!r);
drivers/md/raid5.c +8 -6
@@ -2349,7 +2349,7 @@ static int grow_one_stripe(struct r5conf *conf, gfp_t gfp)atomic_inc (&conf->active_stripes);raid5_release_stripe (sh); - conf->max_nr_stripes++; +WRITE_ONCE (conf->max_nr_stripes, conf->max_nr_stripes +1 );return 1 ; }
@@ -2646,7 +2646,7 @@ static int drop_one_stripe(struct r5conf *conf)shrink_buffers (sh);free_stripe (conf->slab_cache, sh);atomic_dec (&conf->active_stripes); - conf->max_nr_stripes--; +WRITE_ONCE (conf->max_nr_stripes, conf->max_nr_stripes -1 );return 1 ; }
@@ -6577,7 +6577,7 @@ raid5_set_cache_size(struct mddev *mddev, int size)if (size <=16 || size >32768 )return -EINVAL ; - conf->min_nr_stripes = size; +WRITE_ONCE (conf->min_nr_stripes, size);mutex_lock (&conf->cache_size_mutex);while (size < conf->max_nr_stripes &&drop_one_stripe (conf))
@@ -6589,7 +6589,7 @@ raid5_set_cache_size(struct mddev *mddev, int size)mutex_lock (&conf->cache_size_mutex);while (size > conf->max_nr_stripes)if (!grow_one_stripe (conf,GFP_KERNEL )) { - conf->min_nr_stripes = conf->max_nr_stripes; +WRITE_ONCE (conf->min_nr_stripes, conf->max_nr_stripes); result = -ENOMEM ;break ; }
@@ -7153,11 +7153,13 @@ static unsigned long raid5_cache_count(struct shrinker *shrink, struct shrink_control *sc) { struct r5conf *conf = container_of(shrink, struct r5conf, shrinker); +int max_stripes =READ_ONCE (conf->max_nr_stripes); +int min_stripes =READ_ONCE (conf->min_nr_stripes); -if (conf->max_nr_stripes < conf->min_nr_stripes) +if (max_stripes < min_stripes)/* unlikely, but not impossible */ return 0 ; -return conf->max_nr_stripes - conf->min_nr_stripes; +return max_stripes - min_stripes; }static struct r5conf *setup_conf (struct mddev *mddev)
drivers/mtd/spi-nor/core.c +1 -1
@@ -89,7 +89,7 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor, op->addr.buswidth =spi_nor_get_protocol_addr_nbits (proto);if (op->dummy.nbytes) - op->dummy.buswidth =spi_nor_get_protocol_data_nbits (proto); + op->dummy.buswidth =spi_nor_get_protocol_addr_nbits (proto);if (op->data.nbytes) op->data.buswidth =spi_nor_get_protocol_data_nbits (proto);
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +2 -17
@@ -856,7 +856,6 @@ static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)static bool xgbe_phy_finisar_phy_quirks (struct xgbe_prv_data *pdata) { -__ETHTOOL_DECLARE_LINK_MODE_MASK (supported) = {0 , };struct xgbe_phy_data *phy_data = pdata->phy_data;unsigned int phy_id = phy_data->phydev->phy_id;
@@ -878,14 +877,7 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)phy_write (phy_data->phydev,0x04 ,0x0d01 );phy_write (phy_data->phydev,0x00 ,0x9140 ); -linkmode_set_bit_array (phy_10_100_features_array, -ARRAY_SIZE (phy_10_100_features_array), - supported); -linkmode_set_bit_array (phy_gbit_features_array, -ARRAY_SIZE (phy_gbit_features_array), - supported); - -linkmode_copy (phy_data->phydev->supported, supported); +linkmode_copy (phy_data->phydev->supported,PHY_GBIT_FEATURES );phy_support_asym_pause (phy_data->phydev);
@@ -897,7 +889,6 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)static bool xgbe_phy_belfuse_phy_quirks (struct xgbe_prv_data *pdata) { -__ETHTOOL_DECLARE_LINK_MODE_MASK (supported) = {0 , };struct xgbe_phy_data *phy_data = pdata->phy_data;struct xgbe_sfp_eeprom *sfp_eeprom = &phy_data->sfp_eeprom;unsigned int phy_id = phy_data->phydev->phy_id;
@@ -961,13 +952,7 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata) reg =phy_read (phy_data->phydev,0x00 );phy_write (phy_data->phydev,0x00 , reg & ~0x00800 ); -linkmode_set_bit_array (phy_10_100_features_array, -ARRAY_SIZE (phy_10_100_features_array), - supported); -linkmode_set_bit_array (phy_gbit_features_array, -ARRAY_SIZE (phy_gbit_features_array), - supported); -linkmode_copy (phy_data->phydev->supported, supported); +linkmode_copy (phy_data->phydev->supported,PHY_GBIT_FEATURES );phy_support_asym_pause (phy_data->phydev); netif_dbg(pdata, drv, pdata->netdev,
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +2 -1
@@ -252,7 +252,7 @@ static int bnxt_send_msg(struct bnxt_en_dev *edev, int ulp_id, rc =hwrm_req_replace (bp, req, fw_msg->msg, fw_msg->msg_len);if (rc) -return rc; + goto drop_req;hwrm_req_timeout (bp, req, fw_msg->timeout); resp =hwrm_req_hold (bp, req);
@@ -264,6 +264,7 @@ static int bnxt_send_msg(struct bnxt_en_dev *edev, int ulp_id,memcpy (fw_msg->resp, resp, resp_len); } +drop_req:hwrm_req_drop (bp, req);return rc; }
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +4 -1
@@ -1800,7 +1800,10 @@ void cxgb4_remove_tid(struct tid_info *t, unsigned int chan, unsigned int tid, struct adapter *adap = container_of(t, struct adapter, tids);struct sk_buff *skb; -WARN_ON (tid_out_of_range (&adap->tids, tid)); +if (tid_out_of_range (&adap->tids, tid)) { +dev_err (adap->pdev_dev,"tid %d out of range\n" , tid); +return ; + }if (t->tid_tab[tid - adap->tids.tid_base]) { t->tid_tab[tid - adap->tids.tid_base] =NULL ;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +77 -18
148 lines not on this page · raw message
drivers/net/ethernet/netronome/nfp/bpf/offload.c +2 -1
@@ -458,7 +458,8 @@ int nfp_bpf_event_output(struct nfp_app_bpf *bpf, const void *data, map_id_full =be64_to_cpu (cbe->map_ptr); map_id = map_id_full; -if (len <sizeof (struct cmsg_bpf_event ) + pkt_size + data_size) +if (size_add (pkt_size, data_size) >INT_MAX || + len <sizeof (struct cmsg_bpf_event ) + pkt_size + data_size)return -EINVAL ;if (cbe->hdr.ver !=NFP_CCM_ABI_VERSION )return -EINVAL ;
drivers/net/ethernet/ti/cpsw_ale.c +7 -7
@@ -104,15 +104,15 @@ struct cpsw_ale_dev_id {static inline int cpsw_ale_get_field (u32 *ale_entry,u32 start,u32 bits) { -int idx, idx2; +int idx, idx2, index;u32 hi_val =0 ; idx = start /32 ; idx2 = (start + bits -1 ) /32 ;/* Check if bits to be fetched exceed a word */ if (idx != idx2) { - idx2 =2 - idx2;/* flip */ - hi_val = ale_entry[idx2] << ((idx2 *32 ) - start); + index =2 - idx2;/* flip */ + hi_val = ale_entry[index] << ((idx2 *32 ) - start); } start -= idx *32 ; idx =2 - idx;/* flip */
@@ -122,16 +122,16 @@ static inline int cpsw_ale_get_field(u32 *ale_entry, u32 start, u32 bits)static inline void cpsw_ale_set_field (u32 *ale_entry,u32 start,u32 bits,u32 value) { -int idx, idx2; +int idx, idx2, index; value &=BITMASK (bits); idx = start /32 ; idx2 = (start + bits -1 ) /32 ;/* Check if bits to be set exceed a word */ if (idx != idx2) { - idx2 =2 - idx2;/* flip */ - ale_entry[idx2] &= ~(BITMASK (bits + start - (idx2 *32 ))); - ale_entry[idx2] |= (value >> ((idx2 *32 ) - start)); + index =2 - idx2;/* flip */ + ale_entry[index] &= ~(BITMASK (bits + start - (idx2 *32 ))); + ale_entry[index] |= (value >> ((idx2 *32 ) - start)); } start -= idx *32 ; idx =2 - idx;/* flip */
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +6 -0
@@ -1584,6 +1584,12 @@ axienet_ethtools_set_coalesce(struct net_device *ndev,return -EFAULT ; } +if (ecoalesce->rx_max_coalesced_frames >255 || + ecoalesce->tx_max_coalesced_frames >255 ) { +NL_SET_ERR_MSG (extack,"frames must be less than 256" ); +return -EINVAL ; + } +if (ecoalesce->rx_max_coalesced_frames) lp->coalesce_count_rx = ecoalesce->rx_max_coalesced_frames;if (ecoalesce->rx_coalesce_usecs)
drivers/net/gtp.c +25 -17
79 lines not on this page · raw message
drivers/net/ieee802154/ca8210.c +5 -1
@@ -3125,7 +3125,11 @@ static int ca8210_probe(struct spi_device *spi_device)spi_set_drvdata (priv->spi, priv);if (IS_ENABLED (CONFIG_IEEE802154_CA8210_DEBUGFS )) { cascoda_api_upstream = ca8210_test_int_driver_write; -ca8210_test_interface_init (priv); + ret =ca8210_test_interface_init (priv); +if (ret) { +dev_crit (&spi_device->dev,"ca8210_test_interface_init failed\n" ); + goto error; + } }else { cascoda_api_upstream =NULL ; }
drivers/nvme/target/io-cmd-bdev.c +1 -1
@@ -36,7 +36,7 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id)*/ id->nsfeat |=1 <<4 ;/* NPWG = Namespace Preferred Write Granularity. 0's based */ - id->npwg = lpp0b; + id->npwg =to0based (bdev_io_min (bdev) /bdev_logical_block_size (bdev));/* NPWA = Namespace Preferred Write Alignment. 0's based */ id->npwa = id->npwg;/* NPDG = Namespace Preferred Deallocate Granularity. 0's based */
drivers/of/address.c +56 -20
143 lines not on this page · raw message
drivers/of/unittest-data/tests-address.dtsi +8 -1
@@ -14,7 +14,7 @@ address-tests { #size-cells = <1>; /* ranges here is to make sure we don't use it for * dma-ranges translation */ - ranges = <0x70000000 0x70000000 0x40000000>, + ranges = <0x70000000 0x70000000 0x50000000>, <0x00000000 0xd0000000 0x20000000>; dma-ranges = <0x0 0x20000000 0x40000000>;
@@ -43,6 +43,13 @@ pci@90000000 { <0x42000000 0x0 0xc0000000 0x20000000 0x0 0x10000000>; }; + bus@a0000000 { + #address-cells = <3>; + #size-cells = <2>; + ranges = <0xf00baa 0x0 0x0 0xa0000000 0x0 0x100000>, + <0xf00bee 0x1 0x0 0xb0000000 0x0 0x200000>; + }; + }; }; };
drivers/of/unittest.c +109 -0
121 lines not on this page · raw message
drivers/pci/controller/pci-host-common.c +4 -0
@@ -73,6 +73,10 @@ int pci_host_common_probe(struct platform_device *pdev)if (IS_ERR (cfg))return PTR_ERR (cfg); +/* Do not reassign resources if probe only */ +if (!pci_has_flag (PCI_PROBE_ONLY )) +pci_add_flags (PCI_REASSIGN_ALL_BUS ); + bridge->sysdata = cfg; bridge->ops = (struct pci_ops *)&ops->pci_ops; bridge->msi_domain = true;
drivers/pci/probe.c +11 -9
@@ -3048,18 +3048,20 @@ int pci_host_probe(struct pci_host_bridge *bridge) bus = bridge->bus; -/* If we must preserve the resource configuration, claim now */ -if (bridge->preserve_config) -pci_bus_claim_resources (bus); -/* -* Assign whatever was left unassigned. If we didn't claim above, -* this will reassign everything. +* We insert PCI resources into the iomem_resource and +* ioport_resource trees in either pci_bus_claim_resources() +* or pci_bus_assign_resources(). */ -pci_assign_unassigned_root_bus_resources (bus); +if (pci_has_flag (PCI_PROBE_ONLY )) { +pci_bus_claim_resources (bus); + }else { +pci_bus_size_bridges (bus); +pci_bus_assign_resources (bus); -list_for_each_entry (child, &bus->children, node) -pcie_bus_configure_settings (child); +list_for_each_entry (child, &bus->children, node) +pcie_bus_configure_settings (child); + }pci_bus_add_devices (bus);return 0 ;
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c +43 -10
99 lines not on this page · raw message
drivers/phy/broadcom/phy-brcm-usb-init.h +0 -1
@@ -61,7 +61,6 @@ struct brcm_usb_init_params {const struct brcm_usb_init_ops *ops;struct regmap *syscon_piarbctl;bool wake_enabled; -bool suspend_with_clocks; };void brcm_usb_dvr_init_4908 (struct brcm_usb_init_params *params);
drivers/phy/broadcom/phy-brcm-usb.c +5 -3
@@ -598,7 +598,7 @@ static int brcm_usb_phy_suspend(struct device *dev)* and newer XHCI->2.0-clks/3.0-clks. */ -if (!priv->ini.suspend_with_clocks) { +if (!priv->ini.wake_enabled) {if (priv->phys[BRCM_USB_PHY_3_0 ].inited)clk_disable_unprepare (priv->usb_30_clk); if (priv->phys[BRCM_USB_PHY_2_0].inited ||
@@ -615,8 +615,10 @@ static int brcm_usb_phy_resume(struct device *dev) {struct brcm_usb_phy_data *priv =dev_get_drvdata (dev); -clk_prepare_enable (priv->usb_20_clk); -clk_prepare_enable (priv->usb_30_clk); +if (!priv->ini.wake_enabled) { +clk_prepare_enable (priv->usb_20_clk); +clk_prepare_enable (priv->usb_30_clk); + }brcm_usb_init_ipp (&priv->ini);/*
drivers/scsi/sg.c +1 -1
@@ -391,7 +391,6 @@ sg_release(struct inode *inode, struct file *filp)mutex_lock (&sdp->open_rel_lock);scsi_autopm_put_device (sdp->device); -kref_put (&sfp->f_ref, sg_remove_sfp); sdp->open_cnt--;/* possibly many open()s waiting on exlude clearing, start many;
@@ -403,6 +402,7 @@ sg_release(struct inode *inode, struct file *filp)wake_up_interruptible (&sdp->open_wait); }mutex_unlock (&sdp->open_rel_lock); +kref_put (&sfp->f_ref, sg_remove_sfp);return 0 ; }
drivers/staging/iio/frequency/ad9832.c +1 -1
@@ -158,7 +158,7 @@ static int ad9832_write_frequency(struct ad9832_state *st,static int ad9832_write_phase (struct ad9832_state *st,unsigned long addr,unsigned long phase) { -if (phase >BIT (AD9832_PHASE_BITS )) +if (phase >=BIT (AD9832_PHASE_BITS ))return -EINVAL ; st->phase_data[0] = cpu_to_be16((AD9832_CMD_PHA8BITSW << CMD_SHIFT) |
drivers/staging/iio/frequency/ad9834.c +1 -1
@@ -131,7 +131,7 @@ static int ad9834_write_frequency(struct ad9834_state *st,static int ad9834_write_phase (struct ad9834_state *st,unsigned long addr,unsigned long phase) { -if (phase >BIT (AD9834_PHASE_BITS )) +if (phase >=BIT (AD9834_PHASE_BITS ))return -EINVAL ; st->data =cpu_to_be16 (addr | phase);
drivers/usb/class/usblp.c +4 -3
@@ -1337,11 +1337,12 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol)if (protocol <USBLP_FIRST_PROTOCOL || protocol >USBLP_LAST_PROTOCOL )return -EINVAL ; + alts = usblp->protocol[protocol].alt_setting; +if (alts <0 ) +return -EINVAL ; +/* Don't unnecessarily set the interface if there's a single alt. */ if (usblp->intf->num_altsetting >1 ) { - alts = usblp->protocol[protocol].alt_setting; -if (alts <0 ) -return -EINVAL ; r =usb_set_interface (usblp->dev, usblp->ifnum, alts);if (r <0 ) { printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",
drivers/usb/core/hub.c +4 -2
@@ -2605,13 +2605,13 @@ int usb_new_device(struct usb_device *udev) err =sysfs_create_link (&udev->dev.kobj, &port_dev->dev.kobj,"port" );if (err) - goto fail; + goto out_del_dev; err =sysfs_create_link (&port_dev->dev.kobj, &udev->dev.kobj,"device" );if (err) {sysfs_remove_link (&udev->dev.kobj,"port" ); - goto fail; + goto out_del_dev; }if (!test_and_set_bit (port1, hub->child_usage_bits))
@@ -2623,6 +2623,8 @@ int usb_new_device(struct usb_device *udev)pm_runtime_put_sync_autosuspend (&udev->dev);return err; +out_del_dev: +device_del (&udev->dev); fail:usb_set_device_state (udev,USB_STATE_NOTATTACHED );pm_runtime_disable (&udev->dev);
drivers/usb/core/port.c +4 -3
@@ -294,10 +294,11 @@ static int usb_port_runtime_suspend(struct device *dev)static void usb_port_shutdown (struct device *dev) {struct usb_port *port_dev =to_usb_port (dev); +struct usb_device *udev = port_dev->child; -if (port_dev->child) { -usb_disable_usb2_hardware_lpm (port_dev->child); -usb_unlocked_disable_lpm (port_dev->child); +if (udev && !udev->port_is_suspended) { +usb_disable_usb2_hardware_lpm (udev); +usb_unlocked_disable_lpm (udev); } }
drivers/usb/dwc3/core.h +1 -0
@@ -430,6 +430,7 @@#define DWC3_DCTL_TRGTULST_SS_INACT (DWC3_DCTL_TRGTULST(6))/* These apply for core versions 1.94a and later */ +#define DWC3_DCTL_NYET_THRES_MASK (0xf << 20)#define DWC3_DCTL_NYET_THRES (n) (((n) & 0xf) << 20)#define DWC3_DCTL_KEEP_CONNECT BIT(19)
drivers/usb/dwc3/gadget.c +3 -1
@@ -4004,8 +4004,10 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) WARN_ONCE(DWC3_VER_IS_PRIOR(DWC3, 240A) && dwc->has_lpm_erratum,"LPM Erratum not available on dwc3 revisions < 2.40a\n" ); - if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A)) + if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A)) { + reg &= ~DWC3_DCTL_NYET_THRES_MASK ; reg |=DWC3_DCTL_NYET_THRES (dwc->lpm_nyet_threshold); + }dwc3_gadget_dctl_write_safe (dwc, reg); }else {
drivers/usb/gadget/function/f_fs.c +1 -1
@@ -1868,7 +1868,7 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)ENTER (); -if (WARN_ON (ffs->state !=FFS_ACTIVE +if ((ffs->state !=FFS_ACTIVE ||test_and_set_bit (FFS_FL_BOUND , &ffs->flags)))return -EBADFD ;
drivers/usb/gadget/function/f_uac2.c +1 -0
@@ -1103,6 +1103,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) uac2->as_in_alt =0 ; } + std_ac_if_desc.bNumEndpoints =0 ;if (FUOUT_EN (uac2_opts) ||FUIN_EN (uac2_opts)) { uac2->int_ep =usb_ep_autoconfig (gadget, &fs_ep_int_desc);if (!uac2->int_ep) {
drivers/usb/gadget/function/u_serial.c +4 -4
@@ -1393,6 +1393,10 @@ void gserial_disconnect(struct gserial *gser)/* REVISIT as above: how best to track this? */ port->port_line_coding = gser->port_line_coding; +/* disable endpoints, aborting down any active I/O */ +usb_ep_disable (gser->out); +usb_ep_disable (gser->in); + port->port_usb =NULL ; gser->ioport =NULL ;if (port->port.count >0 ) {
@@ -1404,10 +1408,6 @@ void gserial_disconnect(struct gserial *gser)spin_unlock (&port->port_lock);spin_unlock_irqrestore (&serial_port_lock, flags); -/* disable endpoints, aborting down any active I/O */ -usb_ep_disable (gser->out); -usb_ep_disable (gser->in); -/* finally, free any unused/unusable I/O buffers */ spin_lock_irqsave (&port->port_lock, flags);if (port->port.count ==0 )
drivers/usb/host/xhci-pci.c +1 -3
@@ -764,11 +764,9 @@ static struct pci_driver xhci_pci_driver = {/* suspend and resume implemented later */ .shutdown = usb_hcd_pci_shutdown, -#ifdef CONFIG_PM .driver = { - .pm = &usb_hcd_pci_pm_ops + .pm = pm_ptr(&usb_hcd_pci_pm_ops), }, -#endif };static int __init xhci_pci_init (void )
drivers/usb/serial/cp210x.c +1 -0
@@ -223,6 +223,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ + { USB_DEVICE(0x1B93, 0x1013) }, /* Phoenix Contact UPS Device */ { USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */ { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ { USB_DEVICE(0x1D6F, 0x0010) }, /* Seluxit ApS RF Dongle */
drivers/usb/serial/option.c +3 -1
@@ -621,7 +621,7 @@ static void option_instat_callback(struct urb *urb);/* MeiG Smart Technology products */ #define MEIGSMART_VENDOR_ID 0x2dee -/* MeiG Smart SRM825L based on Qualcomm 315 */ +/* MeiG Smart SRM815/SRM825L based on Qualcomm 315 */ #define MEIGSMART_PRODUCT_SRM825L 0x4d22/* MeiG Smart SLM320 based on UNISOC UIS8910 */ #define MEIGSMART_PRODUCT_SLM320 0x4d41
@@ -2405,6 +2405,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM320, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM770A, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x30) }, { USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x60) },
@@ -2412,6 +2413,7 @@ static const struct usb_device_id option_ids[] = { .driver_info = NCTRL(1) }, { USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0640, 0xff), /* TCL IK512 ECM */ .driver_info = NCTRL(3) }, + { USB_DEVICE_INTERFACE_CLASS(0x2949, 0x8700, 0xff) }, /* Neoway N723-EA */ { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
drivers/usb/storage/unusual_devs.h +7 -0
@@ -255,6 +255,13 @@ UNUSUAL_DEV( 0x0421, 0x06aa, 0x1110, 0x1110, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 ), +/* Added by Lubomir Rintel <[email protected]>, a very fine chap */ +UNUSUAL_DEV( 0x0421, 0x06c2, 0x0000, 0x0406, + "Nokia", + "Nokia 208", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_MAX_SECTORS_64 ), +#ifdef NO_SDDR09 UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100, "Microtech",
fs/afs/afs.h +1 -1
@@ -10,7 +10,7 @@#include <linux/in.h> -#define AFS_MAXCELLNAME 256/* Maximum length of a cell name */ +#define AFS_MAXCELLNAME 253/* Maximum length of a cell name (DNS limited) */ #define AFS_MAXVOLNAME 64/* Maximum length of a volume name */ #define AFS_MAXNSERVERS 8/* Maximum servers in a basic volume record */ #define AFS_NMAXNSERVERS 13/* Maximum servers in a N/U-class volume record */
fs/afs/afs_vl.h +1 -0
@@ -13,6 +13,7 @@#define AFS_VL_PORT 7003/* volume location service port */ #define VL_SERVICE 52/* RxRPC service ID for the Volume Location service */ #define YFS_VL_SERVICE 2503/* Service ID for AuriStor upgraded VL service */ +#define YFS_VL_MAXCELLNAME 256/* Maximum length of a cell name in YFS protocol */ enum AFSVL_Operations {VLGETENTRYBYID =503 ,/* AFS Get VLDB entry by ID */
fs/afs/vl_alias.c +6 -2
@@ -302,6 +302,7 @@ static char *afs_vl_get_cell_name(struct afs_cell *cell, struct key *key)static int yfs_check_canonical_cell_name (struct afs_cell *cell,struct key *key) {struct afs_cell *master; +size_t name_len;char *cell_name; cell_name =afs_vl_get_cell_name (cell, key);
@@ -313,8 +314,11 @@ static int yfs_check_canonical_cell_name(struct afs_cell *cell, struct key *key)return 0 ; } - master =afs_lookup_cell (cell->net, cell_name,strlen (cell_name), -NULL , false); + name_len =strlen (cell_name); +if (!name_len || name_len >AFS_MAXCELLNAME ) + master =ERR_PTR (-EOPNOTSUPP ); +else + master =afs_lookup_cell (cell->net, cell_name, name_len,NULL , false);kfree (cell_name);if (IS_ERR (master))return PTR_ERR (master);
fs/afs/vlclient.c +1 -1
@@ -671,7 +671,7 @@ static int afs_deliver_yfsvl_get_cell_name(struct afs_call *call)return ret; namesz =ntohl (call->tmp); -if (namesz >AFS_MAXCELLNAME ) +if (namesz >YFS_VL_MAXCELLNAME )return afs_protocol_error (call, afs_eproto_cellname_len); paddedsz = (namesz +3 ) & ~3 ; call->count = namesz;
fs/ceph/mds_client.c +4 -5
@@ -2432,12 +2432,11 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase,if (pos <0 ) {/* -* A rename didn't occur, but somehow we didn't end up where -* we thought we would. Throw a warning and try again. +* The path is longer than PATH_MAX and this function +* cannot ever succeed. Creating paths that long is +* possible with Ceph, but Linux cannot use them. */ -pr_warn ("build_path did not end path lookup where " -"expected, pos is %d\n" , pos); - goto retry; +return ERR_PTR (-ENAMETOOLONG ); } *pbase = base;
fs/exfat/dir.c +2 -1
@@ -126,7 +126,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent type =exfat_get_entry_type (ep);if (type ==TYPE_UNUSED ) {brelse (bh); -break ; + goto out; }if (type !=TYPE_FILE && type !=TYPE_DIR ) {
@@ -186,6 +186,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent } } +out: dir_entry->namebuf.lfn[0 ] ='\0' ; *cpos =EXFAT_DEN_TO_B (dentry);return 0 ;
fs/exfat/fatent.c +10 -0
@@ -215,6 +215,16 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chainif (err) goto dec_used_clus; + +if (num_clusters >= sbi->num_clusters -EXFAT_FIRST_CLUSTER ) { +/* +* The cluster chain includes a loop, scan the +* bitmap to get the number of used clusters. +*/ +exfat_count_used_clusters (sb, &sbi->used_clusters); + +return 0 ; + } }while (clu !=EXFAT_EOF_CLUSTER ); }
fs/file.c +1 -0
@@ -21,6 +21,7 @@#include <linux/rcupdate.h> #include <linux/close_range.h> #include <net/sock.h> +#include <linux/init_task.h> #include "internal.h"
fs/hfs/super.c +3 -1
@@ -418,11 +418,13 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent) goto bail_no_root; res =hfs_cat_find_brec (sb,HFS_ROOT_CNID , &fd);if (!res) { -if (fd.entrylength >sizeof (rec) || fd.entrylength <0 ) { +if (fd.entrylength !=sizeof (rec.dir)) { res = -EIO ; goto bail_hfs_find; }hfs_bnode_read (fd.bnode, &rec, fd.entryoffset, fd.entrylength); +if (rec.type !=HFS_CDR_DIR ) + res = -EIO ; }if (res) goto bail_hfs_find;
fs/jbd2/commit.c +2 -2
@@ -810,9 +810,9 @@ void jbd2_journal_commit_transaction(journal_t *journal)/* * If the journal is not located on the file system device, * then we must flush the file system device before we issue -* the commit record +* the commit record and update the journal tail sequence. */ -if (commit_transaction->t_need_data_flush && +if ((commit_transaction->t_need_data_flush || update_tail) && (journal->j_fs_dev != journal->j_dev) && (journal->j_flags &JBD2_BARRIER ))blkdev_issue_flush (journal->j_fs_dev);
fs/ksmbd/smb2pdu.c +3 -0
@@ -714,6 +714,9 @@ void smb2_send_interim_resp(struct ksmbd_work *work, __le32 status)struct smb2_hdr *rsp_hdr;struct ksmbd_work *in_work =ksmbd_alloc_work_struct (); +if (!in_work) +return ; +if (allocate_interim_rsp_buf (in_work)) {pr_err ("smb_allocate_rsp_buf failed!\n" );ksmbd_free_work_struct (in_work);
fs/nfsd/filecache.c +10 -8
@@ -218,6 +218,7 @@ nfsd_file_alloc(struct net *net, struct inode *inode, unsigned char need,return NULL ;INIT_LIST_HEAD (&nf->nf_lru); +INIT_LIST_HEAD (&nf->nf_gc); nf->nf_birthtime =ktime_get (); nf->nf_file =NULL ; nf->nf_cred =get_current_cred ();
@@ -395,8 +396,8 @@ nfsd_file_dispose_list(struct list_head *dispose)struct nfsd_file *nf;while (!list_empty (dispose)) { - nf = list_first_entry(dispose, struct nfsd_file, nf_lru); -list_del_init (&nf->nf_lru); + nf = list_first_entry(dispose, struct nfsd_file, nf_gc); +list_del_init (&nf->nf_gc);nfsd_file_free (nf); } }
@@ -413,12 +414,12 @@ nfsd_file_dispose_list_delayed(struct list_head *dispose) {while (!list_empty (dispose)) {struct nfsd_file *nf =list_first_entry (dispose, - struct nfsd_file, nf_lru); + struct nfsd_file, nf_gc);struct nfsd_net *nn =net_generic (nf->nf_net, nfsd_net_id);struct nfsd_fcache_disposal *l = nn->fcache_disposal;spin_lock (&l->lock); -list_move_tail (&nf->nf_lru, &l->freeme); +list_move_tail (&nf->nf_gc, &l->freeme);spin_unlock (&l->lock);queue_work (nfsd_filecache_wq, &l->work); }
@@ -475,7 +476,8 @@ nfsd_file_lru_cb(struct list_head *item, struct list_lru_one *lru,/* Refcount went to zero. Unhash it and queue it to the dispose list */ nfsd_file_unhash (nf); -list_lru_isolate_move (lru, &nf->nf_lru, head); +list_lru_isolate (lru, &nf->nf_lru); +list_add (&nf->nf_gc, head);this_cpu_inc (nfsd_file_evictions);trace_nfsd_file_gc_disposed (nf);return LRU_REMOVED ;
@@ -554,7 +556,7 @@ nfsd_file_cond_queue(struct nfsd_file *nf, struct list_head *dispose)/* If refcount goes to 0, then put on the dispose list */ if (refcount_sub_and_test (decrement, &nf->nf_ref)) { -list_add (&nf->nf_lru, dispose); +list_add (&nf->nf_gc, dispose);trace_nfsd_file_closing (nf); } }
@@ -630,8 +632,8 @@ nfsd_file_close_inode_sync(struct inode *inode)nfsd_file_queue_for_close (inode, &dispose);while (!list_empty (&dispose)) { - nf = list_first_entry(&dispose, struct nfsd_file, nf_lru); -list_del_init (&nf->nf_lru); + nf = list_first_entry(&dispose, struct nfsd_file, nf_gc); +list_del_init (&nf->nf_gc);nfsd_file_free (nf); }flush_delayed_fput ();
fs/nfsd/filecache.h +1 -0
@@ -44,6 +44,7 @@ struct nfsd_file {struct nfsd_file_mark *nf_mark;struct list_head nf_lru; +struct list_head nf_gc;struct rcu_head nf_rcu;ktime_t nf_birthtime; };
fs/ocfs2/quota_global.c +1 -1
@@ -881,7 +881,7 @@ static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)int status =0 ;trace_ocfs2_get_next_id (from_kqid (&init_user_ns, *qid), type); -if (!sb_has_quota_loaded (sb, type)) { +if (!sb_has_quota_active (sb, type)) { status = -ESRCH ; goto out; }
fs/ocfs2/quota_local.c +4 -6
@@ -815,7 +815,7 @@ static int ocfs2_local_free_info(struct super_block *sb, int type)struct ocfs2_quota_chunk *chunk;struct ocfs2_local_disk_chunk *dchunk;int mark_clean =1 , len; -int status; +int status =0 ;iput (oinfo->dqi_gqinode);ocfs2_simple_drop_lockres (OCFS2_SB (sb), &oinfo->dqi_gqlock);
@@ -857,17 +857,15 @@ static int ocfs2_local_free_info(struct super_block *sb, int type) oinfo->dqi_libh, olq_update_info, info); -if (status <0 ) { +if (status <0 )mlog_errno (status); - goto out; - } - out:ocfs2_inode_unlock (sb_dqopt (sb)->files[type],1 );brelse (oinfo->dqi_libh);brelse (oinfo->dqi_lqi_bh);kfree (oinfo); -return 0 ; + info->dqi_priv =NULL ; +return status; }static void olq_set_dquot (struct buffer_head *bh,void *private)
fs/proc/vmcore.c +2 -0
@@ -396,6 +396,8 @@ static ssize_t __read_vmcore(char *buffer, size_t buflen, loff_t *fpos,if (buflen ==0 )return acc; } + +cond_resched (); }return acc;
include/linux/blk-cgroup.h +5 -1
@@ -433,10 +433,14 @@ static inline void blkcg_pin_online(struct blkcg *blkcg)static inline void blkcg_unpin_online (struct blkcg *blkcg) {do { +struct blkcg *parent; +if (!refcount_dec_and_test (&blkcg->online_pin))break ; + + parent =blkcg_parent (blkcg);blkcg_destroy_blkgs (blkcg); - blkcg =blkcg_parent (blkcg); + blkcg = parent; }while (blkcg); }
include/linux/hrtimer.h +1 -0
@@ -532,6 +532,7 @@ extern void __init hrtimers_init(void);extern void sysrq_timer_list_show (void );int hrtimers_prepare_cpu (unsigned int cpu); +int hrtimers_cpu_starting (unsigned int cpu);#ifdef CONFIG_HOTPLUG_CPU int hrtimers_cpu_dying (unsigned int cpu);#else
include/linux/mlx5/device.h +2 -0
@@ -1462,6 +1462,8 @@ static inline u16 mlx5_to_sw_pkey_sz(int pkey_sz)return MLX5_MIN_PKEY_TABLE_SIZE << pkey_sz; } +#define MLX5_RDMA_RX_NUM_COUNTERS_PRIOS 2 +#define MLX5_RDMA_TX_NUM_COUNTERS_PRIOS 1#define MLX5_BY_PASS_NUM_REGULAR_PRIOS 16#define MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS 16#define MLX5_BY_PASS_NUM_MULTICAST_PRIOS 1
include/linux/mlx5/fs.h +2 -0
@@ -83,6 +83,8 @@ enum mlx5_flow_namespace_type {MLX5_FLOW_NAMESPACE_RDMA_RX ,MLX5_FLOW_NAMESPACE_RDMA_RX_KERNEL ,MLX5_FLOW_NAMESPACE_RDMA_TX , +MLX5_FLOW_NAMESPACE_RDMA_RX_COUNTERS , + MLX5_FLOW_NAMESPACE_RDMA_TX_COUNTERS, }; enum {
include/linux/poll.h +9 -1
@@ -43,8 +43,16 @@ typedef struct poll_table_struct {static inline void poll_wait (struct file * filp,wait_queue_head_t * wait_address,poll_table *p) { -if (p && p->_qproc && wait_address) +if (p && p->_qproc && wait_address) { p->_qproc (filp, wait_address, p); +/* +* This memory barrier is paired in the wq_has_sleeper(). +* See the comment above prepare_to_wait(), we need to +* ensure that subsequent tests in this thread can't be +* reordered with __add_wait_queue() in _qproc() paths. +*/ +smp_mb (); + } }/*
include/linux/usb.h +1 -2
@@ -695,13 +695,12 @@ struct usb_device {unsigned long active_duration; -#ifdef CONFIG_PM unsigned long connect_time; unsigned do_remote_wakeup:1; unsigned reset_resume:1; unsigned port_is_suspended:1; -#endif +struct wusb_dev *wusb_dev;int slot_id;struct usb2_lpm_parameters l1_params;
include/linux/usb/hcd.h +0 -2
@@ -500,9 +500,7 @@ extern void usb_hcd_pci_shutdown(struct pci_dev *dev);extern int usb_hcd_amd_remote_wakeup_quirk (struct pci_dev *dev); -#ifdef CONFIG_PM extern const struct dev_pm_ops usb_hcd_pci_pm_ops; -#endif #endif /* CONFIG_USB_PCI */ /* pci-ish (pdev null is ok) buffer alloc/mapping support */
include/net/inet_connection_sock.h +1 -1
@@ -278,7 +278,7 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk)static inline int inet_csk_reqsk_queue_is_full (const struct sock *sk) { -return inet_csk_reqsk_queue_len (sk) >= sk->sk_max_ack_backlog; +return inet_csk_reqsk_queue_len (sk) >READ_ONCE (sk->sk_max_ack_backlog); }bool inet_csk_reqsk_queue_drop (struct sock *sk,struct request_sock *req);
include/net/net_namespace.h +3 -0
@@ -389,6 +389,9 @@ struct pernet_operations {void (*pre_exit)(struct net *net);void (*exit)(struct net *net);void (*exit_batch)(struct list_head *net_exit_list); +/* Following method is called with RTNL held. */ +void (*exit_batch_rtnl)(struct list_head *net_exit_list, +struct list_head *dev_kill_list);unsigned int *id;size_t size; };
kernel/cpu.c +1 -1
@@ -1766,7 +1766,7 @@ static struct cpuhp_step cpuhp_hp_states[] = { }, [CPUHP_AP_HRTIMERS_DYING] = { .name = "hrtimers:dying", - .startup.single = NULL, + .startup.single = hrtimers_cpu_starting, .teardown.single = hrtimers_cpu_dying, },
kernel/gen_kheaders.sh +1 -0
@@ -82,6 +82,7 @@ find $cpio_dir -type f -print0 | # Create archive and try to normalize metadata for reproducibility. tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \ + --exclude=".__afs*" --exclude=".nfs*" \ --owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \ -I $XZ -cf $tarfile -C $cpio_dir/ . > /dev/null
kernel/time/hrtimer.c +10 -1
@@ -2176,6 +2176,15 @@ int hrtimers_prepare_cpu(unsigned int cpu) } cpu_base->cpu = cpu; +hrtimer_cpu_base_init_expiry_lock (cpu_base); +return 0 ; +} + +int hrtimers_cpu_starting (unsigned int cpu) +{ +struct hrtimer_cpu_base *cpu_base =this_cpu_ptr (&hrtimer_bases); + +/* Clear out any left over state from a CPU down operation */ cpu_base->active_bases =0 ; cpu_base->hres_active =0 ; cpu_base->hang_detected =0 ;
@@ -2184,7 +2193,6 @@ int hrtimers_prepare_cpu(unsigned int cpu) cpu_base->expires_next =KTIME_MAX ; cpu_base->softirq_expires_next =KTIME_MAX ; cpu_base->online =1 ; -hrtimer_cpu_base_init_expiry_lock (cpu_base);return 0 ; }
@@ -2262,6 +2270,7 @@ int hrtimers_cpu_dying(unsigned int dying_cpu)void __init hrtimers_init (void ) {hrtimers_prepare_cpu (smp_processor_id ()); +hrtimers_cpu_starting (smp_processor_id ());open_softirq (HRTIMER_SOFTIRQ , hrtimer_run_softirq); }
mm/filemap.c +1 -1
@@ -2818,7 +2818,7 @@ static inline loff_t page_seek_hole_data(struct xa_state *xas,do {if (ops->is_partially_uptodate (page, offset, bsz) == seek_data)break ; - start = (start + bsz) & ~(bsz -1 ); + start = (start + bsz) & ~((u64 )bsz -1 ); offset += bsz; }while (offset <thp_size (page)); unlock:
net/802/psnap.c +2 -2
@@ -55,11 +55,11 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev, goto drop;rcu_read_lock (); - proto =find_snap_client (skb_transport_header (skb)); + proto =find_snap_client (skb->data);if (proto) {/* Pass the frame on. */ - skb->transport_header +=5 ;skb_pull_rcsum (skb,5 ); +skb_reset_transport_header (skb); rc = proto->rcvfunc (skb, dev, &snap_packet_type, orig_dev); }rcu_read_unlock ();
net/core/filter.c +18 -12
@@ -10509,6 +10509,7 @@ BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,bool is_sockarray = map->map_type ==BPF_MAP_TYPE_REUSEPORT_SOCKARRAY ;struct sock_reuseport *reuse;struct sock *selected_sk; +int err; selected_sk = map->ops->map_lookup_elem (map, key);if (!selected_sk)
@@ -10516,10 +10517,6 @@ BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern, reuse =rcu_dereference (selected_sk->sk_reuseport_cb);if (!reuse) { -/* Lookup in sock_map can return TCP ESTABLISHED sockets. */ -if (sk_is_refcounted (selected_sk)) -sock_put (selected_sk); -/* reuseport_array has only sk with non NULL sk_reuseport_cb. * The only (!reuse) case here is - the sk has already been * unhashed (e.g. by close()), so treat it as -ENOENT.
@@ -10527,24 +10524,33 @@ BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,* Other maps (e.g. sock_map) do not provide this guarantee and * the sk may never be in the reuseport group to begin with. */ -return is_sockarray ? -ENOENT : -EINVAL ; + err = is_sockarray ? -ENOENT : -EINVAL ; + goto error; }if (unlikely (reuse->reuseport_id != reuse_kern->reuseport_id)) {struct sock *sk = reuse_kern->sk; -if (sk->sk_protocol != selected_sk->sk_protocol) -return -EPROTOTYPE ; -else if (sk->sk_family != selected_sk->sk_family) -return -EAFNOSUPPORT ; - -/* Catch all. Likely bound to a different sockaddr. */ -return -EBADFD ; +if (sk->sk_protocol != selected_sk->sk_protocol) { + err = -EPROTOTYPE ; + }else if (sk->sk_family != selected_sk->sk_family) { + err = -EAFNOSUPPORT ; + }else { +/* Catch all. Likely bound to a different sockaddr. */ + err = -EBADFD ; + } + goto error; } reuse_kern->selected_sk = selected_sk;return 0 ; +error: +/* Lookup in sock_map can return TCP ESTABLISHED sockets. */ +if (sk_is_refcounted (selected_sk)) +sock_put (selected_sk); + +return err; }static const struct bpf_func_proto sk_select_reuseport_proto = {
net/core/net_namespace.c +30 -1
@@ -313,8 +313,9 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns) {/* Must be called with pernet_ops_rwsem held */ const struct pernet_operations *ops, *saved_ops; -int error =0 ;LIST_HEAD (net_exit_list); +LIST_HEAD (dev_kill_list); +int error =0 ;refcount_set (&net->ns.count,1 );refcount_set (&net->passive,1 );
@@ -350,6 +351,15 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns)synchronize_rcu (); + ops = saved_ops; +rtnl_lock (); +list_for_each_entry_continue_reverse (ops, &pernet_list, list) { +if (ops->exit_batch_rtnl) + ops->exit_batch_rtnl (&net_exit_list, &dev_kill_list); + } +unregister_netdevice_many (&dev_kill_list); +rtnl_unlock (); + ops = saved_ops;list_for_each_entry_continue_reverse (ops, &pernet_list, list)ops_exit_list (ops, &net_exit_list);
@@ -554,6 +564,7 @@ static void cleanup_net(struct work_struct *work)struct net *net, *tmp, *last;struct llist_node *net_kill_list;LIST_HEAD (net_exit_list); +LIST_HEAD (dev_kill_list);/* Atomically snapshot the list of namespaces to cleanup */ net_kill_list =llist_del_all (&cleanup_list);
@@ -594,6 +605,14 @@ static void cleanup_net(struct work_struct *work)*/ synchronize_rcu (); +rtnl_lock (); +list_for_each_entry_reverse (ops, &pernet_list, list) { +if (ops->exit_batch_rtnl) + ops->exit_batch_rtnl (&net_exit_list, &dev_kill_list); + } +unregister_netdevice_many (&dev_kill_list); +rtnl_unlock (); +/* Run all of the network namespace exit methods */ list_for_each_entry_reverse (ops, &pernet_list, list)ops_exit_list (ops, &net_exit_list);
@@ -1134,7 +1153,17 @@ static void free_exit_list(struct pernet_operations *ops, struct list_head *net_ {ops_pre_exit_list (ops, net_exit_list);synchronize_rcu (); + +if (ops->exit_batch_rtnl) { +LIST_HEAD (dev_kill_list); + +rtnl_lock (); + ops->exit_batch_rtnl (net_exit_list, &dev_kill_list); +unregister_netdevice_many (&dev_kill_list); +rtnl_unlock (); + }ops_exit_list (ops, net_exit_list); +ops_free_list (ops, net_exit_list); }
net/core/pktgen.c +3 -3
@@ -849,6 +849,9 @@ static ssize_t get_imix_entries(const char __user *buffer,unsigned long weight;unsigned long size; +if (pkt_dev->n_imix_entries >=MAX_IMIX_ENTRIES ) +return -E2BIG ; + len =num_arg (&buffer[i], max_digits, &size);if (len <0 )return len;
@@ -878,9 +881,6 @@ static ssize_t get_imix_entries(const char __user *buffer, i++; pkt_dev->n_imix_entries++; - -if (pkt_dev->n_imix_entries >MAX_IMIX_ENTRIES ) -return -E2BIG ; }while (c ==' ' );return i;
net/dccp/ipv6.c +1 -1
@@ -615,7 +615,7 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)by tcp. Feel free to propose better solution. --ANK (980728) */ -if (np->rxopt.all) +if (np->rxopt.all && sk->sk_state !=DCCP_LISTEN ) opt_skb =skb_clone_and_charge_r (skb, sk);if (sk->sk_state ==DCCP_OPEN ) {/* Fast path */
net/ipv6/route.c +1 -1
@@ -176,7 +176,7 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev)struct inet6_dev *rt_idev = rt->rt6i_idev;struct net_device *rt_dev = rt->dst.dev; -if (rt_idev->dev == dev) { +if (rt_idev && rt_idev->dev == dev) { rt->rt6i_idev =in6_dev_get (loopback_dev);in6_dev_put (rt_idev); }
net/ipv6/tcp_ipv6.c +1 -3
@@ -1503,7 +1503,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)by tcp. Feel free to propose better solution. --ANK (980728) */ -if (np->rxopt.all) +if (np->rxopt.all && sk->sk_state !=TCP_LISTEN ) opt_skb =skb_clone_and_charge_r (skb, sk);if (sk->sk_state ==TCP_ESTABLISHED ) {/* Fast path */
@@ -1541,8 +1541,6 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)if (nsk != sk) {if (tcp_child_process (sk, nsk, skb)) goto reset; -if (opt_skb) -__kfree_skb (opt_skb);return 0 ; } }else
net/mac802154/iface.c +4 -0
@@ -688,6 +688,10 @@ void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata)ASSERT_RTNL ();mutex_lock (&sdata->local->iflist_mtx); +if (list_empty (&sdata->local->interfaces)) { +mutex_unlock (&sdata->local->iflist_mtx); +return ; + }list_del_rcu (&sdata->list);mutex_unlock (&sdata->local->iflist_mtx);
net/mptcp/options.c +9 -3
@@ -651,7 +651,6 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff *bool drop_other_suboptions = false;unsigned int opt_size = *size;bool echo; -bool port;int len;/* add addr will strip the existing options, be sure to avoid breaking
@@ -660,12 +659,19 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff *if (!mptcp_pm_should_add_signal (msk) || (opts->suboptions & (OPTION_MPTCP_MPJ_ACK |OPTION_MPTCP_MPC_ACK )) || !mptcp_pm_add_addr_signal (msk, skb, opt_size, remaining, &opts->addr, - &echo, &port, &drop_other_suboptions)) + &echo, &drop_other_suboptions))return false; +/* +* Later on, mptcp_write_options() will enforce mutually exclusion with +* DSS, bail out if such option is set and we can't drop it. +*/ if (drop_other_suboptions) remaining += opt_size; - len =mptcp_add_addr_len (opts->addr.family, echo, port); +else if (opts->suboptions &OPTION_MPTCP_DSS ) +return false; + + len =mptcp_add_addr_len (opts->addr.family, echo, !!opts->addr.port);if (remaining < len)return false;
net/mptcp/pm.c +4 -3
@@ -265,11 +265,12 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 fail_seq)bool mptcp_pm_add_addr_signal (struct mptcp_sock *msk,const struct sk_buff *skb,unsigned int opt_size,unsigned int remaining,struct mptcp_addr_info *addr,bool *echo, -bool *port,bool *drop_other_suboptions) +bool *drop_other_suboptions) {int ret = false;u8 add_addr;u8 family; +bool port;spin_lock_bh (&msk->pm.lock);
@@ -287,10 +288,10 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, const struct sk_buff *skb, } *echo =mptcp_pm_should_add_signal_echo (msk); - *port = !!(*echo ? msk->pm.remote.port : msk->pm.local.port); + port = !!(*echo ? msk->pm.remote.port : msk->pm.local.port); family = *echo ? msk->pm.remote.family : msk->pm.local.family; -if (remaining <mptcp_add_addr_len (family, *echo, *port)) +if (remaining <mptcp_add_addr_len (family, *echo, port)) goto out_unlock;if (*echo) {
net/mptcp/protocol.h +1 -1
@@ -823,7 +823,7 @@ static inline int mptcp_rm_addr_len(const struct mptcp_rm_list *rm_list)bool mptcp_pm_add_addr_signal (struct mptcp_sock *msk,const struct sk_buff *skb,unsigned int opt_size,unsigned int remaining,struct mptcp_addr_info *addr,bool *echo, -bool *port,bool *drop_other_suboptions); +bool *drop_other_suboptions);bool mptcp_pm_rm_addr_signal (struct mptcp_sock *msk,unsigned int remaining,struct mptcp_rm_list *rm_list);int mptcp_pm_get_local_id (struct mptcp_sock *msk,struct sock_common *skc);
net/netfilter/nf_conntrack_core.c +4 -1
@@ -2589,12 +2589,15 @@ void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls)struct hlist_nulls_head *hash;unsigned int nr_slots, i; -if (*sizep > (UINT_MAX /sizeof (struct hlist_nulls_head ))) +if (*sizep > (INT_MAX /sizeof (struct hlist_nulls_head )))return NULL ;BUILD_BUG_ON (sizeof (struct hlist_nulls_head ) !=sizeof (struct hlist_head )); nr_slots = *sizep =roundup (*sizep,PAGE_SIZE /sizeof (struct hlist_nulls_head )); +if (nr_slots > (INT_MAX /sizeof (struct hlist_nulls_head ))) +return NULL ; + hash =kvcalloc (nr_slots,sizeof (struct hlist_nulls_head ),GFP_KERNEL );if (hash && nulls)
net/netfilter/nf_tables_api.c +11 -4
@@ -7794,6 +7794,7 @@ static void nft_unregister_flowtable_hook(struct net *net, }static void __nft_unregister_flowtable_net_hooks (struct net *net, +struct nft_flowtable *flowtable,struct list_head *hook_list,bool release_netdev) {
@@ -7801,6 +7802,8 @@ static void __nft_unregister_flowtable_net_hooks(struct net *net,list_for_each_entry_safe (hook, next, hook_list, list) {nf_unregister_net_hook (net, &hook->ops); + flowtable->data.type->setup (&flowtable->data, hook->ops.dev, +FLOW_BLOCK_UNBIND );if (release_netdev) {list_del (&hook->list);kfree_rcu (hook, rcu);
@@ -7809,9 +7812,10 @@ static void __nft_unregister_flowtable_net_hooks(struct net *net, }static void nft_unregister_flowtable_net_hooks (struct net *net, +struct nft_flowtable *flowtable,struct list_head *hook_list) { -__nft_unregister_flowtable_net_hooks (net, hook_list, false); +__nft_unregister_flowtable_net_hooks (net, flowtable, hook_list, false); } static int nft_register_flowtable_net_hooks(struct net *net,
@@ -8433,8 +8437,6 @@ static void nf_tables_flowtable_destroy(struct nft_flowtable *flowtable) flowtable->data.type->free (&flowtable->data);list_for_each_entry_safe (hook, next, &flowtable->hook_list, list) { - flowtable->data.type->setup (&flowtable->data, hook->ops.dev, -FLOW_BLOCK_UNBIND );list_del_rcu (&hook->list);kfree_rcu (hook, rcu); }
@@ -9668,6 +9670,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) &nft_trans_flowtable_hooks (trans), NFT_MSG_DELFLOWTABLE);nft_unregister_flowtable_net_hooks (net, +nft_trans_flowtable (trans), &nft_trans_flowtable_hooks (trans)); }else {list_del_rcu (&nft_trans_flowtable (trans)->list);
@@ -9676,6 +9679,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) &nft_trans_flowtable (trans)->hook_list, NFT_MSG_DELFLOWTABLE);nft_unregister_flowtable_net_hooks (net, +nft_trans_flowtable (trans), &nft_trans_flowtable (trans)->hook_list); }break ;
@@ -9906,11 +9910,13 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)case NFT_MSG_NEWFLOWTABLE :if (nft_trans_flowtable_update (trans)) {nft_unregister_flowtable_net_hooks (net, +nft_trans_flowtable (trans), &nft_trans_flowtable_hooks (trans)); }else {nft_use_dec_restore (&trans->ctx.table->use);list_del_rcu (&nft_trans_flowtable (trans)->list);nft_unregister_flowtable_net_hooks (net, +nft_trans_flowtable (trans), &nft_trans_flowtable (trans)->hook_list); }break ;
@@ -10451,7 +10457,8 @@ static void __nft_release_hook(struct net *net, struct nft_table *table)list_for_each_entry (chain, &table->chains, list)__nf_tables_unregister_hook (net, table, chain, true);list_for_each_entry (flowtable, &table->flowtables, list) -__nft_unregister_flowtable_net_hooks (net, &flowtable->hook_list, +__nft_unregister_flowtable_net_hooks (net, flowtable, + &flowtable->hook_list, true); }
net/sched/cls_flow.c +2 -1
@@ -354,7 +354,8 @@ static const struct nla_policy flow_policy[TCA_FLOW_MAX + 1] = { [TCA_FLOW_KEYS] = { .type = NLA_U32 }, [TCA_FLOW_MODE] = { .type = NLA_U32 }, [TCA_FLOW_BASECLASS] = { .type = NLA_U32 }, - [TCA_FLOW_RSHIFT] = { .type = NLA_U32 }, + [TCA_FLOW_RSHIFT ] =NLA_POLICY_MAX (NLA_U32 , + 31 /* BITS_PER_U32 - 1 */), [TCA_FLOW_ADDEND] = { .type = NLA_U32 }, [TCA_FLOW_MASK] = { .type = NLA_U32 }, [TCA_FLOW_XOR] = { .type = NLA_U32 },
net/sctp/sysctl.c +8 -6
@@ -380,7 +380,8 @@ static struct ctl_table sctp_net_table[] = {static int proc_sctp_do_hmac_alg (struct ctl_table *ctl,int write,void *buffer,size_t *lenp,loff_t *ppos) { -struct net *net = current->nsproxy->net_ns; + struct net *net = container_of(ctl->data, struct net, + sctp.sctp_hmac_alg);struct ctl_table tbl;bool changed = false;char *none ="none" ;
@@ -425,7 +426,7 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,static int proc_sctp_do_rto_min (struct ctl_table *ctl,int write,void *buffer,size_t *lenp,loff_t *ppos) { -struct net *net = current->nsproxy->net_ns; + struct net *net = container_of(ctl->data, struct net, sctp.rto_min);unsigned int min = *(unsigned int *) ctl->extra1;unsigned int max = *(unsigned int *) ctl->extra2;struct ctl_table tbl;
@@ -453,7 +454,7 @@ static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write,static int proc_sctp_do_rto_max (struct ctl_table *ctl,int write,void *buffer,size_t *lenp,loff_t *ppos) { -struct net *net = current->nsproxy->net_ns; + struct net *net = container_of(ctl->data, struct net, sctp.rto_max);unsigned int min = *(unsigned int *) ctl->extra1;unsigned int max = *(unsigned int *) ctl->extra2;struct ctl_table tbl;
@@ -491,7 +492,7 @@ static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write,static int proc_sctp_do_auth (struct ctl_table *ctl,int write,void *buffer,size_t *lenp,loff_t *ppos) { -struct net *net = current->nsproxy->net_ns; + struct net *net = container_of(ctl->data, struct net, sctp.auth_enable);struct ctl_table tbl;int new_value, ret;
@@ -520,7 +521,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write,static int proc_sctp_do_udp_port (struct ctl_table *ctl,int write,void *buffer,size_t *lenp,loff_t *ppos) { -struct net *net = current->nsproxy->net_ns; + struct net *net = container_of(ctl->data, struct net, sctp.udp_port);unsigned int min = *(unsigned int *)ctl->extra1;unsigned int max = *(unsigned int *)ctl->extra2;struct ctl_table tbl;
@@ -561,7 +562,8 @@ static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write,static int proc_sctp_do_probe_interval (struct ctl_table *ctl,int write,void *buffer,size_t *lenp,loff_t *ppos) { -struct net *net = current->nsproxy->net_ns; + struct net *net = container_of(ctl->data, struct net, + sctp.probe_interval);struct ctl_table tbl;int ret, new_value;
net/tls/tls_sw.c +1 -1
@@ -453,7 +453,7 @@ int tls_tx_records(struct sock *sk, int flags) tx_err:if (rc <0 && rc != -EAGAIN ) -tls_err_abort (sk, -EBADMSG ); +tls_err_abort (sk, rc);return rc; }
net/vmw_vsock/af_vsock.c +18 -0
@@ -482,6 +482,15 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)*/ vsk->transport->release (vsk);vsock_deassign_transport (vsk); + +/* transport's release() and destruct() can touch some socket +* state, since we are reassigning the socket to a new transport +* during vsock_connect(), let's reset these fields to have a +* clean state. +*/ +sock_reset_flag (sk,SOCK_DONE ); + sk->sk_state =TCP_CLOSE ; + vsk->peer_shutdown =0 ; }/* We increase the module refcnt to prevent the transport unloading
@@ -861,6 +870,9 @@ EXPORT_SYMBOL_GPL(vsock_create_connected);s64 vsock_stream_has_data (struct vsock_sock *vsk) { +if (WARN_ON (!vsk->transport)) +return 0 ; +return vsk->transport->stream_has_data (vsk); }EXPORT_SYMBOL_GPL (vsock_stream_has_data);
@@ -869,6 +881,9 @@ static s64 vsock_connectible_has_data(struct vsock_sock *vsk) {struct sock *sk =sk_vsock (vsk); +if (WARN_ON (!vsk->transport)) +return 0 ; +if (sk->sk_type ==SOCK_SEQPACKET )return vsk->transport->seqpacket_has_data (vsk);else
@@ -877,6 +892,9 @@ static s64 vsock_connectible_has_data(struct vsock_sock *vsk)s64 vsock_stream_has_space (struct vsock_sock *vsk) { +if (WARN_ON (!vsk->transport)) +return 0 ; +return vsk->transport->stream_has_space (vsk); }EXPORT_SYMBOL_GPL (vsock_stream_has_space);
net/vmw_vsock/virtio_transport_common.c +26 -10
@@ -26,6 +26,9 @@/* Threshold for detecting small packets to copy */ #define GOOD_COPY_LEN 128 +static void virtio_transport_cancel_close_work (struct vsock_sock *vsk, +bool cancel_timeout); +static const struct virtio_transport *virtio_transport_get_ops (struct vsock_sock *vsk) {
@@ -811,6 +814,8 @@ void virtio_transport_destruct(struct vsock_sock *vsk) {struct virtio_vsock_sock *vvs = vsk->trans; +virtio_transport_cancel_close_work (vsk, true); +kfree (vvs); vsk->trans =NULL ; }
@@ -899,17 +904,11 @@ static void virtio_transport_wait_close(struct sock *sk, long timeout) } } -static void virtio_transport_do_close (struct vsock_sock *vsk, -bool cancel_timeout) +static void virtio_transport_cancel_close_work (struct vsock_sock *vsk, +bool cancel_timeout) {struct sock *sk =sk_vsock (vsk); -sock_set_flag (sk,SOCK_DONE ); - vsk->peer_shutdown =SHUTDOWN_MASK ; -if (vsock_stream_has_data (vsk) <=0 ) - sk->sk_state =TCP_CLOSING ; - sk->sk_state_change (sk); -if (vsk->close_work_scheduled && (!cancel_timeout ||cancel_delayed_work (&vsk->close_work))) { vsk->close_work_scheduled = false;
@@ -921,6 +920,20 @@ static void virtio_transport_do_close(struct vsock_sock *vsk, } } +static void virtio_transport_do_close (struct vsock_sock *vsk, +bool cancel_timeout) +{ +struct sock *sk =sk_vsock (vsk); + +sock_set_flag (sk,SOCK_DONE ); + vsk->peer_shutdown =SHUTDOWN_MASK ; +if (vsock_stream_has_data (vsk) <=0 ) + sk->sk_state =TCP_CLOSING ; + sk->sk_state_change (sk); + +virtio_transport_cancel_close_work (vsk, cancel_timeout); +} +static void virtio_transport_close_timeout (struct work_struct *work) { struct vsock_sock *vsk =
@@ -1304,8 +1317,11 @@ void virtio_transport_recv_pkt(struct virtio_transport *t,lock_sock (sk); -/* Check if sk has been closed before lock_sock */ -if (sock_flag (sk,SOCK_DONE )) { +/* Check if sk has been closed or assigned to another transport before +* lock_sock (note: listener sockets are not assigned to any transport) +*/ +if (sock_flag (sk,SOCK_DONE ) || + (sk->sk_state !=TCP_LISTEN && vsk->transport != &t->transport)) { (void )virtio_transport_reset_no_sock (t, pkt);release_sock (sk);sock_put (sk);
scripts/sorttable.h +5 -1
@@ -103,7 +103,7 @@ static inline unsigned long orc_ip(const int *ip)static int orc_sort_cmp (const void *_a,const void *_b) { -struct orc_entry *orc_a; +struct orc_entry *orc_a, *orc_b;const int *a = g_orc_ip_table + *(int *)_a;const int *b = g_orc_ip_table + *(int *)_b;unsigned long a_val =orc_ip (a);
@@ -121,6 +121,10 @@ static int orc_sort_cmp(const void *_a, const void *_b)* whitelisted .o files which didn't get objtool generation. */ orc_a = g_orc_table + (a - g_orc_ip_table); + orc_b = g_orc_table + (b - g_orc_ip_table); +if (orc_a->sp_reg ==ORC_REG_UNDEFINED && !orc_a->end && + orc_b->sp_reg ==ORC_REG_UNDEFINED && !orc_b->end) +return 0 ;return orc_a->sp_reg ==ORC_REG_UNDEFINED && !orc_a->end ?-1 :1 ; }
sound/soc/mediatek/common/mtk-afe-platform-driver.c +2 -2
@@ -120,8 +120,8 @@ int mtk_afe_pcm_new(struct snd_soc_component *component,struct mtk_base_afe *afe =snd_soc_component_get_drvdata (component); size = afe->mtk_afe_hardware->buffer_bytes_max; -snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , - afe->dev, size, size); +snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , afe->dev,0 , size); +return 0 ; }EXPORT_SYMBOL_GPL (mtk_afe_pcm_new);