Linux 6.1.3
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.1.3 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
------------
Documentation/trace/kprobes.rst | 3 - Makefile | 2 arch/powerpc/kernel/rtas.c | 20 ++++++- block/bfq-iosched.c | 2 block/blk.h | 2 block/genhd.c | 7 +- block/ioctl.c | 12 ++-- drivers/acpi/resource.c | 32 +++++++++++- drivers/acpi/video_detect.c | 23 ++++++++ drivers/acpi/x86/s2idle.c | 87 +++++----------------------------- drivers/ata/ahci.c | 32 ++++++++---- drivers/char/tpm/eventlog/acpi.c | 12 +++- drivers/char/tpm/tpm_crb.c | 29 +++++++---- drivers/char/tpm/tpm_tis.c | 9 +-- drivers/hid/hid-ids.h | 3 + drivers/hid/hid-multitouch.c | 4 + drivers/hid/hid-plantronics.c | 9 +++ drivers/iommu/mtk_iommu.c | 2 drivers/md/md.c | 9 ++- drivers/mfd/mt6360-core.c | 14 ++++- drivers/mmc/host/vub300.c | 2 drivers/nvme/host/pci.c | 37 +++++++------- drivers/nvme/target/passthru.c | 11 +--- drivers/phy/allwinner/phy-sun4i-usb.c | 71 +++++++++++++++++++++++++++ drivers/rtc/rtc-msc313.c | 12 ---- drivers/soundwire/dmi-quirks.c | 8 +++ fs/binfmt_elf_fdpic.c | 5 + fs/eventfd.c | 37 ++++++++------ fs/eventpoll.c | 18 +++---- fs/f2fs/gc.c | 1 fs/f2fs/node.c | 3 - fs/hfsplus/hfsplus_fs.h | 2 fs/hfsplus/inode.c | 4 - fs/hfsplus/options.c | 4 + fs/nfsd/nfs4proc.c | 20 +------ fs/ntfs3/attrib.c | 18 +++++++ fs/ntfs3/attrlist.c | 5 + fs/ntfs3/bitmap.c | 2 fs/ntfs3/frecord.c | 14 +++++ fs/ntfs3/fslog.c | 35 ++++--------- fs/ntfs3/fsntfs.c | 10 ++- fs/ntfs3/index.c | 6 ++ fs/ntfs3/inode.c | 9 +++ fs/ntfs3/record.c | 10 +++ fs/ntfs3/super.c | 9 +-- fs/overlayfs/dir.c | 46 +++++++++++------ fs/overlayfs/file.c | 1 fs/pnode.c | 2 fs/pstore/ram.c | 2 fs/pstore/zone.c | 2 include/linux/eventfd.h | 7 ++ include/linux/nvme.h | 3 - include/uapi/linux/eventpoll.h | 6 ++ io_uring/io_uring.c | 4 - io_uring/io_uring.h | 15 ++++- io_uring/poll.c | 8 +++ kernel/futex/syscalls.c | 11 ++-- kernel/kcsan/core.c | 50 +++++++++++++++++++ kernel/kprobes.c | 8 --- kernel/locking/rtmutex.c | 55 +++++++++++++++++---- kernel/locking/rtmutex_api.c | 6 +- mm/compaction.c | 18 +------ mm/kmsan/hooks.c | 1 mm/kmsan/kmsan_test.c | 1 mm/mempolicy.c | 1 mm/mremap.c | 3 - net/sunrpc/auth_gss/svcauth_gss.c | 9 ++- sound/pci/hda/patch_hdmi.c | 27 +++++++--- sound/usb/line6/driver.c | 3 - sound/usb/line6/midi.c | 6 +- sound/usb/line6/midibuf.c | 25 ++++++--- sound/usb/line6/midibuf.h | 5 + sound/usb/line6/pod.c | 3 - tools/objtool/check.c | 2 74 files changed, 672 insertions(+), 324 deletions(-)
Adam Vodopjan (1):
ata: ahci: Fix PCS quirk application for suspend
Aditya Garg (1):
hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount
Adrian Freund (1):
ACPI: resource: do IRQ override on Lenovo 14ALC7
Al Viro (1):
ovl: update ->f_iocb_flags when ovl_change_flags() modifies ->f_flags
Andre Przywara (2):
phy: sun4i-usb: Introduce port2 SIDDQ quirk
phy: sun4i-usb: Add support for the H616 USB PHY
Arnd Bergmann (2):
kmsan: export kmsan_handle_urb
kmsan: include linux/vmalloc.h
Artem Egorkine (2):
ALSA: line6: correct midi status byte when receiving data from podxt
ALSA: line6: fix stack overflow in line6_midi_transmit
ChiYuan Huang (1):
mfd: mt6360: Add bounds checking in Regmap read/write call-backs
Christian Brauner (1):
pnode: terminate at peers of source
Christoph Hellwig (2):
nvme: fix the NVME_CMD_EFFECTS_CSE_MASK definition
nvmet: don't defer passthrough commands with trivial effects to the workqueue
Christophe Leroy (1):
objtool: Fix SEGFAULT
Chuck Lever (1):
SUNRPC: Don't leak netobj memory when gss_read_proxy_verf() fails
Dai Ngo (1):
NFSD: fix use-after-free in __nfs42_ssc_open()
Dan Carpenter (1):
fs/ntfs3: Delete duplicate condition in ntfs_read_mft()
Deren Wu (1):
mmc: vub300: fix warning - do not call blocking ops when !TASK_RUNNING
Edward Lo (7):
fs/ntfs3: Validate data run offset
fs/ntfs3: Add null pointer check to attr_load_runs_vcn fs/ntfs3: Add null pointer check for inode operations fs/ntfs3: Validate attribute name offset fs/ntfs3: Validate buffer length while parsing index fs/ntfs3: Validate resident attribute name fs/ntfs3: Validate index root when initialize NTFS security
Erik Schumacher (1):
ACPI: resource: do IRQ override on XMG Core 15
Greg Kroah-Hartman (1):
Linux 6.1.3
Hanjun Guo (3):
tpm: acpi: Call acpi_put_table() to fix memory leak
tpm: tpm_crb: Add the missed acpi_put_table() to fix memory leak
tpm: tpm_tis: Add the missed acpi_put_table() to fix memory leak
Hans de Goede (2):
ACPI: resource: Add Asus ExpertBook B2502 to Asus quirks
ACPI: video: Fix Apple GMUX backlight detection
Hawkins Jiawei (1):
fs/ntfs3: Fix slab-out-of-bounds read in run_unpack
Jaegeuk Kim (1):
f2fs: allow to read node block after shutdown
Jan Kara (1):
block: Do not reread partition table on exclusively open device
Jens Axboe (3):
eventpoll: add EPOLL_URING_WAKE poll wakeup flag
eventfd: provide a eventfd_signal_mask() helper
io_uring: pass in EPOLL_URING_WAKE for eventfd signaling and wakeups
José Expósito (1):
HID: multitouch: fix Asus ExpertBook P2 P2451FA trackpoint
Kees Cook (1):
rtc: msc313: Fix function prototype mismatch in msc313_rtc_probe()
Keith Busch (2):
nvme-pci: fix mempool alloc size
nvme-pci: fix page size checks
Klaus Jensen (1):
nvme-pci: fix doorbell buffer value endianness
Luca Stefani (1):
pstore: Properly assign mem_type property
Marco Elver (1):
kcsan: Instrument memcpy/memset/memmove with newer Clang
Mario Limonciello (2):
ACPI: x86: s2idle: Force AMD GUID/_REV 2 on HP Elitebook 865
ACPI: x86: s2idle: Stop using AMD specific codepath for Rembrandt+
Mathieu Desnoyers (2):
futex: Fix futex_waitv() hrtimer debug object leak on kcalloc error mm/mempolicy: fix memory leak in set_mempolicy_home_node system call
Mel Gorman (1):
rtmutex: Add acquire semantics for rtmutex lock acquisition slow path
Mikulas Patocka (1):
md: fix a crash in mempool_free
NARIBAYASHI Akira (1):
mm, compaction: fix fast_isolate_around() to stay within boundaries
Nathan Lynch (2):
powerpc/rtas: avoid device tree lookups in rtas_os_term() powerpc/rtas: avoid scheduling in rtas_os_term()
Pavel Machek (1):
f2fs: should put a page when checking the summary info
Pierre-Louis Bossart (1):
soundwire: dmi-quirks: add quirk variant for LAPBC710 NUC15
Qiujun Huang (1):
pstore/zone: Use GFP_ATOMIC to allocate zone buffer
Ricardo Ribalda (1):
iommu/mediatek: Fix crash on isr after kexec()
Shigeru Yoshida (1):
fs/ntfs3: Fix memory leak on ntfs_fill_super() error path
Takashi Iwai (1):
ALSA: hda/hdmi: Static PCM mapping again with AMD HDMI codecs
Terry Junge (1):
HID: plantronics: Additional PIDs for double volume key presses quirk
Tetsuo Handa (2):
fs/ntfs3: Use __GFP_NOWARN allocation at wnd_init() fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_fill_super()
Vlastimil Babka (1):
mm, mremap: fix mremap() expanding vma with addr inside vma
Wang Yufen (1):
binfmt: Fix error return code in load_elf_fdpic_binary()
Yin Xiujiang (1):
fs/ntfs3: Fix slab-out-of-bounds in r_page
Yu Kuai (1):
block, bfq: fix uaf for bfqq in bfq_exit_icq_bfqq
Zhang Tianci (1):
ovl: Use ovl mounter's fsuid and fsgid in ovl_link()
edward lo (2):
fs/ntfs3: Validate BOOT record_size fs/ntfs3: Add overflow check for attribute size
wuqiang (1):
kprobes: kretprobe events missing on 2-core KVM guest
Greg Kroah-Hartman
maintainerDocumentation/trace/kprobes.rst +1 -2
@@ -131,8 +131,7 @@ For example, if the function is non-recursive and is called with a spinlock held, maxactive = 1 should be enough. If the function is non-recursive and can never relinquish the CPU (e.g., via a semaphore or preemption), NR_CPUS should be enough. If maxactive <= 0, it is -set to a default value. If CONFIG_PREEMPT is enabled, the default -is max(10, 2*NR_CPUS). Otherwise, the default is NR_CPUS. +set to a default value: max(10, 2*NR_CPUS). It's not a disaster if you set maxactive too low; you'll just miss some probes. In the kretprobe struct, the nmissed field is set to
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 1 -SUBLEVEL = 2 +SUBLEVEL = 3 EXTRAVERSION = NAME = Hurr durr I'ma ninja sloth
arch/powerpc/kernel/rtas.c +16 -4
@@ -889,6 +889,7 @@ void __noreturn rtas_halt(void)/* Must be in the RMO region, so we place it here */ static char rtas_os_term_buf[2048 ]; +static s32 ibm_os_term_token =RTAS_UNKNOWN_SERVICE ;void rtas_os_term (char *str) {
@@ -900,16 +901,20 @@ void rtas_os_term(char *str)* this property may terminate the partition which we want to avoid * since it interferes with panic_timeout. */ -if (RTAS_UNKNOWN_SERVICE ==rtas_token ("ibm,os-term" ) || -RTAS_UNKNOWN_SERVICE ==rtas_token ("ibm,extended-os-term" )) +if (ibm_os_term_token ==RTAS_UNKNOWN_SERVICE )return ;snprintf (rtas_os_term_buf,2048 ,"OS panic: %s" , str); +/* +* Keep calling as long as RTAS returns a "try again" status, +* but don't use rtas_busy_delay(), which potentially +* schedules. +*/ do { - status =rtas_call (rtas_token ("ibm,os-term" ),1 ,1 ,NULL , + status =rtas_call (ibm_os_term_token,1 ,1 ,NULL ,__pa (rtas_os_term_buf)); - }while (rtas_busy_delay (status)); + }while (rtas_busy_delay_time (status));if (status !=0 )printk (KERN_EMERG "ibm,os-term call failed %d\n" , status);
@@ -1277,6 +1282,13 @@ void __init rtas_initialize(void) no_entry =of_property_read_u32 (rtas.dev,"linux,rtas-entry" , &entry); rtas.entry = no_entry ? rtas.base : entry; +/* +* Discover these now to avoid device tree lookups in the +* panic path. +*/ +if (of_property_read_bool (rtas.dev,"ibm,extended-os-term" )) + ibm_os_term_token =rtas_token ("ibm,os-term" ); +/* If RTAS was found, allocate the RMO buffer for it and look for * the stop-self token if any */
block/bfq-iosched.c +1 -1
@@ -5383,8 +5383,8 @@ static void bfq_exit_icq_bfqq(struct bfq_io_cq *bic, bool is_sync)unsigned long flags;spin_lock_irqsave (&bfqd->lock, flags); -bfq_exit_bfqq (bfqd, bfqq);bic_set_bfqq (bic,NULL , is_sync); +bfq_exit_bfqq (bfqd, bfqq);spin_unlock_irqrestore (&bfqd->lock, flags); } }
block/blk.h +1 -1
@@ -436,7 +436,7 @@ static inline struct kmem_cache *blk_get_queue_kmem_cache(bool srcu) }struct request_queue *blk_alloc_queue (int node_id,bool alloc_srcu); -int disk_scan_partitions (struct gendisk *disk,fmode_t mode); +int disk_scan_partitions (struct gendisk *disk,fmode_t mode,void *owner);int disk_alloc_events (struct gendisk *disk);void disk_add_events (struct gendisk *disk);
block/genhd.c +5 -2
@@ -356,7 +356,7 @@ void disk_uevent(struct gendisk *disk, enum kobject_action action) }EXPORT_SYMBOL_GPL (disk_uevent); -int disk_scan_partitions (struct gendisk *disk,fmode_t mode) +int disk_scan_partitions (struct gendisk *disk,fmode_t mode,void *owner) {struct block_device *bdev;
@@ -366,6 +366,9 @@ int disk_scan_partitions(struct gendisk *disk, fmode_t mode)return -EINVAL ;if (disk->open_partitions)return -EBUSY ; +/* Someone else has bdev exclusively open? */ +if (disk->part0->bd_holder && disk->part0->bd_holder != owner) +return -EBUSY ;set_bit (GD_NEED_PART_SCAN , &disk->state); bdev =blkdev_get_by_dev (disk_devt (disk), mode,NULL );
@@ -500,7 +503,7 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,bdev_add (disk->part0, ddev->devt);if (get_capacity (disk)) -disk_scan_partitions (disk,FMODE_READ ); +disk_scan_partitions (disk,FMODE_READ ,NULL );/* * Announce the disk and partitions after all partitions are
block/ioctl.c +7 -5
@@ -467,9 +467,10 @@ static int blkdev_bszset(struct block_device *bdev, fmode_t mode,* user space. Note the separate arg/argp parameters that are needed * to deal with the compat_ptr() conversion. */ -static int blkdev_common_ioctl (struct block_device *bdev,fmode_t mode, -unsigned cmd,unsigned long arg,void __user *argp) +static int blkdev_common_ioctl (struct file *file,fmode_t mode,unsigned cmd, +unsigned long arg,void __user *argp) { +struct block_device *bdev =I_BDEV (file->f_mapping->host);unsigned int max_sectors;switch (cmd) {
@@ -527,7 +528,8 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,return -EACCES ;if (bdev_is_partition (bdev))return -EINVAL ; -return disk_scan_partitions (bdev->bd_disk, mode & ~FMODE_EXCL ); +return disk_scan_partitions (bdev->bd_disk, mode & ~FMODE_EXCL , + file);case BLKTRACESTART :case BLKTRACESTOP :case BLKTRACETEARDOWN :
@@ -605,7 +607,7 @@ long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)break ; } - ret =blkdev_common_ioctl (bdev, mode, cmd, arg, argp); + ret =blkdev_common_ioctl (file, mode, cmd, arg, argp);if (ret != -ENOIOCTLCMD )return ret;
@@ -674,7 +676,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)break ; } - ret =blkdev_common_ioctl (bdev, mode, cmd, arg, argp); + ret =blkdev_common_ioctl (file, mode, cmd, arg, argp);if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl) ret = disk->fops->compat_ioctl (bdev, mode, cmd, arg);
drivers/acpi/resource.c +29 -3
@@ -432,10 +432,24 @@ static const struct dmi_system_id asus_laptop[] = { DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"), }, }, + { + .ident = "Asus ExpertBook B2502", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"), + }, + }, { } }; -static const struct dmi_system_id lenovo_82ra[] = { +static const struct dmi_system_id lenovo_laptop[] = { + { + .ident ="LENOVO IdeaPad Flex 5 14ALC7" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"82R9" ), + }, + }, { .ident ="LENOVO IdeaPad Flex 5 16ALC7" , .matches = {
@@ -446,6 +460,17 @@ static const struct dmi_system_id lenovo_82ra[] = { { } }; +static const struct dmi_system_id schenker_gm_rg[] = { + { + .ident ="XMG CORE 15 (M22)" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"SchenkerTechnologiesGmbH" ), +DMI_MATCH (DMI_BOARD_NAME ,"GMxRGxx" ), + }, + }, + { } +}; +struct irq_override_cmp {const struct dmi_system_id *system;unsigned char irq;
@@ -458,8 +483,9 @@ struct irq_override_cmp {static const struct irq_override_cmp override_table[] = { { medion_laptop,1 ,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_LOW ,0 , false }, { asus_laptop,1 ,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_LOW ,0 , false }, - { lenovo_82ra,6 ,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_LOW ,0 , true }, - { lenovo_82ra,10 ,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_LOW ,0 , true }, + { lenovo_laptop,6 ,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_LOW ,0 , true }, + { lenovo_laptop,10 ,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_LOW ,0 , true }, + { schenker_gm_rg,1 ,ACPI_EDGE_SENSITIVE ,ACPI_ACTIVE_LOW ,1 , true }, }; static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
drivers/acpi/video_detect.c +22 -1
@@ -34,6 +34,7 @@#include <linux/module.h> #include <linux/pci.h> #include <linux/platform_data/x86/nvidia-wmi-ec-backlight.h> +#include <linux/pnp.h> #include <linux/types.h> #include <linux/workqueue.h> #include <acpi/video.h>
@@ -105,6 +106,26 @@ static bool nvidia_wmi_ec_supported(void) }#endif +static bool apple_gmux_backlight_present (void ) +{ +struct acpi_device *adev; +struct device *dev; + + adev =acpi_dev_get_first_match_dev (GMUX_ACPI_HID ,NULL ,-1 ); +if (!adev) +return false; + + dev =acpi_get_first_physical_node (adev); +if (!dev) +return false; + +/* +* drivers/platform/x86/apple-gmux.c only supports old style +* Apple GMUX with an IO-resource. +*/ +return pnp_get_resource (to_pnp_dev (dev),IORESOURCE_IO ,0 ) !=NULL ; +} +/* Force to use vendor driver when the ACPI device is known to be * buggy */ static int video_detect_force_vendor (const struct dmi_system_id *d)
@@ -755,7 +776,7 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)if (nvidia_wmi_ec_present)return acpi_backlight_nvidia_wmi_ec; -if (apple_gmux_present ()) +if (apple_gmux_backlight_present ())return acpi_backlight_apple_gmux;/* Chromebooks should always prefer native backlight control. */
drivers/acpi/x86/s2idle.c +13 -74
143 lines not on this page · raw message
drivers/ata/ahci.c +23 -9
@@ -84,6 +84,7 @@ enum board_ids {static int ahci_init_one (struct pci_dev *pdev,const struct pci_device_id *ent);static void ahci_remove_one (struct pci_dev *dev);static void ahci_shutdown_one (struct pci_dev *dev); +static void ahci_intel_pcs_quirk (struct pci_dev *pdev,struct ahci_host_priv *hpriv);static int ahci_vt8251_hardreset (struct ata_link *link,unsigned int *class,unsigned long deadline); static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
@@ -677,6 +678,25 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev,ahci_save_initial_config (&pdev->dev, hpriv); } +static int ahci_pci_reset_controller (struct ata_host *host) +{ +struct pci_dev *pdev =to_pci_dev (host->dev); +struct ahci_host_priv *hpriv = host->private_data; +int rc; + + rc =ahci_reset_controller (host); +if (rc) +return rc; + +/* +* If platform firmware failed to enable ports, try to enable +* them here. +*/ +ahci_intel_pcs_quirk (pdev, hpriv); + +return 0 ; +} +static void ahci_pci_init_controller (struct ata_host *host) {struct ahci_host_priv *hpriv = host->private_data;
@@ -871,7 +891,7 @@ static int ahci_pci_device_runtime_resume(struct device *dev)struct ata_host *host =pci_get_drvdata (pdev);int rc; - rc =ahci_reset_controller (host); + rc =ahci_pci_reset_controller (host);if (rc)return rc;ahci_pci_init_controller (host);
@@ -907,7 +927,7 @@ static int ahci_pci_device_resume(struct device *dev)ahci_mcp89_apple_enable (pdev);if (pdev->dev.power.power_state.event ==PM_EVENT_SUSPEND ) { - rc =ahci_reset_controller (host); + rc =ahci_pci_reset_controller (host);if (rc)return rc;
@@ -1785,12 +1805,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)/* save initial config */ ahci_pci_save_initial_config (pdev, hpriv); -/* -* If platform firmware failed to enable ports, try to enable -* them here. -*/ -ahci_intel_pcs_quirk (pdev, hpriv); -/* prepare host */ if (hpriv->cap &HOST_CAP_NCQ ) { pi.flags |=ATA_FLAG_NCQ ;
@@ -1900,7 +1914,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if (rc)return rc; - rc =ahci_reset_controller (host); + rc =ahci_pci_reset_controller (host);if (rc)return rc;
drivers/char/tpm/eventlog/acpi.c +9 -3
@@ -90,16 +90,21 @@ int tpm_read_log_acpi(struct tpm_chip *chip)return -ENODEV ;if (tbl->header.length < -sizeof (*tbl) +sizeof (struct acpi_tpm2_phy )) +sizeof (*tbl) +sizeof (struct acpi_tpm2_phy )) { +acpi_put_table ((struct acpi_table_header *)tbl);return -ENODEV ; + } tpm2_phy = (void *)tbl +sizeof (*tbl); len = tpm2_phy->log_area_minimum_length; start = tpm2_phy->log_area_start_address; -if (!start || !len) +if (!start || !len) { +acpi_put_table ((struct acpi_table_header *)tbl);return -ENODEV ; + } +acpi_put_table ((struct acpi_table_header *)tbl); format =EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 ; }else {/* Find TCPA entry in RSDT (ACPI_LOGICAL_ADDRESSING) */
@@ -120,8 +125,10 @@ int tpm_read_log_acpi(struct tpm_chip *chip)break ; } +acpi_put_table ((struct acpi_table_header *)buff); format =EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 ; } +if (!len) {dev_warn (&chip->dev,"%s: TCPA log area empty\n" , __func__);return -EIO ;
@@ -156,5 +163,4 @@ int tpm_read_log_acpi(struct tpm_chip *chip)kfree (log->bios_event_log); log->bios_event_log =NULL ;return ret; - }
drivers/char/tpm/tpm_crb.c +20 -9
@@ -676,12 +676,16 @@ static int crb_acpi_add(struct acpi_device *device)/* Should the FIFO driver handle this? */ sm = buf->start_method; -if (sm ==ACPI_TPM2_MEMORY_MAPPED ) -return -ENODEV ; +if (sm ==ACPI_TPM2_MEMORY_MAPPED ) { + rc = -ENODEV ; + goto out; + } priv =devm_kzalloc (dev,sizeof (struct crb_priv ),GFP_KERNEL ); -if (!priv) -return -ENOMEM ; +if (!priv) { + rc = -ENOMEM ; + goto out; + }if (sm ==ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC ) {if (buf->header.length < (sizeof (*buf) +sizeof (*crb_smc))) {
@@ -689,7 +693,8 @@ static int crb_acpi_add(struct acpi_device *device)FW_BUG "TPM2 ACPI table has wrong size %u for start method type %d\n" , buf->header.length, ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC); -return -EINVAL ; + rc = -EINVAL ; + goto out; } crb_smc = ACPI_ADD_PTR(struct tpm2_crb_smc, buf, sizeof(*buf)); priv->smc_func_id = crb_smc->smc_func_id;
@@ -700,17 +705,23 @@ static int crb_acpi_add(struct acpi_device *device) rc =crb_map_io (device, priv, buf);if (rc) -return rc; + goto out; chip =tpmm_chip_alloc (dev, &tpm_crb); -if (IS_ERR (chip)) -return PTR_ERR (chip); +if (IS_ERR (chip)) { + rc =PTR_ERR (chip); + goto out; + }dev_set_drvdata (&chip->dev, priv); chip->acpi_dev_handle = device->handle; chip->flags =TPM_CHIP_FLAG_TPM2 ; -return tpm_chip_register (chip); + rc =tpm_chip_register (chip); + +out: +acpi_put_table ((struct acpi_table_header *)buf); +return rc; }static int crb_acpi_remove (struct acpi_device *device)
drivers/char/tpm/tpm_tis.c +5 -4
@@ -125,6 +125,7 @@ static int check_acpi_tpm2(struct device *dev)const struct acpi_device_id *aid =acpi_match_device (tpm_acpi_tbl, dev);struct acpi_table_tpm2 *tbl;acpi_status st; +int ret =0 ;if (!aid || aid->driver_data !=DEVICE_IS_TPM2 )return 0 ;
@@ -132,8 +133,7 @@ static int check_acpi_tpm2(struct device *dev)/* If the ACPI TPM2 signature is matched then a global ACPI_SIG_TPM2 * table is mandatory */ - st = -acpi_get_table (ACPI_SIG_TPM2 ,1 , (struct acpi_table_header **)&tbl); + st =acpi_get_table (ACPI_SIG_TPM2 ,1 , (struct acpi_table_header **)&tbl);if (ACPI_FAILURE (st) || tbl->header.length <sizeof (*tbl)) {dev_err (dev,FW_BUG "failed to get TPM2 ACPI table\n" );return -EINVAL ;
@@ -141,9 +141,10 @@ static int check_acpi_tpm2(struct device *dev)/* The tpm2_crb driver handles this device */ if (tbl->start_method !=ACPI_TPM2_MEMORY_MAPPED ) -return -ENODEV ; + ret = -ENODEV ; - return 0; +acpi_put_table ((struct acpi_table_header *)tbl); + return ret; }#else static int check_acpi_tpm2 (struct device *dev)
drivers/hid/hid-ids.h +3 -0
@@ -995,7 +995,10 @@#define USB_DEVICE_ID_ORTEK_IHOME_IMAC_A210S 0x8003#define USB_VENDOR_ID_PLANTRONICS 0x047f +#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3210_SERIES 0xc055#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3220_SERIES 0xc056 +#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3215_SERIES 0xc057 +#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES 0xc058#define USB_VENDOR_ID_PANASONIC 0x04da#define USB_DEVICE_ID_PANABOARD_UBT780 0x1044
drivers/hid/hid-multitouch.c +4 -0
@@ -1967,6 +1967,10 @@ static const struct hid_device_id mt_devices[] = {HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , USB_VENDOR_ID_ELAN, 0x313a) }, + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, +HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , + USB_VENDOR_ID_ELAN, 0x3148) }, + /* Elitegroup panel */ { .driver_data = MT_CLS_SERIAL, MT_USB_DEVICE(USB_VENDOR_ID_ELITEGROUP,
drivers/hid/hid-plantronics.c +9 -0
@@ -198,9 +198,18 @@ static int plantronics_probe(struct hid_device *hdev, }static const struct hid_device_id plantronics_devices[] = { + {HID_USB_DEVICE (USB_VENDOR_ID_PLANTRONICS , +USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3210_SERIES ), + .driver_data =PLT_QUIRK_DOUBLE_VOLUME_KEYS }, {HID_USB_DEVICE (USB_VENDOR_ID_PLANTRONICS ,USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3220_SERIES ), .driver_data =PLT_QUIRK_DOUBLE_VOLUME_KEYS }, + {HID_USB_DEVICE (USB_VENDOR_ID_PLANTRONICS , +USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3215_SERIES ), + .driver_data =PLT_QUIRK_DOUBLE_VOLUME_KEYS }, + {HID_USB_DEVICE (USB_VENDOR_ID_PLANTRONICS , +USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES ), + .driver_data =PLT_QUIRK_DOUBLE_VOLUME_KEYS }, {HID_USB_DEVICE (USB_VENDOR_ID_PLANTRONICS ,HID_ANY_ID ) }, { } };
drivers/iommu/mtk_iommu.c +1 -1
@@ -454,7 +454,7 @@ static irqreturn_t mtk_iommu_isr(int irq, void *dev_id) fault_larb = data->plat_data->larbid_remap[fault_larb][sub_comm]; } -if (report_iommu_fault (&dom->domain, bank->parent_dev, fault_iova, +if (!dom ||report_iommu_fault (&dom->domain, bank->parent_dev, fault_iova, write ?IOMMU_FAULT_WRITE :IOMMU_FAULT_READ )) { dev_err_ratelimited( bank->parent_dev,
drivers/md/md.c +6 -3
@@ -509,13 +509,14 @@ static void md_end_flush(struct bio *bio)struct md_rdev *rdev = bio->bi_private;struct mddev *mddev = rdev->mddev; +bio_put (bio); +rdev_dec_pending (rdev, mddev);if (atomic_dec_and_test (&mddev->flush_pending)) {/* The pre-request flush has finished */ queue_work (md_wq, &mddev->flush_work); } -bio_put (bio); }static void md_submit_flush_data (struct work_struct *ws);
@@ -913,10 +914,12 @@ static void super_written(struct bio *bio) }else clear_bit (LastDev, &rdev->flags); +bio_put (bio); + +rdev_dec_pending (rdev, mddev); +if (atomic_dec_and_test (&mddev->pending_writes))wake_up (&mddev->sb_wait); -rdev_dec_pending (rdev, mddev); -bio_put (bio); } void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
drivers/mfd/mt6360-core.c +12 -2
@@ -402,7 +402,7 @@ static int mt6360_regmap_read(void *context, const void *reg, size_t reg_size,struct mt6360_ddata *ddata = context;u8 bank = *(u8 *)reg;u8 reg_addr = *(u8 *)(reg +1 ); -struct i2c_client *i2c = ddata->i2c[bank]; +struct i2c_client *i2c;bool crc_needed = false;u8 *buf;int buf_len =MT6360_ALLOC_READ_SIZE (val_size);
@@ -410,6 +410,11 @@ static int mt6360_regmap_read(void *context, const void *reg, size_t reg_size,u8 crc;int ret; +if (bank >=MT6360_SLAVE_MAX ) +return -EINVAL ; + + i2c = ddata->i2c[bank]; +if (bank ==MT6360_SLAVE_PMIC || bank ==MT6360_SLAVE_LDO ) { crc_needed = true; ret =mt6360_xlate_pmicldo_addr (®_addr, val_size);
@@ -453,13 +458,18 @@ static int mt6360_regmap_write(void *context, const void *val, size_t val_size)struct mt6360_ddata *ddata = context;u8 bank = *(u8 *)val;u8 reg_addr = *(u8 *)(val +1 ); -struct i2c_client *i2c = ddata->i2c[bank]; +struct i2c_client *i2c;bool crc_needed = false;u8 *buf;int buf_len =MT6360_ALLOC_WRITE_SIZE (val_size);int write_size = val_size -MT6360_REGMAP_REG_BYTE_SIZE ;int ret; +if (bank >=MT6360_SLAVE_MAX ) +return -EINVAL ; + + i2c = ddata->i2c[bank]; +if (bank ==MT6360_SLAVE_PMIC || bank ==MT6360_SLAVE_LDO ) { crc_needed = true; ret =mt6360_xlate_pmicldo_addr (®_addr, val_size -MT6360_REGMAP_REG_BYTE_SIZE );
drivers/mmc/host/vub300.c +2 -0
@@ -2049,6 +2049,7 @@ static void vub300_enable_sdio_irq(struct mmc_host *mmc, int enable)return ;kref_get (&vub300->kref);if (enable) { +set_current_state (TASK_RUNNING );mutex_lock (&vub300->irq_mutex);if (vub300->irqs_queued) { vub300->irqs_queued -=1 ;
@@ -2064,6 +2065,7 @@ static void vub300_enable_sdio_irq(struct mmc_host *mmc, int enable)vub300_queue_poll_work (vub300,0 ); }mutex_unlock (&vub300->irq_mutex); +set_current_state (TASK_INTERRUPTIBLE ); }else { vub300->irq_enabled =0 ; }
drivers/nvme/host/pci.c +19 -18
@@ -35,7 +35,7 @@#define SQ_SIZE (q) ((q)->q_depth << (q)->sqes)#define CQ_SIZE (q) ((q)->q_depth * sizeof(struct nvme_completion)) -#define SGES_PER_PAGE (PAGE_SIZE / sizeof(struct nvme_sgl_desc)) +#define SGES_PER_PAGE (NVME_CTRL_PAGE_SIZE / sizeof(struct nvme_sgl_desc))/* * These can be higher, but we need to ensure that any command doesn't
@@ -144,9 +144,9 @@ struct nvme_dev {mempool_t *iod_mempool;/* shadow doorbell buffer support: */ -u32 *dbbuf_dbs; +__le32 *dbbuf_dbs;dma_addr_t dbbuf_dbs_dma_addr; -u32 *dbbuf_eis; +__le32 *dbbuf_eis;dma_addr_t dbbuf_eis_dma_addr;/* host memory buffer support: */
@@ -210,10 +210,10 @@ struct nvme_queue {#define NVMEQ_SQ_CMB 1#define NVMEQ_DELETE_ERROR 2#define NVMEQ_POLLED 3 -u32 *dbbuf_sq_db; -u32 *dbbuf_cq_db; -u32 *dbbuf_sq_ei; -u32 *dbbuf_cq_ei; +__le32 *dbbuf_sq_db; +__le32 *dbbuf_cq_db; +__le32 *dbbuf_sq_ei; +__le32 *dbbuf_cq_ei;struct completion delete_done; };
@@ -340,11 +340,11 @@ static inline int nvme_dbbuf_need_event(u16 event_idx, u16 new_idx, u16 old) }/* Update dbbuf and return true if an MMIO is required */ -static bool nvme_dbbuf_update_and_check_event (u16 value,u32 *dbbuf_db, -volatile u32 *dbbuf_ei) +static bool nvme_dbbuf_update_and_check_event (u16 value,__le32 *dbbuf_db, +volatile __le32 *dbbuf_ei) {if (dbbuf_db) { -u16 old_value; +u16 old_value, event_idx;/* * Ensure that the queue is written before updating
@@ -352,8 +352,8 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db,*/ wmb (); - old_value = *dbbuf_db; - *dbbuf_db = value; + old_value =le32_to_cpu (*dbbuf_db); + *dbbuf_db =cpu_to_le32 (value);/* * Ensure that the doorbell is updated before reading the event
@@ -363,7 +363,8 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db,*/ mb (); -if (!nvme_dbbuf_need_event (*dbbuf_ei, value, old_value)) + event_idx =le32_to_cpu (*dbbuf_ei); +if (!nvme_dbbuf_need_event (event_idx, value, old_value))return false; }
@@ -377,9 +378,9 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db,*/ static int nvme_pci_npages_prp (void ) { -unsigned nprps =DIV_ROUND_UP (NVME_MAX_KB_SZ +NVME_CTRL_PAGE_SIZE , -NVME_CTRL_PAGE_SIZE ); -return DIV_ROUND_UP (8 * nprps,PAGE_SIZE -8 ); +unsigned max_bytes = (NVME_MAX_KB_SZ *1024 ) +NVME_CTRL_PAGE_SIZE ; +unsigned nprps =DIV_ROUND_UP (max_bytes,NVME_CTRL_PAGE_SIZE ); +return DIV_ROUND_UP (8 * nprps,NVME_CTRL_PAGE_SIZE -8 ); }/*
@@ -389,7 +390,7 @@ static int nvme_pci_npages_prp(void)static int nvme_pci_npages_sgl (void ) {return DIV_ROUND_UP (NVME_MAX_SEGS *sizeof (struct nvme_sgl_desc ), -PAGE_SIZE ); +NVME_CTRL_PAGE_SIZE ); }static size_t nvme_pci_iod_alloc_size (void )
@@ -713,7 +714,7 @@ static void nvme_pci_sgl_set_seg(struct nvme_sgl_desc *sge, sge->length =cpu_to_le32 (entries *sizeof (*sge)); sge->type =NVME_SGL_FMT_LAST_SEG_DESC <<4 ; }else { - sge->length =cpu_to_le32 (PAGE_SIZE ); + sge->length =cpu_to_le32 (NVME_CTRL_PAGE_SIZE ); sge->type =NVME_SGL_FMT_SEG_DESC <<4 ; } }
drivers/nvme/target/passthru.c +5 -6
@@ -334,14 +334,13 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req) }/* -* If there are effects for the command we are about to execute, or -* an end_req function we need to use nvme_execute_passthru_rq() -* synchronously in a work item seeing the end_req function and -* nvme_passthru_end() can't be called in the request done callback -* which is typically in interrupt context. +* If a command needs post-execution fixups, or there are any +* non-trivial effects, make sure to execute the command synchronously +* in a workqueue so that nvme_passthru_end gets called. */ effects =nvme_command_effects (ctrl, ns, req->cmd->common.opcode); -if (req->p.use_workqueue || effects) { +if (req->p.use_workqueue || + (effects & ~(NVME_CMD_EFFECTS_CSUPP |NVME_CMD_EFFECTS_LBCC ))) {INIT_WORK (&req->p.work, nvmet_passthru_execute_cmd_work); req->p.rq = rq;queue_work (nvmet_wq, &req->p.work);
drivers/phy/allwinner/phy-sun4i-usb.c +71 -0
107 lines not on this page · raw message
drivers/rtc/rtc-msc313.c +1 -11
@@ -212,22 +212,12 @@ static int msc313_rtc_probe(struct platform_device *pdev)return ret; } - clk =devm_clk_get (dev,NULL ); + clk =devm_clk_get_enabled (dev,NULL );if (IS_ERR (clk)) {dev_err (dev,"No input reference clock\n" );return PTR_ERR (clk); } - ret =clk_prepare_enable (clk); -if (ret) { -dev_err (dev,"Failed to enable the reference clock, %d\n" , ret); -return ret; - } - - ret =devm_add_action_or_reset (dev, (void (*) (void *))clk_disable_unprepare, clk); -if (ret) -return ret; - rate =clk_get_rate (clk);writew (rate &0xFFFF , priv->rtc_base +REG_RTC_FREQ_CW_L );writew ((rate >>16 ) &0xFFFF , priv->rtc_base +REG_RTC_FREQ_CW_H );
drivers/soundwire/dmi-quirks.c +8 -0
@@ -90,6 +90,14 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { }, .driver_data = (void *)intel_tgl_bios, }, + { +/* quirk used for NUC15 LAPBC710 skew */ + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Intel Corporation" ), + DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"), + }, + .driver_data = (void *)intel_tgl_bios, + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
fs/binfmt_elf_fdpic.c +3 -2
@@ -434,8 +434,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm) current->mm->start_stack = current->mm->start_brk + stack_size;#endif -if (create_elf_fdpic_tables (bprm, current->mm, - &exec_params, &interp_params) <0 ) + retval =create_elf_fdpic_tables (bprm, current->mm, &exec_params, + &interp_params); +if (retval <0 ) goto error;kdebug ("- start_code %lx" , current->mm->start_code);
fs/eventfd.c +21 -16
@@ -43,21 +43,7 @@ struct eventfd_ctx {int id; }; -/** -* eventfd_signal - Adds @n to the eventfd counter. -* @ctx: [in] Pointer to the eventfd context. -* @n: [in] Value of the counter to be added to the eventfd internal counter. -* The value cannot be negative. -* -* This function is supposed to be called by the kernel in paths that do not -* allow sleeping. In this function we allow the counter to reach the ULLONG_MAX -* value, and we signal this as overflow condition by returning a EPOLLERR -* to poll(2). -* -* Returns the amount by which the counter was incremented. This will be less -* than @n if the counter has overflowed. -*/ -__u64 eventfd_signal (struct eventfd_ctx *ctx,__u64 n) +__u64 eventfd_signal_mask (struct eventfd_ctx *ctx,__u64 n,unsigned mask) {unsigned long flags;
@@ -78,12 +64,31 @@ __u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n) n =ULLONG_MAX - ctx->count; ctx->count += n;if (waitqueue_active (&ctx->wqh)) -wake_up_locked_poll (&ctx->wqh,EPOLLIN ); +wake_up_locked_poll (&ctx->wqh,EPOLLIN | mask); current->in_eventfd =0 ;spin_unlock_irqrestore (&ctx->wqh.lock, flags);return n; } + +/** +* eventfd_signal - Adds @n to the eventfd counter. +* @ctx: [in] Pointer to the eventfd context. +* @n: [in] Value of the counter to be added to the eventfd internal counter. +* The value cannot be negative. +* +* This function is supposed to be called by the kernel in paths that do not +* allow sleeping. In this function we allow the counter to reach the ULLONG_MAX +* value, and we signal this as overflow condition by returning a EPOLLERR +* to poll(2). +* +* Returns the amount by which the counter was incremented. This will be less +* than @n if the counter has overflowed. +*/ +__u64 eventfd_signal (struct eventfd_ctx *ctx,__u64 n) +{ +return eventfd_signal_mask (ctx, n,0 ); +}EXPORT_SYMBOL_GPL (eventfd_signal);static void eventfd_free_ctx (struct eventfd_ctx *ctx)
fs/eventpoll.c +10 -8
@@ -491,7 +491,8 @@ static inline void ep_set_busy_poll_napi_id(struct epitem *epi)*/ #ifdef CONFIG_DEBUG_LOCK_ALLOC -static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi) +static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi, +unsigned pollflags) {struct eventpoll *ep_src;unsigned long flags;
@@ -522,16 +523,17 @@ static void ep_poll_safewake(struct eventpoll *ep, struct epitem *epi) }spin_lock_irqsave_nested (&ep->poll_wait.lock, flags, nests); ep->nests = nests +1 ; -wake_up_locked_poll (&ep->poll_wait,EPOLLIN ); +wake_up_locked_poll (&ep->poll_wait,EPOLLIN | pollflags); ep->nests =0 ;spin_unlock_irqrestore (&ep->poll_wait.lock, flags); }#else -static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi) +static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi, +unsigned pollflags) { -wake_up_poll (&ep->poll_wait,EPOLLIN ); +wake_up_poll (&ep->poll_wait,EPOLLIN | pollflags); }#endif
@@ -742,7 +744,7 @@ static void ep_free(struct eventpoll *ep)/* We need to release all tasks waiting for these file */ if (waitqueue_active (&ep->poll_wait)) -ep_poll_safewake (ep,NULL ); +ep_poll_safewake (ep,NULL ,0 );/* * We need to lock this because we could be hit by
@@ -1208,7 +1210,7 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v/* We have to call this outside the lock */ if (pwake) -ep_poll_safewake (ep, epi); +ep_poll_safewake (ep, epi, pollflags &EPOLL_URING_WAKE );if (!(epi->event.events &EPOLLEXCLUSIVE )) ewake =1 ;
@@ -1553,7 +1555,7 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,/* We have to call this outside the lock */ if (pwake) -ep_poll_safewake (ep,NULL ); +ep_poll_safewake (ep,NULL ,0 );return 0 ; }
@@ -1629,7 +1631,7 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi,/* We have to call this outside the lock */ if (pwake) -ep_poll_safewake (ep,NULL ); +ep_poll_safewake (ep,NULL ,0 );return 0 ; }
fs/f2fs/gc.c +1 -0
@@ -1109,6 +1109,7 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,if (ofs_in_node >= max_addrs) {f2fs_err (sbi,"Inconsistent ofs_in_node:%u in summary, ino:%u, nid:%u, max:%u" , ofs_in_node, dni->ino, dni->nid, max_addrs); +f2fs_put_page (node_page,1 );return false; }
fs/f2fs/node.c +1 -2
@@ -1360,8 +1360,7 @@ static int read_node_page(struct page *page, blk_opf_t op_flags)return err;/* NEW_ADDR can be seen, after cp_error drops some dirty node pages */ -if (unlikely (ni.blk_addr ==NULL_ADDR || ni.blk_addr ==NEW_ADDR ) || -is_sbi_flag_set (sbi,SBI_IS_SHUTDOWN )) { +if (unlikely (ni.blk_addr ==NULL_ADDR || ni.blk_addr ==NEW_ADDR )) {ClearPageUptodate (page);return -ENOENT ; }
fs/hfsplus/hfsplus_fs.h +2 -0
@@ -198,6 +198,8 @@ struct hfsplus_sb_info {#define HFSPLUS_SB_HFSX 3#define HFSPLUS_SB_CASEFOLD 4#define HFSPLUS_SB_NOBARRIER 5 +#define HFSPLUS_SB_UID 6 +#define HFSPLUS_SB_GID 7static inline struct hfsplus_sb_info *HFSPLUS_SB (struct super_block *sb) {
fs/hfsplus/inode.c +2 -2
@@ -192,11 +192,11 @@ static void hfsplus_get_perms(struct inode *inode, mode =be16_to_cpu (perms->mode);i_uid_write (inode,be32_to_cpu (perms->owner)); -if (!i_uid_read (inode) && !mode) +if ((test_bit (HFSPLUS_SB_UID , &sbi->flags)) || (!i_uid_read (inode) && !mode)) inode->i_uid = sbi->uid;i_gid_write (inode,be32_to_cpu (perms->group)); -if (!i_gid_read (inode) && !mode) +if ((test_bit (HFSPLUS_SB_GID , &sbi->flags)) || (!i_gid_read (inode) && !mode)) inode->i_gid = sbi->gid;if (dir) {
fs/hfsplus/options.c +4 -0
@@ -140,6 +140,8 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)if (!uid_valid (sbi->uid)) {pr_err ("invalid uid specified\n" );return 0 ; + }else { +set_bit (HFSPLUS_SB_UID , &sbi->flags); }break ;case opt_gid:
@@ -151,6 +153,8 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)if (!gid_valid (sbi->gid)) {pr_err ("invalid gid specified\n" );return 0 ; + }else { +set_bit (HFSPLUS_SB_GID , &sbi->flags); }break ;case opt_part:
fs/nfsd/nfs4proc.c +5 -15
@@ -1465,13 +1465,6 @@ nfsd4_interssc_connect(struct nl4_server *nss, struct svc_rqst *rqstp,return status; } -static void -nfsd4_interssc_disconnect (struct vfsmount *ss_mnt) -{ -nfs_do_sb_deactive (ss_mnt->mnt_sb); -mntput (ss_mnt); -} -/* * Verify COPY destination stateid. *
@@ -1574,11 +1567,6 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct file *filp, { } -static void -nfsd4_interssc_disconnect (struct vfsmount *ss_mnt) -{ -} -static struct file *nfs42_ssc_open (struct vfsmount *ss_mnt,struct nfs_fh *src_fh,nfs4_stateid *stateid)
@@ -1774,7 +1762,7 @@ static int nfsd4_do_async_copy(void *data)default : nfserr = nfserr_offload_denied; } -nfsd4_interssc_disconnect (copy->ss_mnt); +/* ss_mnt will be unmounted by the laundromat */ goto do_callback; } nfserr = nfsd4_do_copy(copy, filp, copy->nf_dst->nf_file,
@@ -1855,8 +1843,10 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,if (async_copy)cleanup_async_copy (async_copy); status =nfserrno (-ENOMEM ); -if (nfsd4_ssc_is_inter (copy)) -nfsd4_interssc_disconnect (copy->ss_mnt); +/* +* source's vfsmount of inter-copy will be unmounted +* by the laundromat +*/ goto out; }
fs/ntfs3/attrib.c +18 -0
@@ -101,6 +101,10 @@ static int attr_load_runs(struct ATTRIB *attr, struct ntfs_inode *ni, asize =le32_to_cpu (attr->size); run_off =le16_to_cpu (attr->nres.run_off); + +if (run_off > asize) +return -EINVAL ; + err =run_unpack_ex (run, ni->mi.sbi, ni->mi.rno, svcn, evcn, vcn ? *vcn : svcn,Add2Ptr (attr, run_off), asize - run_off);
@@ -1217,6 +1221,11 @@ int attr_load_runs_vcn(struct ntfs_inode *ni, enum ATTR_TYPE type,CLST svcn, evcn;u16 ro; +if (!ni) { +/* Is record corrupted? */ +return -ENOENT ; + } + attr =ni_find_attr (ni,NULL ,NULL , type, name, name_len, &vcn,NULL );if (!attr) {/* Is record corrupted? */
@@ -1232,6 +1241,10 @@ int attr_load_runs_vcn(struct ntfs_inode *ni, enum ATTR_TYPE type, } ro =le16_to_cpu (attr->nres.run_off); + +if (ro >le32_to_cpu (attr->size)) +return -EINVAL ; + err =run_unpack_ex (run, ni->mi.sbi, ni->mi.rno, svcn, evcn, svcn,Add2Ptr (attr, ro),le32_to_cpu (attr->size) - ro);if (err <0 )
@@ -1901,6 +1914,11 @@ int attr_collapse_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)u16 le_sz;u16 roff =le16_to_cpu (attr->nres.run_off); +if (roff >le32_to_cpu (attr->size)) { + err = -EINVAL ; + goto out; + } +run_unpack_ex (RUN_DEALLOCATE , sbi, ni->mi.rno, svcn, evcn1 -1 , svcn,Add2Ptr (attr, roff),le32_to_cpu (attr->size) - roff);
fs/ntfs3/attrlist.c +5 -0
@@ -68,6 +68,11 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)run_init (&ni->attr_list.run); +if (run_off >le32_to_cpu (attr->size)) { + err = -EINVAL ; + goto out; + } + err = run_unpack_ex(&ni->attr_list.run, ni->mi.sbi, ni->mi.rno, 0, le64_to_cpu(attr->nres.evcn), 0, Add2Ptr(attr, run_off),
fs/ntfs3/bitmap.c +1 -1
@@ -661,7 +661,7 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)if (!wnd->bits_last) wnd->bits_last = wbits; - wnd->free_bits =kcalloc (wnd->nwnd,sizeof (u16),GFP_NOFS ); + wnd->free_bits =kcalloc (wnd->nwnd,sizeof (u16),GFP_NOFS | __GFP_NOWARN);if (!wnd->free_bits)return -ENOMEM ;
fs/ntfs3/frecord.c +14 -0
@@ -568,6 +568,12 @@ static int ni_repack(struct ntfs_inode *ni) } roff =le16_to_cpu (attr->nres.run_off); + +if (roff >le32_to_cpu (attr->size)) { + err = -EINVAL ; +break ; + } + err =run_unpack (&run, sbi, ni->mi.rno, svcn, evcn, svcn,Add2Ptr (attr, roff),le32_to_cpu (attr->size) - roff);
@@ -1589,6 +1595,9 @@ int ni_delete_all(struct ntfs_inode *ni) asize =le32_to_cpu (attr->size); roff =le16_to_cpu (attr->nres.run_off); +if (roff > asize) +return -EINVAL ; +/* run==1 means unpack and deallocate. */ run_unpack_ex (RUN_DEALLOCATE , sbi, ni->mi.rno, svcn, evcn, svcn,Add2Ptr (attr, roff), asize - roff);
@@ -2291,6 +2300,11 @@ int ni_decompress_file(struct ntfs_inode *ni) asize =le32_to_cpu (attr->size); roff =le16_to_cpu (attr->nres.run_off); +if (roff > asize) { + err = -EINVAL ; + goto out; + } +/*run==1 Means unpack and deallocate. */ run_unpack_ex (RUN_DEALLOCATE , sbi, ni->mi.rno, svcn, evcn, svcn,Add2Ptr (attr, roff), asize - roff);
fs/ntfs3/fslog.c +11 -24
@@ -1132,7 +1132,7 @@ static int read_log_page(struct ntfs_log *log, u32 vbo,return -EINVAL ;if (!*buffer) { - to_free =kmalloc (bytes,GFP_NOFS ); + to_free =kmalloc (log->page_size,GFP_NOFS );if (!to_free)return -ENOMEM ; *buffer = to_free;
@@ -1180,10 +1180,7 @@ static int log_read_rst(struct ntfs_log *log, u32 l_size, bool first, struct restart_info *info) {u32 skip, vbo; -struct RESTART_HDR *r_page =kmalloc (DefaultLogPageSize,GFP_NOFS ); - -if (!r_page) -return -ENOMEM ; +struct RESTART_HDR *r_page =NULL ;/* Determine which restart area we are looking for. */ if (first) {
@@ -1197,7 +1194,6 @@ static int log_read_rst(struct ntfs_log *log, u32 l_size, bool first,/* Loop continuously until we succeed. */ for (; vbo < l_size; vbo =2 * vbo + skip, skip =0 ) {bool usa_error; -u32 sys_page_size;bool brst, bchk;struct RESTART_AREA *ra;
@@ -1251,24 +1247,6 @@ static int log_read_rst(struct ntfs_log *log, u32 l_size, bool first, goto check_result; } -/* Read the entire restart area. */ - sys_page_size =le32_to_cpu (r_page->sys_page_size); -if (DefaultLogPageSize != sys_page_size) { -kfree (r_page); - r_page =kzalloc (sys_page_size,GFP_NOFS ); -if (!r_page) -return -ENOMEM ; - -if (read_log_page (log, vbo, - (struct RECORD_PAGE_HDR **)&r_page, - &usa_error)) { -/* Ignore any errors. */ -kfree (r_page); - r_page =NULL ; -continue ; - } - } -if (is_client_area_valid (r_page, usa_error)) { info->valid_page = true; ra =Add2Ptr (r_page,le16_to_cpu (r_page->ra_off));
@@ -2727,6 +2705,9 @@ static inline bool check_attr(const struct MFT_REC *rec,return false; } +if (run_off > asize) +return false; +if (run_unpack (NULL , sbi,0 , svcn, evcn, svcn,Add2Ptr (attr, run_off), asize - run_off) <0 ) {return false;
@@ -4771,6 +4752,12 @@ int log_replay(struct ntfs_inode *ni, bool *initialized)u16 roff =le16_to_cpu (attr->nres.run_off);CLST svcn =le64_to_cpu (attr->nres.svcn); +if (roff > t32) { +kfree (oa->attr); + oa->attr =NULL ; + goto fake_attr; + } + err =run_unpack (&oa->run0, sbi, inode->i_ino, svcn,le64_to_cpu (attr->nres.evcn), svcn,Add2Ptr (attr, roff), t32 - roff);
fs/ntfs3/fsntfs.c +6 -4
@@ -1849,9 +1849,10 @@ int ntfs_security_init(struct ntfs_sb_info *sbi) goto out; } - root_sdh =resident_data (attr); + root_sdh =resident_data_ex (attr,sizeof (struct INDEX_ROOT ));if (root_sdh->type !=ATTR_ZERO || - root_sdh->rule !=NTFS_COLLATION_TYPE_SECURITY_HASH ) { + root_sdh->rule !=NTFS_COLLATION_TYPE_SECURITY_HASH || + offsetof(struct INDEX_ROOT , ihdr) + root_sdh->ihdr.used > attr->res.data_size) { err = -EINVAL ; goto out; }
@@ -1867,9 +1868,10 @@ int ntfs_security_init(struct ntfs_sb_info *sbi) goto out; } - root_sii =resident_data (attr); + root_sii =resident_data_ex (attr,sizeof (struct INDEX_ROOT ));if (root_sii->type !=ATTR_ZERO || - root_sii->rule !=NTFS_COLLATION_TYPE_UINT ) { + root_sii->rule !=NTFS_COLLATION_TYPE_UINT || + offsetof(struct INDEX_ROOT , ihdr) + root_sii->ihdr.used > attr->res.data_size) { err = -EINVAL ; goto out; }
fs/ntfs3/index.c +6 -0
@@ -1017,6 +1017,12 @@ int indx_read(struct ntfs_index *indx, struct ntfs_inode *ni, CLST vbn, err =0 ; } +/* check for index header length */ +if (offsetof(struct INDEX_BUFFER , ihdr) + ib->ihdr.used > bytes) { + err = -EINVAL ; + goto out; + } + in->index = ib; *node = in;
fs/ntfs3/inode.c +9 -0
@@ -129,6 +129,9 @@ static struct inode *ntfs_read_mft(struct inode *inode, rsize = attr->non_res ?0 :le32_to_cpu (attr->res.data_size); asize =le32_to_cpu (attr->size); +if (le16_to_cpu (attr->name_off) + attr->name_len > asize) + goto out; +switch (attr->type) {case ATTR_STD : if (attr->non_res ||
@@ -364,7 +367,13 @@ static struct inode *ntfs_read_mft(struct inode *inode, attr_unpack_run: roff =le16_to_cpu (attr->nres.run_off); +if (roff > asize) { + err = -EINVAL ; + goto out; + } + t64 =le64_to_cpu (attr->nres.svcn); + err =run_unpack_ex (run, sbi, ino, t64,le64_to_cpu (attr->nres.evcn), t64,Add2Ptr (attr, roff), asize - roff);if (err <0 )
fs/ntfs3/record.c +10 -0
@@ -220,6 +220,11 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)return NULL ; } +if (off + asize < off) { +/* overflow check */ +return NULL ; + } + attr =Add2Ptr (attr, asize); off += asize; }
@@ -260,6 +265,11 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)if (t16 + t32 > asize)return NULL ; +if (attr->name_len && +le16_to_cpu (attr->name_off) +sizeof (short ) * attr->name_len > t16) { +return NULL ; + } +return attr; }
fs/ntfs3/super.c +5 -4
@@ -789,7 +789,7 @@ static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size, : (u32)boot->record_size << sbi->cluster_bits; -if (record_size >MAXIMUM_BYTES_PER_MFT ) +if (record_size >MAXIMUM_BYTES_PER_MFT || record_size <SECTOR_SIZE ) goto out; sbi->record_bits =blksize_bits (record_size);
@@ -1141,7 +1141,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc) goto put_inode_out; } bytes = inode->i_size; - sbi->def_table = t =kmalloc (bytes,GFP_NOFS ); + sbi->def_table = t =kmalloc (bytes,GFP_NOFS | __GFP_NOWARN);if (!t) { err = -ENOMEM ; goto put_inode_out;
@@ -1260,9 +1260,9 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc) ref.low =cpu_to_le32 (MFT_REC_ROOT ); ref.seq =cpu_to_le16 (MFT_REC_ROOT ); inode =ntfs_iget5 (sb, &ref, &NAME_ROOT ); -if (IS_ERR (inode)) { +if (IS_ERR (inode) || !inode->i_op) {ntfs_err (sb,"Failed to load root." ); - err =PTR_ERR (inode); + err =IS_ERR (inode) ?PTR_ERR (inode) : -EINVAL ; goto out; }
@@ -1281,6 +1281,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)* Free resources here. * ntfs_fs_free will be called with fc->s_fs_info = NULL */ +put_mount_options (sbi->options);put_ntfs (sbi); sb->s_fs_info =NULL ;
fs/overlayfs/dir.c +30 -16
58 lines not on this page · raw message
fs/overlayfs/file.c +1 -0
@@ -96,6 +96,7 @@ static int ovl_change_flags(struct file *file, unsigned int flags)spin_lock (&file->f_lock); file->f_flags = (file->f_flags & ~OVL_SETFL_MASK ) | flags; + file->f_iocb_flags =iocb_flags (file);spin_unlock (&file->f_lock);return 0 ;
fs/pnode.c +1 -1
@@ -244,7 +244,7 @@ static int propagate_one(struct mount *m) } do { struct mount *parent = last_source->mnt_parent; - if (last_source == first_source) + if (peers(last_source, first_source)) break; done = parent->mnt_master == p; if (done && peers(n, parent))
fs/pstore/ram.c +1 -1
@@ -670,7 +670,7 @@ static int ramoops_parse_dt(struct platform_device *pdev, field = value; \ } -parse_u32 ("mem-type" , pdata->record_size, pdata->mem_type); +parse_u32 ("mem-type" , pdata->mem_type, pdata->mem_type);parse_u32 ("record-size" , pdata->record_size,0 );parse_u32 ("console-size" , pdata->console_size,0 );parse_u32 ("ftrace-size" , pdata->ftrace_size,0 );
fs/pstore/zone.c +1 -1
@@ -761,7 +761,7 @@ static inline int notrace psz_kmsg_write_record(struct psz_context *cxt,/* avoid destroying old data, allocate a new one */ len = zone->buffer_size +sizeof (*zone->buffer); zone->oldbuf = zone->buffer; - zone->buffer =kzalloc (len,GFP_KERNEL ); + zone->buffer =kzalloc (len,GFP_ATOMIC );if (!zone->buffer) { zone->buffer = zone->oldbuf;return -ENOMEM ;
include/linux/eventfd.h +7 -0
@@ -40,6 +40,7 @@ struct file *eventfd_fget(int fd);struct eventfd_ctx *eventfd_ctx_fdget (int fd);struct eventfd_ctx *eventfd_ctx_fileget (struct file *file);__u64 eventfd_signal (struct eventfd_ctx *ctx,__u64 n); +__u64 eventfd_signal_mask (struct eventfd_ctx *ctx,__u64 n,unsigned mask);int eventfd_ctx_remove_wait_queue (struct eventfd_ctx *ctx,wait_queue_entry_t *wait,__u64 *cnt);void eventfd_ctx_do_read (struct eventfd_ctx *ctx,__u64 *cnt);
@@ -66,6 +67,12 @@ static inline int eventfd_signal(struct eventfd_ctx *ctx, __u64 n)return -ENOSYS ; } +static inline int eventfd_signal_mask (struct eventfd_ctx *ctx,__u64 n, +unsigned mask) +{ +return -ENOSYS ; +} +static inline void eventfd_ctx_put (struct eventfd_ctx *ctx) {
include/linux/nvme.h +2 -1
@@ -7,6 +7,7 @@#ifndef _LINUX_NVME_H#define _LINUX_NVME_H +#include <linux/bits.h> #include <linux/types.h> #include <linux/uuid.h>
@@ -639,7 +640,7 @@ enum {NVME_CMD_EFFECTS_NCC =1 <<2 ,NVME_CMD_EFFECTS_NIC =1 <<3 ,NVME_CMD_EFFECTS_CCC =1 <<4 , -NVME_CMD_EFFECTS_CSE_MASK =3 <<16 , +NVME_CMD_EFFECTS_CSE_MASK =GENMASK (18 ,16 ), NVME_CMD_EFFECTS_UUID_SEL = 1 << 19, };
include/uapi/linux/eventpoll.h +6 -0
@@ -41,6 +41,12 @@#define EPOLLMSG (__force __poll_t)0x00000400#define EPOLLRDHUP (__force __poll_t)0x00002000 +/* +* Internal flag - wakeup generated by io_uring, used to detect recursion back +* into the io_uring poll handler. +*/ +#define EPOLL_URING_WAKE ((__force __poll_t)(1U << 27)) +/* Set exclusive wakeup mode for the target file descriptor */ #define EPOLLEXCLUSIVE ((__force __poll_t)(1U << 28))
io_uring/io_uring.c +2 -2
@@ -495,7 +495,7 @@ static void io_eventfd_ops(struct rcu_head *rcu)int ops =atomic_xchg (&ev_fd->ops,0 );if (ops &BIT (IO_EVENTFD_OP_SIGNAL_BIT )) -eventfd_signal (ev_fd->cq_ev_fd,1 ); +eventfd_signal_mask (ev_fd->cq_ev_fd,1 ,EPOLL_URING_WAKE );/* IO_EVENTFD_OP_FREE_BIT may not be set here depending on callback * ordering in a race but if references are 0 we know we have to free
@@ -531,7 +531,7 @@ static void io_eventfd_signal(struct io_ring_ctx *ctx) goto out;if (likely (eventfd_signal_allowed ())) { -eventfd_signal (ev_fd->cq_ev_fd,1 ); +eventfd_signal_mask (ev_fd->cq_ev_fd,1 ,EPOLL_URING_WAKE ); }else {atomic_inc (&ev_fd->refs);if (!atomic_fetch_or (BIT (IO_EVENTFD_OP_SIGNAL_BIT ), &ev_fd->ops))
io_uring/io_uring.h +11 -4
@@ -4,6 +4,7 @@#include <linux/errno.h> #include <linux/lockdep.h> #include <linux/io_uring_types.h> +#include <uapi/linux/eventpoll.h> #include "io-wq.h" #include "slist.h" #include "filetable.h"
@@ -207,12 +208,18 @@ static inline void io_commit_cqring(struct io_ring_ctx *ctx)static inline void __io_cqring_wake (struct io_ring_ctx *ctx) {/* -* wake_up_all() may seem excessive, but io_wake_function() and -* io_should_wake() handle the termination of the loop and only -* wake as many waiters as we need to. +* Trigger waitqueue handler on all waiters on our waitqueue. This +* won't necessarily wake up all the tasks, io_should_wake() will make +* that decision. +* +* Pass in EPOLLIN|EPOLL_URING_WAKE as the poll wakeup key. The latter +* set in the mask so that if we recurse back into our own poll +* waitqueue handlers, we know we have a dependency between eventfd or +* epoll and should terminate multishot poll at that point. */ if (waitqueue_active (&ctx->cq_wait)) -wake_up_all (&ctx->cq_wait); +__wake_up (&ctx->cq_wait,TASK_NORMAL ,0 , +poll_to_key (EPOLL_URING_WAKE |EPOLLIN )); }static inline void io_cqring_wake (struct io_ring_ctx *ctx)
io_uring/poll.c +8 -0
@@ -429,6 +429,14 @@ static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,return 0 ;if (io_poll_get_ownership (req)) { +/* +* If we trigger a multishot poll off our own wakeup path, +* disable multishot as there is a circular dependency between +* CQ posting and triggering the event. +*/ +if (mask &EPOLL_URING_WAKE ) + poll->events |=EPOLLONESHOT ; +/* optional, saves extra locking for removal in tw handler */ if (mask && poll->events &EPOLLONESHOT ) {list_del_init (&poll->wait.entry);
kernel/futex/syscalls.c +7 -4
@@ -286,19 +286,22 @@ SYSCALL_DEFINE5(futex_waitv, struct futex_waitv __user *, waiters, } futexv =kcalloc (nr_futexes,sizeof (*futexv),GFP_KERNEL ); -if (!futexv) -return -ENOMEM ; +if (!futexv) { + ret = -ENOMEM ; + goto destroy_timer; + } ret =futex_parse_waitv (futexv, waiters, nr_futexes);if (!ret) ret =futex_wait_multiple (futexv, nr_futexes, timeout ? &to :NULL ); +kfree (futexv); + +destroy_timer:if (timeout) {hrtimer_cancel (&to.timer);destroy_hrtimer_on_stack (&to.timer); } - -kfree (futexv);return ret; }
kernel/kcsan/core.c +50 -0
63 lines not on this page · raw message
kernel/kprobes.c +2 -6
@@ -2213,13 +2213,9 @@ int register_kretprobe(struct kretprobe *rp) rp->kp.post_handler =NULL ;/* Pre-allocate memory for max kretprobe instances */ -if (rp->maxactive <=0 ) { -#ifdef CONFIG_PREEMPTION +if (rp->maxactive <=0 ) rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus()); -#else - rp->maxactive =num_possible_cpus (); -#endif - } +#ifdef CONFIG_KRETPROBE_ON_RETHOOK rp->rh =rethook_alloc ((void *)rp, kretprobe_rethook_handler);if (!rp->rh)
kernel/locking/rtmutex.c +46 -9
103 lines not on this page · raw message
kernel/locking/rtmutex_api.c +3 -3
@@ -267,7 +267,7 @@ void __sched rt_mutex_init_proxy_locked(struct rt_mutex_base *lock, void __sched rt_mutex_proxy_unlock(struct rt_mutex_base *lock) {debug_rt_mutex_proxy_unlock (lock); -rt_mutex_set_owner (lock,NULL ); +rt_mutex_clear_owner (lock); }/**
@@ -382,7 +382,7 @@ int __sched rt_mutex_wait_proxy_lock(struct rt_mutex_base *lock,* try_to_take_rt_mutex() sets the waiter bit unconditionally. We might * have to fix that up. */ -fixup_rt_mutex_waiters (lock); +fixup_rt_mutex_waiters (lock, true);raw_spin_unlock_irq (&lock->wait_lock);return ret;
@@ -438,7 +438,7 @@ bool __sched rt_mutex_cleanup_proxy_lock(struct rt_mutex_base *lock,* try_to_take_rt_mutex() sets the waiter bit unconditionally. We might * have to fix that up. */ -fixup_rt_mutex_waiters (lock); +fixup_rt_mutex_waiters (lock, false);raw_spin_unlock_irq (&lock->wait_lock);
mm/compaction.c +5 -13
@@ -1344,7 +1344,7 @@ move_freelist_tail(struct list_head *freelist, struct page *freepage) }static void -fast_isolate_around (struct compact_control *cc,unsigned long pfn,unsigned long nr_isolated) +fast_isolate_around (struct compact_control *cc,unsigned long pfn) {unsigned long start_pfn, end_pfn;struct page *page;
@@ -1365,21 +1365,13 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn, unsigned longif (!page)return ; -/* Scan before */ -if (start_pfn != pfn) { -isolate_freepages_block (cc, &start_pfn, pfn, &cc->freepages,1 , false); -if (cc->nr_freepages >= cc->nr_migratepages) -return ; - } - -/* Scan after */ - start_pfn = pfn + nr_isolated; -if (start_pfn < end_pfn) -isolate_freepages_block (cc, &start_pfn, end_pfn, &cc->freepages,1 , false); +isolate_freepages_block (cc, &start_pfn, end_pfn, &cc->freepages,1 , false);/* Skip this pageblock in the future as it's full or nearly full */ if (cc->nr_freepages < cc->nr_migratepages)set_pageblock_skip (page); + +return ; }/* Search orders in round-robin fashion */
@@ -1556,7 +1548,7 @@ fast_isolate_freepages(struct compact_control *cc)return cc->free_pfn; low_pfn =page_to_pfn (page); -fast_isolate_around (cc, low_pfn, nr_isolated); +fast_isolate_around (cc, low_pfn);return low_pfn; }
mm/kmsan/hooks.c +1 -0
@@ -260,6 +260,7 @@ void kmsan_handle_urb(const struct urb *urb, bool is_out) urb->transfer_buffer_length, /*checked*/ false); } +EXPORT_SYMBOL_GPL (kmsan_handle_urb);static void kmsan_handle_dma_page (const void *addr,size_t size,enum dma_data_direction dir)
mm/kmsan/kmsan_test.c +1 -0
@@ -22,6 +22,7 @@#include <linux/spinlock.h> #include <linux/string.h> #include <linux/tracepoint.h> +#include <linux/vmalloc.h> #include <trace/events/printk.h> static DEFINE_PER_CPU(int, per_cpu_var);
mm/mempolicy.c +1 -0
@@ -1540,6 +1540,7 @@ SYSCALL_DEFINE4(set_mempolicy_home_node, unsigned long, start, unsigned long, le* the home node for vmas we already updated before. */ if (new->mode !=MPOL_BIND && new->mode !=MPOL_PREFERRED_MANY ) { +mpol_put (new); err = -EOPNOTSUPP ;break ; }
mm/mremap.c +2 -1
@@ -1016,7 +1016,8 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,long pages = (new_len - old_len) >>PAGE_SHIFT ;unsigned long extension_start = addr + old_len;unsigned long extension_end = addr + new_len; -pgoff_t extension_pgoff = vma->vm_pgoff + (old_len >>PAGE_SHIFT ); +pgoff_t extension_pgoff = vma->vm_pgoff + + ((extension_start - vma->vm_start) >>PAGE_SHIFT );if (vma->vm_flags &VM_ACCOUNT ) {if (security_vm_enough_memory_mm (mm, pages)) {
net/sunrpc/auth_gss/svcauth_gss.c +7 -2
@@ -1162,18 +1162,23 @@ static int gss_read_proxy_verf(struct svc_rqst *rqstp,return res; inlen =svc_getnl (argv); -if (inlen > (argv->iov_len + rqstp->rq_arg.page_len)) +if (inlen > (argv->iov_len + rqstp->rq_arg.page_len)) { +kfree (in_handle->data);return SVC_DENIED ; + } pages =DIV_ROUND_UP (inlen,PAGE_SIZE ); in_token->pages =kcalloc (pages,sizeof (struct page *),GFP_KERNEL ); -if (!in_token->pages) +if (!in_token->pages) { +kfree (in_handle->data);return SVC_DENIED ; + } in_token->page_base =0 ; in_token->page_len = inlen;for (i =0 ; i < pages; i++) { in_token->pages[i] =alloc_page (GFP_KERNEL );if (!in_token->pages[i]) { +kfree (in_handle->data);gss_free_in_token_pages (in_token);return SVC_DENIED ; }
sound/pci/hda/patch_hdmi.c +19 -8
@@ -167,6 +167,7 @@ struct hdmi_spec {struct hdmi_ops ops;bool dyn_pin_out; +bool static_pcm_mapping;/* hdmi interrupt trigger control flag for Nvidia codec */ bool hdmi_intr_trig_ctrl;bool nv_dp_workaround;/* workaround DP audio infoframe for Nvidia */
@@ -1525,13 +1526,16 @@ static void update_eld(struct hda_codec *codec,*/ pcm_jack =pin_idx_to_pcm_jack (codec, per_pin); -if (eld->eld_valid) { -hdmi_attach_hda_pcm (spec, per_pin); -hdmi_pcm_setup_pin (spec, per_pin); - }else { -hdmi_pcm_reset_pin (spec, per_pin); -hdmi_detach_hda_pcm (spec, per_pin); +if (!spec->static_pcm_mapping) { +if (eld->eld_valid) { +hdmi_attach_hda_pcm (spec, per_pin); +hdmi_pcm_setup_pin (spec, per_pin); + }else { +hdmi_pcm_reset_pin (spec, per_pin); +hdmi_detach_hda_pcm (spec, per_pin); + } } +/* if pcm_idx == -1, it means this is in monitor connection event * we can get the correct pcm_idx now. */
@@ -2281,8 +2285,8 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)struct hdmi_spec *spec = codec->spec;int idx, pcm_num; -/* limit the PCM devices to the codec converters */ - pcm_num = spec->num_cvts; +/* limit the PCM devices to the codec converters or available PINs */ + pcm_num =min (spec->num_cvts, spec->num_pins);codec_dbg (codec,"hdmi: pcm_num set to %d\n" , pcm_num);for (idx =0 ; idx < pcm_num; idx++) {
@@ -2379,6 +2383,11 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)struct hdmi_spec_per_pin *per_pin =get_pin (spec, pin_idx);struct hdmi_eld *pin_eld = &per_pin->sink_eld; +if (spec->static_pcm_mapping) { +hdmi_attach_hda_pcm (spec, per_pin); +hdmi_pcm_setup_pin (spec, per_pin); + } + pin_eld->eld_valid = false;hdmi_present_sense (per_pin,0 ); }
@@ -4419,6 +4428,8 @@ static int patch_atihdmi(struct hda_codec *codec) spec = codec->spec; + spec->static_pcm_mapping = true; + spec->ops.pin_get_eld = atihdmi_pin_get_eld; spec->ops.pin_setup_infoframe = atihdmi_pin_setup_infoframe; spec->ops.pin_hbr_setup = atihdmi_pin_hbr_setup;
sound/usb/line6/driver.c +2 -1
@@ -304,7 +304,8 @@ static void line6_data_received(struct urb *urb)for (;;) { done =line6_midibuf_read (mb, line6->buffer_message, -LINE6_MIDI_MESSAGE_MAXLEN ); +LINE6_MIDI_MESSAGE_MAXLEN , +LINE6_MIDIBUF_READ_RX );if (done <=0 )break ;
sound/usb/line6/midi.c +4 -2
@@ -44,7 +44,8 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)int req, done;for (;;) { - req =min (line6_midibuf_bytes_free (mb), line6->max_packet_size); + req =min3 (line6_midibuf_bytes_free (mb), line6->max_packet_size, +LINE6_FALLBACK_MAXPACKETSIZE ); done =snd_rawmidi_transmit_peek (substream, chunk, req);if (done ==0 )
@@ -56,7 +57,8 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)for (;;) { done =line6_midibuf_read (mb, chunk, -LINE6_FALLBACK_MAXPACKETSIZE ); +LINE6_FALLBACK_MAXPACKETSIZE , +LINE6_MIDIBUF_READ_TX );if (done ==0 )break ;
sound/usb/line6/midibuf.c +17 -8
@@ -9,6 +9,7 @@#include "midibuf.h" +static int midibuf_message_length (unsigned char code) {int message_length;
@@ -20,12 +21,7 @@ static int midibuf_message_length(unsigned char code) message_length = length[(code >>4 ) -8 ]; }else { -/* -Note that according to the MIDI specification 0xf2 is -the "Song Position Pointer", but this is used by Line 6 -to send sysex messages to the host. -*/ -static const int length[] = {-1 ,2 ,-1 ,2 ,-1 ,-1 ,1 ,1 ,1 ,1 , +static const int length[] = {-1 ,2 ,2 ,2 ,-1 ,-1 ,1 ,1 ,1 ,-1 ,1 ,1 ,1 ,-1 ,1 ,1 }; message_length = length[code &0x0f ];
@@ -125,7 +121,7 @@ int line6_midibuf_write(struct midi_buffer *this, unsigned char *data, }int line6_midibuf_read (struct midi_buffer *this,unsigned char *data, -int length) +int length,int read_type) {int bytes_used;int length1, length2;
@@ -148,9 +144,22 @@ int line6_midibuf_read(struct midi_buffer *this, unsigned char *data, length1 = this->size - this->pos_read; -/* check MIDI command length */ command = this->buf[this->pos_read]; +/* +PODxt always has status byte lower nibble set to 0010, +when it means to send 0000, so we correct if here so +that control/program changes come on channel 1 and +sysex message status byte is correct +*/ +if (read_type ==LINE6_MIDIBUF_READ_RX ) { +if (command ==0xb2 || command ==0xc2 || command ==0xf2 ) { +unsigned char fixed = command &0xf0 ; + this->buf[this->pos_read] = fixed; + command = fixed; + } + } +/* check MIDI command length */ if (command &0x80 ) { midi_length =midibuf_message_length (command); this->command_prev = command;
sound/usb/line6/midibuf.h +4 -1
@@ -8,6 +8,9 @@ #ifndef MIDIBUF_H #define MIDIBUF_H +#define LINE6_MIDIBUF_READ_TX 0 +#define LINE6_MIDIBUF_READ_RX 1 + struct midi_buffer { unsigned char *buf; int size;
@@ -23,7 +26,7 @@ extern void line6_midibuf_destroy(struct midi_buffer *mb);extern int line6_midibuf_ignore (struct midi_buffer *mb,int length);extern int line6_midibuf_init (struct midi_buffer *mb,int size,int split);extern int line6_midibuf_read (struct midi_buffer *mb,unsigned char *data, -int length); +int length,int read_type);extern void line6_midibuf_reset (struct midi_buffer *mb);extern int line6_midibuf_write (struct midi_buffer *mb,unsigned char *data,int length);
sound/usb/line6/pod.c +2 -1
@@ -159,8 +159,9 @@ static struct line6_pcm_properties pod_pcm_properties = { .bytes_per_channel = 3 /* SNDRV_PCM_FMTBIT_S24_3LE */ }; +static const char pod_version_header[] = { -0xf2 ,0x7e ,0x7f ,0x06 ,0x02 +0xf0 ,0x7e ,0x7f ,0x06 ,0x02 }; static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code,
tools/objtool/check.c +1 -1
@@ -207,7 +207,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,return false; insn =find_insn (file, func->sec, func->offset); -if (!insn->func) +if (!insn || !insn->func)return false;func_for_each_insn (file, func, insn) {