Linux 4.9.236
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.9.236 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.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/filesystems/affs.txt | 16 Makefile | 2 arch/arm64/include/asm/kvm_arm.h | 3 arch/arm64/include/asm/kvm_asm.h | 43 ++ arch/arm64/kernel/vmlinux.lds.S | 8 arch/arm64/kvm/hyp/entry.S | 26 + arch/arm64/kvm/hyp/hyp-entry.S | 63 ++- arch/arm64/kvm/hyp/switch.c | 39 +- arch/mips/kernel/smp-bmips.c | 2 arch/mips/mm/c-r4k.c | 4 arch/s390/include/asm/percpu.h | 28 - arch/xtensa/platforms/iss/simdisk.c | 1 drivers/ata/libata-core.c | 5 drivers/ata/libata-scsi.c | 8 drivers/block/brd.c | 1 drivers/block/rbd.c | 9 drivers/block/zram/zram_drv.h | 1 drivers/dma/at_hdmac.c | 2 drivers/dma/of-dma.c | 8 drivers/dma/pl330.c | 2 drivers/hid/hid-core.c | 15 drivers/hid/hid-input.c | 4 drivers/hid/hid-multitouch.c | 2 drivers/hwmon/applesmc.c | 31 - drivers/ide/ide-cd.c | 8 drivers/ide/ide-cd.h | 6 drivers/iommu/intel_irq_remapping.c | 10 drivers/md/dm-cache-metadata.c | 8 drivers/md/dm-thin-metadata.c | 8 drivers/net/ethernet/arc/emac_mdio.c | 1 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 drivers/net/ethernet/broadcom/tg3.c | 17 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 9 drivers/net/ethernet/mellanox/mlx4/mr.c | 2 drivers/net/ethernet/renesas/ravb_main.c | 110 +++--- drivers/net/usb/asix_common.c | 2 drivers/net/usb/dm9601.c | 4 drivers/net/usb/qmi_wwan.c | 8 drivers/nvdimm/nd.h | 1 drivers/nvme/target/core.c | 6 drivers/scsi/gdth.h | 3 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c | 23 - drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h | 10 drivers/vfio/pci/vfio_pci.c | 351 ++++++++++++++++++-- drivers/vfio/pci/vfio_pci_config.c | 51 ++ drivers/vfio/pci/vfio_pci_intrs.c | 14 drivers/vfio/pci/vfio_pci_private.h | 16 drivers/vfio/pci/vfio_pci_rdwr.c | 29 + drivers/vfio/vfio_iommu_type1.c | 36 +- drivers/xen/xenbus/xenbus_client.c | 10 fs/affs/amigaffs.c | 63 ++- fs/affs/file.c | 26 + fs/btrfs/ctree.c | 8 fs/btrfs/extent_io.c | 8 fs/btrfs/extent_io.h | 6 fs/btrfs/ioctl.c | 27 + fs/btrfs/volumes.c | 3 fs/ceph/file.c | 1 fs/eventpoll.c | 6 include/linux/blkdev.h | 42 +- include/linux/bvec.h | 9 include/linux/device-mapper.h | 2 include/linux/hid.h | 42 +- include/linux/ide.h | 1 include/linux/libata.h | 1 include/linux/log2.h | 2 include/linux/uaccess.h | 26 + include/net/inet_connection_sock.h | 4 include/net/netfilter/nf_tables.h | 2 include/uapi/linux/msdos_fs.h | 2 include/uapi/linux/netfilter/nf_tables.h | 2 mm/hugetlb.c | 26 + mm/maccess.c | 167 ++++++++- mm/slub.c | 12 net/batman-adv/bridge_loop_avoidance.c | 5 net/batman-adv/gateway_client.c | 6 net/core/dev.c | 3 net/core/netpoll.c | 2 net/ipv4/inet_connection_sock.c | 37 +- net/ipv4/inet_hashtables.c | 1 net/netfilter/nf_tables_api.c | 3 net/netfilter/nft_payload.c | 4 net/netlabel/netlabel_domainhash.c | 59 +-- net/sctp/socket.c | 16 net/wireless/reg.c | 3 scripts/checkpatch.pl | 4 sound/core/oss/mulaw.c | 4 sound/firewire/digi00x/digi00x.c | 5 sound/firewire/tascam/tascam.c | 30 + sound/pci/ca0106/ca0106_main.c | 3 tools/perf/Documentation/perf-record.txt | 4 tools/perf/Documentation/perf-stat.txt | 4 93 files changed, 1365 insertions(+), 397 deletions(-)
Al Viro (1):
fix regression in "epoll: Keep a reference on files added to the check list"
Alex Williamson (4):
vfio/type1: Support faulting PFNMAP vmas
vfio-pci: Fault mmaps to enable vma tracking
vfio-pci: Invalidate mmaps and block MMIO access on disabled memory vfio/pci: Fix SR-IOV VF handling with MMIO blocking
Amit Engel (1):
nvmet: Disable keep-alive timer when kato is cleared to 0h
Bart Van Assche (1):
block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h>
Bjørn Mork (1):
qmi_wwan: new Telewell and Sierra device IDs
Daniel Borkmann (1):
uaccess: Add non-pagefault user-space write function
Daniele Palmas (2):
net: usb: qmi_wwan: add Telit 0x1050 composition
drivers: net: usb: qmi_wwan: add QMI_QUIRK_SET_DTR for Telit PID 0x1201Dinghao Liu (2):
net: hns: Fix memleak in hns_nic_dev_probe
net: arc_emac: Fix memleak in arc_mdio_probe
Eugeniu Rosca (1):
mm: slub: fix conversion of freelist_corrupted()
Fabian Frederick (1):
fs/affs: use octal for permissions
Florian Fainelli (2):
MIPS: mm: BMIPS5000 has inclusive physical caches
MIPS: BMIPS: Also call bmips_cpu_setup() for secondary cores
Florian Westphal (1):
netfilter: nf_tables: fix destination register zeroing
Greg Kroah-Hartman (1):
Linux 4.9.236
Himadri Pandya (1):
net: usb: Fix uninit-was-stored issue in asix_read_phy_addr()
Jakub Kicinski (2):
bnxt: don't enable NAPI until rings are ready
net: disable netpoll on fresh napis
James Morse (4):
KVM: arm64: Add kvm_extable for vaxorcism code
KVM: arm64: Defer guest entry when an asynchronous exception is pending
KVM: arm64: Survive synchronous exceptions caused by AT instructions
KVM: arm64: Set HCR_EL2.PTW to prevent AT taking synchronous exception
Jason Gunthorpe (1):
include/linux/log2.h: add missing () around n in roundup_pow_of_two()
Jeff Layton (1):
ceph: don't allow setlease on cephfs
Johannes Berg (1):
cfg80211: regulatory: reject invalid hints
Josef Bacik (3):
btrfs: drop path before adding new uuid tree entry
btrfs: set the lockdep class for log tree extent buffers
btrfs: fix potential deadlock in the search ioctl
Jussi Kivilinna (1):
batman-adv: bla: use netif_rx_ni when not in interrupt context
Kamil Lorenc (1):
net: usb: dm9601: Add USB ID of Keenetic Plus DSL
Kim Phillips (1):
perf record/stat: Explicitly call out event modifiers in the documentation
Lu Baolu (1):
iommu/vt-d: Serialize IOMMU GCMD register modifications
Marc Zyngier (2):
HID: core: Correctly handle ReportSize being zero
HID: core: Sanitize event code and type when mapping input
Marek Szyprowski (1):
dmaengine: pl330: Fix burst length if burst size is smaller than bus width
Masami Hiramatsu (1):
uaccess: Add non-pagefault user-space read functions
Max Staudt (1):
affs: fix basic permission bits to actually work
Michael Chan (1):
tg3: Fix soft lockup when tg3_reset_task() fails.
Ming Lei (1):
block: allow for_each_bvec to support zero len bvec
Mrinal Pandey (1):
checkpatch: fix the usage of capture group ( ... )
Muchun Song (1):
mm/hugetlb: fix a race between hugetlb sysctl handlers
Nikolay Borisov (2):
btrfs: Remove redundant extent_buffer_get in get_old_root
btrfs: Remove extraneous extent_buffer_get from tree_mod_log_rewind
Pablo Neira Ayuso (2):
netfilter: nf_tables: add NFTA_SET_USERDATA if not null
netfilter: nf_tables: incorrect enum nft_list_attributes definition
Paul Moore (1):
netlabel: fix problems with mapping removal
Peter Ujfalusi (1):
dmaengine: of-dma: Fix of_dma_router_xlate's of_dma_xlate handling
Rogan Dawes (1):
usb: qmi_wwan: add D-Link DWM-222 A2 device ID
Shung-Hsi Yu (1):
net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init()
Simon Leiner (1):
xen/xenbus: Fix granting of vmalloc'd memory
Sven Eckelmann (1):
batman-adv: Avoid uninitialized chaddr when handling DHCP
Sven Schnelle (1):
s390: don't trace preemption in percpu macros
Takashi Iwai (1):
ALSA: pcm: oss: Remove superfluous WARN_ON() for mulaw sanity check
Takashi Sakamoto (2):
ALSA: firewire-digi00x: exclude Avid Adrenaline from detection ALSA; firewire-tascam: exclude Tascam FE-8 from detection
Tejun Heo (1):
libata: implement ATA_HORKAGE_MAX_TRIM_128M and apply to Sandisks
Tim Froidcoeur (2):
net: refactor bind_bucket fastreuse into helper
net: initialize fastreuse on inet_inherit_port
Tom Rix (1):
hwmon: (applesmc) check status earlier.
Tong Zhang (1):
ALSA: ca0106: fix error code handling
Tony Lindgren (1):
thermal: ti-soc-thermal: Fix bogus thermal shutdowns for omap4430
Vasundhara Volam (2):
bnxt_en: Check for zero dir entries in NVRAM.
bnxt_en: Fix PCI AER error recovery flow
Xin Long (1):
sctp: not disable bh in the whole sctp_get_port_local()
Ye Bin (2):
dm cache metadata: Avoid returning cmd->bm wild pointer on error
dm thin metadata: Avoid returning cmd->bm wild pointer on errorYu Kuai (1):
dmaengine: at_hdmac: check return value of of_find_device_by_node() in at_dma_xlate()
Yuusuke Ashizuka (1):
ravb: Fixed to be able to unload modules
Greg Kroah-Hartman
maintainerDocumentation/filesystems/affs.txt +10 -6
@@ -93,13 +93,15 @@ The Amiga protection flags RWEDRWEDHSPARWED are handled as follows: - R maps to r for user, group and others. On directories, R implies x. - - If both W and D are allowed, w will be set. + - W maps to w. - E maps to x. - - H and P are always retained and ignored under Linux. + - D is ignored. - - A is always reset when a file is written to. + - H, S and P are always retained and ignored under Linux. + + - A is cleared when a file is written to. User id and group id will be used unless set[gu]id are given as mount options. Since most of the Amiga file systems are single user systems
@@ -111,11 +113,13 @@ Linux -> Amiga: The Linux rwxrwxrwx file mode is handled as follows: - - r permission will set R for user, group and others. + - r permission will allow R for user, group and others. + + - w permission will allow W for user, group and others. - - w permission will set W and D for user, group and others. + - x permission of the user will allow E for plain files. - - x permission of the user will set E for plain files. + - D will be allowed for user, group and others. - All other flags (suid, sgid, ...) are ignored and will not be retained.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 235 +SUBLEVEL = 236 EXTRAVERSION = NAME = Roaring Lionus
arch/arm64/include/asm/kvm_arm.h +2 -1
@@ -78,10 +78,11 @@* IMO: Override CPSR.I and enable signaling with VI * FMO: Override CPSR.F and enable signaling with VF * SWIO: Turn set/way invalidates into set/way clean+invalidate +* PTW: Take a stage2 fault if a stage1 walk steps in device memory */ #define HCR_GUEST_FLAGS (HCR_TSC | HCR_TSW | HCR_TWE | HCR_TWI | HCR_VM | \ HCR_TVM | HCR_BSU_IS | HCR_FB | HCR_TAC | \ - HCR_AMO | HCR_SWIO | HCR_TIDCP | HCR_RW) + HCR_AMO | HCR_SWIO | HCR_TIDCP | HCR_RW | HCR_PTW)#define HCR_VIRT_EXCP_MASK (HCR_VSE | HCR_VI | HCR_VF)#define HCR_INT_OVERRIDE (HCR_FMO | HCR_IMO)#define HCR_HOST_NVHE_FLAGS (HCR_RW | HCR_API | HCR_APK)
arch/arm64/include/asm/kvm_asm.h +43 -0
55 lines not on this page · raw message
arch/arm64/kernel/vmlinux.lds.S +8 -0
@@ -23,6 +23,13 @@ ENTRY(_text) jiffies = jiffies_64; + +#define HYPERVISOR_EXTABLE \ + . = ALIGN(SZ_8); \ + VMLINUX_SYMBOL(__start___kvm_ex_table) = .; \ + *(__kvm_ex_table) \ + VMLINUX_SYMBOL(__stop___kvm_ex_table) = .; + #define HYPERVISOR_TEXT \ /* \ * Align to 4 KB so that \
@@ -38,6 +45,7 @@ jiffies = jiffies_64; VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \ VMLINUX_SYMBOL(__hyp_text_start) = .; \ *(.hyp.text) \ + HYPERVISOR_EXTABLE \ VMLINUX_SYMBOL(__hyp_text_end) = .; #define IDMAP_TEXT \
arch/arm64/kvm/hyp/entry.S +20 -6
@@ -17,6 +17,7 @@ #include <linux/linkage.h> +#include <asm/alternative.h> #include <asm/asm-offsets.h> #include <asm/assembler.h> #include <asm/fpsimdmacros.h>
@@ -62,6 +63,15 @@ ENTRY(__guest_enter) // Store the host regs save_callee_saved_regs x1 + // Now the host state is stored if we have a pending RAS SError it must + // affect the host. If any asynchronous exception is pending we defer + // the guest entry. + mrs x1, isr_el1 + cbz x1, 1f + mov x0, #ARM_EXCEPTION_IRQ + ret + +1: add x18, x0, #VCPU_CONTEXT // Restore guest regs x0-x17
@@ -135,18 +145,22 @@ ENTRY(__guest_exit) // This is our single instruction exception window. A pending // SError is guaranteed to occur at the earliest when we unmask // it, and at the latest just after the ISB. - .global abort_guest_exit_start abort_guest_exit_start: isb - .global abort_guest_exit_end abort_guest_exit_end: + msr daifset, #4 // Mask aborts + ret + + _kvm_extable abort_guest_exit_start, 9997f + _kvm_extable abort_guest_exit_end, 9997f +9997: + msr daifset, #4 // Mask aborts + mov x0, #(1 << ARM_EXIT_WITH_SERROR_BIT) - // If the exception took place, restore the EL1 exception - // context so that we can report some information. - // Merge the exception code with the SError pending bit. - tbz x0, #ARM_EXIT_WITH_SERROR_BIT, 1f + // restore the EL1 exception context so that we can report some + // information. Merge the exception code with the SError pending bit. msr elr_el2, x2 msr esr_el2, x3 msr spsr_el2, x4
arch/arm64/kvm/hyp/hyp-entry.S +42 -21
88 lines not on this page · raw message
arch/arm64/kvm/hyp/switch.c +35 -4
@@ -25,6 +25,10 @@#include <asm/kvm_asm.h> #include <asm/kvm_emulate.h> #include <asm/kvm_hyp.h> +#include <asm/uaccess.h> + +extern struct exception_table_entry __start___kvm_ex_table; +extern struct exception_table_entry __stop___kvm_ex_table; static bool __hyp_text __fpsimd_enabled_nvhe(void) {
@@ -202,10 +206,10 @@ static bool __hyp_text __translate_far_to_hpfar(u64 far, u64 *hpfar)* saved the guest context yet, and we may return early... */ par =read_sysreg (par_el1); - asmvolatile ("at s1e1r, %0" : :"r" (far)); -isb (); - - tmp =read_sysreg (par_el1); +if (!__kvm_at ("s1e1r" , far)) + tmp =read_sysreg (par_el1); +else + tmp =1 ;/* back to the guest */ write_sysreg (par, par_el1);if (unlikely (tmp &1 ))
@@ -454,3 +458,30 @@ void __hyp_text __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt)unreachable (); } + +asmlinkage void __hyp_text kvm_unexpected_el2_exception(void) +{ +unsigned long addr, fixup; +struct kvm_cpu_context *host_ctxt; +struct exception_table_entry *entry, *end; +unsigned long elr_el2 =read_sysreg (elr_el2); + + entry =hyp_symbol_addr (__start___kvm_ex_table); + end =hyp_symbol_addr (__stop___kvm_ex_table); + host_ctxt =__hyp_this_cpu_ptr (kvm_host_cpu_state); + +while (entry < end) { + addr = (unsigned long )&entry->insn + entry->insn; + fixup = (unsigned long )&entry->fixup + entry->fixup; + +if (addr != elr_el2) { + entry++; +continue ; + } + +write_sysreg (fixup, elr_el2); +return ; + } + +hyp_panic (host_ctxt); +}
arch/mips/kernel/smp-bmips.c +2 -0
@@ -236,6 +236,8 @@ static void bmips_boot_secondary(int cpu, struct task_struct *idle)*/ static void bmips_init_secondary (void ) { +bmips_cpu_setup (); +switch (current_cpu_type ()) {case CPU_BMIPS4350 :case CPU_BMIPS4380 :
arch/mips/mm/c-r4k.c +4 -0
@@ -1746,7 +1746,11 @@ static void setup_scache(void)printk ("MIPS secondary cache %ldkB, %s, linesize %d bytes.\n" , scache_size >>10 , way_string[c->scache.ways], c->scache.linesz); + +if (current_cpu_type () ==CPU_BMIPS5000 ) + c->options |= MIPS_CPU_INCLUSIVE_CACHES; } +#else if (!(c->scache.flags &MIPS_CACHE_NOT_PRESENT ))panic ("Dunno how to handle MIPS32 / MIPS64 second level cache" );
arch/s390/include/asm/percpu.h +14 -14
@@ -28,7 +28,7 @@typedef typeof (pcp)pcp_op_T__ ; \pcp_op_T__ old__, new__, prev__; \pcp_op_T__ *ptr__; \ -preempt_disable (); \ +preempt_disable_notrace (); \ ptr__ =raw_cpu_ptr (&(pcp)); \ prev__ = *ptr__; \ do { \
@@ -36,7 +36,7 @@ new__ = old__ op (val); \ prev__ =cmpxchg (ptr__, old__, new__); \ }while (prev__ != old__); \ -preempt_enable (); \ +preempt_enable_notrace (); \ new__; \ })
@@ -67,7 +67,7 @@typedef typeof (pcp)pcp_op_T__ ; \pcp_op_T__ val__ = (val); \pcp_op_T__ old__, *ptr__; \ -preempt_disable (); \ +preempt_disable_notrace (); \ ptr__ =raw_cpu_ptr (&(pcp)); \if (__builtin_constant_p (val__) && \ ((szcast )val__ >-129 ) && ((szcast )val__ <128 )) { \
@@ -83,7 +83,7 @@ : [val__] "d" (val__) \ : "cc"); \ } \ -preempt_enable (); \ +preempt_enable_notrace (); \ }#define this_cpu_add_4 (pcp, val) arch_this_cpu_add(pcp, val, "laa", "asi", int)
@@ -94,14 +94,14 @@typedef typeof (pcp)pcp_op_T__ ; \pcp_op_T__ val__ = (val); \pcp_op_T__ old__, *ptr__; \ -preempt_disable (); \ +preempt_disable_notrace (); \ ptr__ =raw_cpu_ptr (&(pcp)); \ asmvolatile ( \ op" %[old__],%[val__],%[ptr__]\n" \ : [old__]"=d" (old__), [ptr__]"+Q" (*ptr__) \ : [val__]"d" (val__) \ :"cc" ); \ -preempt_enable (); \ +preempt_enable_notrace (); \ old__ + val__; \ })
@@ -113,14 +113,14 @@typedef typeof (pcp)pcp_op_T__ ; \pcp_op_T__ val__ = (val); \pcp_op_T__ old__, *ptr__; \ -preempt_disable (); \ +preempt_disable_notrace (); \ ptr__ =raw_cpu_ptr (&(pcp)); \ asmvolatile ( \ op" %[old__],%[val__],%[ptr__]\n" \ : [old__]"=d" (old__), [ptr__]"+Q" (*ptr__) \ : [val__]"d" (val__) \ :"cc" ); \ -preempt_enable (); \ +preempt_enable_notrace (); \ }#define this_cpu_and_4 (pcp, val) arch_this_cpu_to_op(pcp, val, "lan")
@@ -135,10 +135,10 @@typedef typeof (pcp)pcp_op_T__ ; \pcp_op_T__ ret__; \pcp_op_T__ *ptr__; \ -preempt_disable (); \ +preempt_disable_notrace (); \ ptr__ =raw_cpu_ptr (&(pcp)); \ ret__ =cmpxchg (ptr__, oval, nval); \ -preempt_enable (); \ +preempt_enable_notrace (); \ ret__; \ })
@@ -151,10 +151,10 @@ ({ \typeof (pcp) *ptr__; \typeof (pcp) ret__; \ -preempt_disable (); \ +preempt_disable_notrace (); \ ptr__ =raw_cpu_ptr (&(pcp)); \ ret__ =xchg (ptr__, nval); \ -preempt_enable (); \ +preempt_enable_notrace (); \ ret__; \ })
@@ -170,11 +170,11 @@typeof (pcp1) *p1__; \typeof (pcp2) *p2__; \int ret__; \ -preempt_disable (); \ +preempt_disable_notrace (); \ p1__ =raw_cpu_ptr (&(pcp1)); \ p2__ =raw_cpu_ptr (&(pcp2)); \ ret__ =__cmpxchg_double (p1__, p2__, o1__, o2__, n1__, n2__); \ -preempt_enable (); \ +preempt_enable_notrace (); \ ret__; \ })
arch/xtensa/platforms/iss/simdisk.c +0 -1
@@ -21,7 +21,6 @@#include <platform/simcall.h> #define SIMDISK_MAJOR 240 -#define SECTOR_SHIFT 9#define SIMDISK_MINORS 1#define MAX_SIMDISK_COUNT 10
drivers/ata/libata-core.c +2 -3
@@ -4371,9 +4371,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {/* https://bugzilla.kernel.org/show_bug.cgi?id=15573 */ { "C300-CTFDDAC128MAG", "0001", ATA_HORKAGE_NONCQ, }, - /* Some Sandisk SSDs lock up hard with NCQ enabled. Reported on - SD7SN6S256G and SD8SN8U256G */ - { "SanDisk SD[78]SN*G", NULL, ATA_HORKAGE_NONCQ, }, + /* Sandisk SD7/8/9s lock up hard on large trims */ + { "SanDisk SD[789]*", NULL, ATA_HORKAGE_MAX_TRIM_128M, }, /* devices which puke on READ_NATIVE_MAX */ { "HDS724040KLSA80", "KFAOA20N", ATA_HORKAGE_BROKEN_HPA, },
drivers/ata/libata-scsi.c +7 -1
@@ -2314,6 +2314,7 @@ static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf)static unsigned int ata_scsiop_inq_b0 (struct ata_scsi_args *args,u8 *rbuf) { +struct ata_device *dev = args->dev;u16 min_io_sectors; rbuf[1 ] =0xb0 ;
@@ -2339,7 +2340,12 @@ static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args, u8 *rbuf)* with the unmap bit set. */ if (ata_id_has_trim (args->id)) { -put_unaligned_be64 (65535 *ATA_MAX_TRIM_RNUM , &rbuf[36 ]); +u64 max_blocks =65535 *ATA_MAX_TRIM_RNUM ; + +if (dev->horkage &ATA_HORKAGE_MAX_TRIM_128M ) + max_blocks =128 << (20 -SECTOR_SHIFT ); + +put_unaligned_be64 (max_blocks, &rbuf[36 ]);put_unaligned_be32 (1 , &rbuf[28 ]); }
drivers/block/brd.c +0 -1
@@ -25,7 +25,6 @@#include <asm/uaccess.h> -#define SECTOR_SHIFT 9#define PAGE_SECTORS_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)#define PAGE_SECTORS (1 << PAGE_SECTORS_SHIFT)
drivers/block/rbd.c +0 -9
@@ -50,15 +50,6 @@#define RBD_DEBUG /* Activate rbd_assert() calls */ -/* -* The basic unit of block I/O is a sector. It is interpreted in a -* number of contexts in Linux (blk, bio, genhd), but the default is -* universally 512 bytes. These symbols are just slightly more -* meaningful than the bare numbers they represent. -*/ -#define SECTOR_SHIFT 9 -#define SECTOR_SIZE (1ULL << SECTOR_SHIFT) -/* * Increment the given counter and return its updated value. * If the counter is already 0 it will not be incremented.
drivers/block/zram/zram_drv.h +0 -1
@@ -37,7 +37,6 @@ static const size_t max_zpage_size = PAGE_SIZE / 4 * 3;/*-- End of configurable params */ -#define SECTOR_SHIFT 9#define SECTORS_PER_PAGE_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)#define SECTORS_PER_PAGE (1 << SECTORS_PER_PAGE_SHIFT)#define ZRAM_LOGICAL_BLOCK_SHIFT 12
drivers/dma/at_hdmac.c +2 -0
@@ -1810,6 +1810,8 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,return NULL ; dmac_pdev =of_find_device_by_node (dma_spec->np); +if (!dmac_pdev) +return NULL ;dma_cap_zero (mask);dma_cap_set (DMA_SLAVE , mask);
drivers/dma/of-dma.c +4 -4
@@ -72,12 +72,12 @@ static struct dma_chan *of_dma_router_xlate(struct of_phandle_args *dma_spec,return NULL ; chan = ofdma_target->of_dma_xlate (&dma_spec_target, ofdma_target); -if (chan) { - chan->router = ofdma->dma_router; - chan->route_data = route_data; - }else { +if (IS_ERR_OR_NULL (chan)) { ofdma->dma_router->route_free (ofdma->dma_router->dev, route_data); + }else { + chan->router = ofdma->dma_router; + chan->route_data = route_data; }/*
drivers/dma/pl330.c +1 -1
@@ -2677,6 +2677,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,while (burst != (1 << desc->rqcfg.brst_size)) desc->rqcfg.brst_size++; + desc->rqcfg.brst_len =get_burst_len (desc, len);/* * If burst size is smaller than bus width then make sure we only * transfer one at a time to avoid a burst stradling an MFIFO entry.
@@ -2684,7 +2685,6 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,if (desc->rqcfg.brst_size *8 < pl330->pcfg.data_bus_width) desc->rqcfg.brst_len =1 ; - desc->rqcfg.brst_len =get_burst_len (desc, len); desc->bytes_requested = len; desc->txd.flags = flags;
drivers/hid/hid-core.c +13 -2
@@ -1406,6 +1406,17 @@ static void hid_output_field(const struct hid_device *hid, } } +/* +* Compute the size of a report. +*/ +static size_t hid_compute_report_size (struct hid_report *report) +{ +if (report->size) +return ((report->size -1 ) >>3 ) +1 ; + +return 0 ; +} +/* * Create a report. 'data' has to be allocated using * hid_alloc_report_buf() so that it has proper size.
@@ -1418,7 +1429,7 @@ void hid_output_report(struct hid_report *report, __u8 *data)if (report->id >0 ) *data++ = report->id; -memset (data,0 , ((report->size -1 ) >>3 ) +1 ); +memset (data,0 ,hid_compute_report_size (report));for (n =0 ; n < report->maxfield; n++)hid_output_field (report->device, report->field[n], data); }
@@ -1545,7 +1556,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, csize--; } - rsize = ((report->size -1 ) >>3 ) +1 ; + rsize =hid_compute_report_size (report);if (report_enum->numbered && rsize >=HID_MAX_BUFFER_SIZE ) rsize =HID_MAX_BUFFER_SIZE -1 ;
drivers/hid/hid-input.c +4 -0
@@ -1026,6 +1026,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel } mapped: +/* Mapping failed, bail out */ +if (!bit) +return ; +if (device->driver->input_mapped && device->driver->input_mapped (device, hidinput, field, usage, &bit, &max) <0 ) {
drivers/hid/hid-multitouch.c +2 -0
@@ -567,6 +567,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,case HID_UP_BUTTON : code =BTN_MOUSE + ((usage->hid -1 ) &HID_USAGE );hid_map_usage (hi, usage, bit, max,EV_KEY , code); +if (!*bit) +return -1 ;input_set_capability (hi->input,EV_KEY , code);return 1 ;
drivers/hwmon/applesmc.c +16 -15
@@ -758,15 +758,18 @@ static ssize_t applesmc_light_show(struct device *dev, } ret =applesmc_read_key (LIGHT_SENSOR_LEFT_KEY , buffer, data_length); +if (ret) + goto out;/* newer macbooks report a single 10-bit bigendian value */ if (data_length ==10 ) { left =be16_to_cpu (*(__be16 *)(buffer +6 )) >>2 ; goto out; } left = buffer[2 ]; + + ret =applesmc_read_key (LIGHT_SENSOR_RIGHT_KEY , buffer, data_length);if (ret) goto out; - ret =applesmc_read_key (LIGHT_SENSOR_RIGHT_KEY , buffer, data_length); right = buffer[2 ]; out:
@@ -814,12 +817,11 @@ static ssize_t applesmc_show_fan_speed(struct device *dev,sprintf (newkey, fan_speed_fmt[to_option (attr)],to_index (attr)); ret =applesmc_read_key (newkey, buffer,2 ); - speed = ((buffer[0 ] <<8 | buffer[1 ]) >>2 ); -if (ret)return ret; -else -return snprintf (sysfsbuf,PAGE_SIZE ,"%u\n" , speed); + + speed = ((buffer[0 ] <<8 | buffer[1 ]) >>2 ); +return snprintf (sysfsbuf,PAGE_SIZE ,"%u\n" , speed); } static ssize_t applesmc_store_fan_speed(struct device *dev,
@@ -854,12 +856,11 @@ static ssize_t applesmc_show_fan_manual(struct device *dev,u8 buffer[2 ]; ret =applesmc_read_key (FANS_MANUAL , buffer,2 ); - manual = ((buffer[0 ] <<8 | buffer[1 ]) >>to_index (attr)) &0x01 ; -if (ret)return ret; -else -return snprintf (sysfsbuf,PAGE_SIZE ,"%d\n" , manual); + + manual = ((buffer[0 ] <<8 | buffer[1 ]) >>to_index (attr)) &0x01 ; +return snprintf (sysfsbuf,PAGE_SIZE ,"%d\n" , manual); } static ssize_t applesmc_store_fan_manual(struct device *dev,
@@ -875,10 +876,11 @@ static ssize_t applesmc_store_fan_manual(struct device *dev,return -EINVAL ; ret =applesmc_read_key (FANS_MANUAL , buffer,2 ); - val = (buffer[0 ] <<8 | buffer[1 ]);if (ret) goto out; + val = (buffer[0 ] <<8 | buffer[1 ]); +if (input) val = val | (0x01 <<to_index (attr));else
@@ -954,13 +956,12 @@ static ssize_t applesmc_key_count_show(struct device *dev,u32 count; ret =applesmc_read_key (KEY_COUNT_KEY , buffer,4 ); - count = ((u32 )buffer[0 ]<<24 ) + ((u32 )buffer[1 ]<<16 ) + - ((u32 )buffer[2 ]<<8 ) + buffer[3 ]; -if (ret)return ret; -else -return snprintf (sysfsbuf,PAGE_SIZE ,"%d\n" , count); + + count = ((u32 )buffer[0 ]<<24 ) + ((u32 )buffer[1 ]<<16 ) + + ((u32 )buffer[2 ]<<8 ) + buffer[3 ]; +return snprintf (sysfsbuf,PAGE_SIZE ,"%d\n" , count); } static ssize_t applesmc_key_at_index_read_show(struct device *dev,
drivers/ide/ide-cd.c +4 -4
@@ -704,7 +704,7 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq)struct request_queue *q = drive->queue;int write =rq_data_dir (rq) ==WRITE ;unsigned short sectors_per_frame = -queue_logical_block_size (q) >>SECTOR_BITS ; +queue_logical_block_size (q) >>SECTOR_SHIFT ; ide_debug_log(IDE_DBG_RQ, "rq->cmd[0]: 0x%x, rq->cmd_flags: 0x%x, " "secs_per_frame: %u",
@@ -900,7 +900,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,* end up being bogus. */ blocklen =be32_to_cpu (capbuf.blocklen); - blocklen = (blocklen >>SECTOR_BITS ) <<SECTOR_BITS ; + blocklen = (blocklen >>SECTOR_SHIFT ) <<SECTOR_SHIFT ;switch (blocklen) {case 512 :case 1024 :
@@ -916,7 +916,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, } *capacity =1 +be32_to_cpu (capbuf.lba); - *sectors_per_frame = blocklen >>SECTOR_BITS ; + *sectors_per_frame = blocklen >>SECTOR_SHIFT ;ide_debug_log (IDE_DBG_PROBE ,"cap: %lu, sectors_per_frame: %lu" , *capacity, *sectors_per_frame);
@@ -993,7 +993,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) drive->probed_capacity = toc->capacity * sectors_per_frame;blk_queue_logical_block_size (drive->queue, - sectors_per_frame <<SECTOR_BITS ); + sectors_per_frame <<SECTOR_SHIFT );/* first read just the header, so we know how long the TOC is */ stat = cdrom_read_tocentry(drive, 0, 1, 0, (char *) &toc->hdr,
drivers/ide/ide-cd.h +1 -5
@@ -20,11 +20,7 @@/************************************************************************/ -#define SECTOR_BITS 9 -#ifndef SECTOR_SIZE -#define SECTOR_SIZE (1 << SECTOR_BITS) -#endif -#define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS) +#define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_SHIFT)#define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)/* Capabilities Page size including 8 bytes of Mode Page Header */
drivers/iommu/intel_irq_remapping.c +8 -2
@@ -486,12 +486,18 @@ static void iommu_enable_irq_remapping(struct intel_iommu *iommu)/* Enable interrupt-remapping */ iommu->gcmd |=DMA_GCMD_IRE ; - iommu->gcmd &= ~DMA_GCMD_CFI ;/* Block compatibility-format MSIs */ writel (iommu->gcmd, iommu->reg +DMAR_GCMD_REG ); -IOMMU_WAIT_OP (iommu,DMAR_GSTS_REG , readl, (sts &DMA_GSTS_IRES ), sts); +/* Block compatibility-format MSIs */ +if (sts &DMA_GSTS_CFIS ) { + iommu->gcmd &= ~DMA_GCMD_CFI ; +writel (iommu->gcmd, iommu->reg +DMAR_GCMD_REG ); +IOMMU_WAIT_OP (iommu,DMAR_GSTS_REG , + readl, !(sts &DMA_GSTS_CFIS ), sts); + } +/* * With CFI clear in the Global Command register, we should be * protected from dangerous (i.e. compatibility) interrupts
drivers/md/dm-cache-metadata.c +6 -2
@@ -508,12 +508,16 @@ static int __create_persistent_data_objects(struct dm_cache_metadata *cmd, CACHE_MAX_CONCURRENT_LOCKS);if (IS_ERR (cmd->bm)) {DMERR ("could not create block manager" ); -return PTR_ERR (cmd->bm); + r =PTR_ERR (cmd->bm); + cmd->bm =NULL ; +return r; } r =__open_or_format_metadata (cmd, may_format_device); -if (r) +if (r) {dm_block_manager_destroy (cmd->bm); + cmd->bm =NULL ; + }return r; }
drivers/md/dm-thin-metadata.c +6 -2
@@ -700,12 +700,16 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, bool f THIN_MAX_CONCURRENT_LOCKS);if (IS_ERR (pmd->bm)) {DMERR ("could not create block manager" ); -return PTR_ERR (pmd->bm); + r =PTR_ERR (pmd->bm); + pmd->bm =NULL ; +return r; } r =__open_or_format_metadata (pmd, format_device); -if (r) +if (r) {dm_block_manager_destroy (pmd->bm); + pmd->bm =NULL ; + }return r; }
drivers/net/ethernet/arc/emac_mdio.c +1 -0
@@ -152,6 +152,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)if (IS_ERR (data->reset_gpio)) { error =PTR_ERR (data->reset_gpio);dev_err (priv->dev,"Failed to request gpio: %d\n" , error); +mdiobus_free (bus);return error; }
drivers/net/ethernet/broadcom/bnxt/bnxt.c +6 -6
@@ -5589,14 +5589,14 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init) } } -bnxt_enable_napi (bp); - rc =bnxt_init_nic (bp, irq_re_init);if (rc) {netdev_err (bp->dev,"bnxt_init_nic err: %x\n" , rc); - goto open_err; + goto open_err_irq; } +bnxt_enable_napi (bp); +if (link_re_init) {mutex_lock (&bp->link_lock); rc =bnxt_update_phy_setting (bp);
@@ -5618,9 +5618,6 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)return 0 ; -open_err: -bnxt_disable_napi (bp); - open_err_irq:bnxt_del_napi (bp);
@@ -7085,6 +7082,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)bnxt_parse_log_pcie_link (bp); +pci_save_state (pdev);return 0 ; init_err:
@@ -7158,6 +7156,8 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) "Cannot re-enable PCI device after reset.\n"); }else {pci_set_master (pdev); +pci_restore_state (pdev); +pci_save_state (pdev);if (netif_running (netdev)) err =bnxt_open (netdev);
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +3 -0
@@ -1457,6 +1457,9 @@ static int bnxt_get_nvram_directory(struct net_device *dev, u32 len, u8 *data)if (rc !=0 )return rc; +if (!dir_entries || !entry_length) +return -EIO ; +/* Insert 2 bytes of directory info (count and size of entries) */ if (len <2 )return -EINVAL ;
drivers/net/ethernet/broadcom/tg3.c +13 -4
@@ -7201,8 +7201,8 @@ static inline void tg3_reset_task_schedule(struct tg3 *tp)static inline void tg3_reset_task_cancel (struct tg3 *tp) { -cancel_work_sync (&tp->reset_task); -tg3_flag_clear (tp,RESET_TASK_PENDING ); +if (test_and_clear_bit (TG3_FLAG_RESET_TASK_PENDING , tp->tg3_flags)) +cancel_work_sync (&tp->reset_task);tg3_flag_clear (tp,TX_RECOVERY_PENDING ); }
@@ -11174,18 +11174,27 @@ static void tg3_reset_task(struct work_struct *work)tg3_halt (tp,RESET_KIND_SHUTDOWN ,0 ); err =tg3_init_hw (tp, true); -if (err) +if (err) { +tg3_full_unlock (tp); + tp->irq_sync =0 ; +tg3_napi_enable (tp); +/* Clear this flag so that tg3_reset_task_cancel() will not +* call cancel_work_sync() and wait forever. +*/ +tg3_flag_clear (tp,RESET_TASK_PENDING ); +dev_close (tp->dev); goto out; + }tg3_netif_start (tp); -out:tg3_full_unlock (tp);if (!err)tg3_phy_start (tp);tg3_flag_clear (tp,RESET_TASK_PENDING ); +out:rtnl_unlock (); }
drivers/net/ethernet/hisilicon/hns/hns_enet.c +6 -3
@@ -1990,8 +1990,10 @@ static int hns_nic_dev_probe(struct platform_device *pdev) priv->enet_ver =AE_VERSION_1 ; else if (acpi_dev_found(hns_enet_acpi_match[1].id)) priv->enet_ver = AE_VERSION_2; - else - return -ENXIO; + else { + ret = -ENXIO ; + goto out_read_prop_fail; + }/* try to find port-idx-in-ae first */ ret = acpi_node_get_property_reference(dev->fwnode,
@@ -2003,7 +2005,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev) priv->fwnode =acpi_fwnode_handle (args.adev); }else {dev_err (dev,"cannot read cfg data from OF or acpi\n" ); -return -ENXIO ; + ret = -ENXIO ; + goto out_read_prop_fail; } ret =device_property_read_u32 (dev,"port-idx-in-ae" , &port_id);
drivers/net/ethernet/mellanox/mlx4/mr.c +1 -1
@@ -114,7 +114,7 @@ static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order) goto err_out;for (i =0 ; i <= buddy->max_order; ++i) { - s =BITS_TO_LONGS (1 << (buddy->max_order - i)); + s =BITS_TO_LONGS (1UL << (buddy->max_order - i)); buddy->bits[i] =kcalloc (s,sizeof (long ),GFP_KERNEL | __GFP_NOWARN);if (!buddy->bits[i]) { buddy->bits[i] =vzalloc (s *sizeof (long ));
drivers/net/ethernet/renesas/ravb_main.c +55 -55
158 lines not on this page · raw message
drivers/net/usb/asix_common.c +1 -1
@@ -277,7 +277,7 @@ int asix_read_phy_addr(struct usbnet *dev, int internal)netdev_dbg (dev->net,"asix_get_phy_addr()\n" ); -if (ret <0 ) { +if (ret <2 ) {netdev_err (dev->net,"Error reading PHYID register: %02x\n" , ret); goto out; }
drivers/net/usb/dm9601.c +4 -0
@@ -624,6 +624,10 @@ static const struct usb_device_id products[] = { USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */ .driver_info = (unsigned long)&dm9601_info, }, + { + USB_DEVICE(0x0586, 0x3427), /* ZyXEL Keenetic Plus DSL xDSL modem */ + .driver_info = (unsigned long)&dm9601_info, + }, {}, // END };
drivers/net/usb/qmi_wwan.c +7 -1
@@ -890,6 +890,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ + {QMI_FIXED_INTF(0x2001, 0x7e3d, 4)}, /* D-Link DWM-222 A2 */ {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */ {QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */ {QMI_FIXED_INTF(0x2020, 0x2060, 4)}, /* BroadMobi BM818 */
@@ -910,6 +911,8 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */ {QMI_FIXED_INTF(0x1199, 0x9057, 8)}, {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */ + {QMI_FIXED_INTF(0x1199, 0x9063, 8)}, /* Sierra Wireless EM7305 */ + {QMI_FIXED_INTF(0x1199, 0x9063, 10)}, /* Sierra Wireless EM7305 */ {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */ {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx */ {QMI_FIXED_INTF(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */
@@ -923,10 +926,13 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */ + {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */ {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */ {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */ {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ - {QMI_FIXED_INTF(0x1bc7, 0x1201, 2)}, /* Telit LE920 */ + {QMI_QUIRK_SET_DTR(0x1bc7, 0x1201, 2)}, /* Telit LE920, LE920A4 */ + {QMI_FIXED_INTF(0x1c9e, 0x9801, 3)}, /* Telewell TW-3G HSPA+ */ + {QMI_FIXED_INTF(0x1c9e, 0x9803, 4)}, /* Telewell TW-3G HSPA+ */ {QMI_FIXED_INTF(0x1c9e, 0x9b01, 3)}, /* XS Stick W100-2 from 4G Systems */ {QMI_FIXED_INTF(0x0b3c, 0xc000, 4)}, /* Olivetti Olicard 100 */ {QMI_FIXED_INTF(0x0b3c, 0xc001, 4)}, /* Olivetti Olicard 120 */
drivers/nvdimm/nd.h +0 -1
@@ -29,7 +29,6 @@ enum {* BTT instance */ ND_MAX_LANES =256 , -SECTOR_SHIFT =9 , INT_LBASIZE_ALIGNMENT = 64, };
drivers/nvme/target/core.c +6 -0
@@ -205,6 +205,9 @@ static void nvmet_keep_alive_timer(struct work_struct *work)static void nvmet_start_keep_alive_timer (struct nvmet_ctrl *ctrl) { +if (unlikely (ctrl->kato ==0 )) +return ; +pr_debug ("ctrl %d start keep-alive timer for %d secs\n" , ctrl->cntlid, ctrl->kato);
@@ -214,6 +217,9 @@ static void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl)static void nvmet_stop_keep_alive_timer (struct nvmet_ctrl *ctrl) { +if (unlikely (ctrl->kato ==0 )) +return ; +pr_debug ("ctrl %d stop keep-alive\n" , ctrl->cntlid);cancel_delayed_work_sync (&ctrl->ka_work);
drivers/scsi/gdth.h +0 -3
@@ -177,9 +177,6 @@#define MSG_SIZE 34/* size of message structure */ #define MSG_REQUEST 0/* async. event: message */ -/* cacheservice defines */ -#define SECTOR_SIZE 0x200/* always 512 bytes per sec. */ -/* DPMEM constants */ #define DPMEM_MAGIC 0xC0FFEE11#define IC_HEADER_BYTES 48
drivers/thermal/ti-soc-thermal/omap4-thermal-data.c +12 -11
@@ -49,20 +49,21 @@ static struct temp_sensor_data omap4430_mpu_temp_sensor_data = {/* * Temperature values in milli degree celsius -* ADC code values from 530 to 923 +* ADC code values from 13 to 107, see TRM +* "18.4.10.2.3 ADC Codes Versus Temperature". */ static const int omap4430_adc_to_temp[OMAP4430_ADC_END_VALUE -OMAP4430_ADC_START_VALUE +1 ] = { --38000 ,-35000 ,-34000 ,-32000 ,-30000 ,-28000 ,-26000 ,-24000 ,-22000 , --20000 ,-18000 ,-17000 ,-15000 ,-13000 ,-12000 ,-10000 ,-8000 ,-6000 , --5000 ,-3000 ,-1000 ,0 ,2000 ,3000 ,5000 ,6000 ,8000 ,10000 ,12000 , -13000 ,15000 ,17000 ,19000 ,21000 ,23000 ,25000 ,27000 ,28000 ,30000 , -32000 ,33000 ,35000 ,37000 ,38000 ,40000 ,42000 ,43000 ,45000 ,47000 , -48000 ,50000 ,52000 ,53000 ,55000 ,57000 ,58000 ,60000 ,62000 ,64000 , -66000 ,68000 ,70000 ,71000 ,73000 ,75000 ,77000 ,78000 ,80000 ,82000 , -83000 ,85000 ,87000 ,88000 ,90000 ,92000 ,93000 ,95000 ,97000 ,98000 , -100000 ,102000 ,103000 ,105000 ,107000 ,109000 ,111000 ,113000 ,115000 , -117000 ,118000 ,120000 ,122000 ,123000 , +-40000 ,-38000 ,-35000 ,-34000 ,-32000 ,-30000 ,-28000 ,-26000 ,-24000 , +-22000 ,-20000 ,-18500 ,-17000 ,-15000 ,-13500 ,-12000 ,-10000 ,-8000 , +-6500 ,-5000 ,-3500 ,-1500 ,0 ,2000 ,3500 ,5000 ,6500 ,8500 ,10000 , +12000 ,13500 ,15000 ,17000 ,19000 ,21000 ,23000 ,25000 ,27000 ,28500 , +30000 ,32000 ,33500 ,35000 ,37000 ,38500 ,40000 ,42000 ,43500 ,45000 , +47000 ,48500 ,50000 ,52000 ,53500 ,55000 ,57000 ,58500 ,60000 ,62000 , +64000 ,66000 ,68000 ,70000 ,71500 ,73500 ,75000 ,77000 ,78500 ,80000 , +82000 ,83500 ,85000 ,87000 ,88500 ,90000 ,92000 ,93500 ,95000 ,97000 , +98500 ,100000 ,102000 ,103500 ,105000 ,107000 ,109000 ,111000 ,113000 , +115000 ,117000 ,118500 ,120000 ,122000 ,123500 ,125000 , };/* OMAP4430 data */
drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h +7 -3
@@ -67,9 +67,13 @@* and thresholds for OMAP4430. */ -/* ADC conversion table limits */ -#define OMAP4430_ADC_START_VALUE 0 -#define OMAP4430_ADC_END_VALUE 127 +/* +* ADC conversion table limits. Ignore values outside the TRM listed +* range to avoid bogus thermal shutdowns. See omap4430 TRM chapter +* "18.4.10.2.3 ADC Codes Versus Temperature". +*/ +#define OMAP4430_ADC_START_VALUE 13 +#define OMAP4430_ADC_END_VALUE 107/* bandgap clock limits (no control on 4430) */ #define OMAP4430_MAX_FREQ 32768#define OMAP4430_MIN_FREQ 32768
drivers/vfio/pci/vfio_pci.c +324 -27
452 lines not on this page · raw message
drivers/vfio/pci/vfio_pci_config.c +45 -6
100 lines not on this page · raw message
drivers/vfio/pci/vfio_pci_intrs.c +14 -0
@@ -252,6 +252,7 @@ static int vfio_msi_enable(struct vfio_pci_device *vdev, int nvec, bool msix)struct pci_dev *pdev = vdev->pdev;unsigned int flag = msix ?PCI_IRQ_MSIX :PCI_IRQ_MSI ;int ret; +u16 cmd;if (!is_irq_none (vdev))return -EINVAL ;
@@ -261,13 +262,16 @@ static int vfio_msi_enable(struct vfio_pci_device *vdev, int nvec, bool msix)return -ENOMEM ;/* return the number of supported vectors if we can't get all: */ + cmd =vfio_pci_memory_lock_and_enable (vdev); ret =pci_alloc_irq_vectors (pdev,1 , nvec, flag);if (ret < nvec) {if (ret >0 )pci_free_irq_vectors (pdev); +vfio_pci_memory_unlock_and_restore (vdev, cmd);kfree (vdev->ctx);return ret; } +vfio_pci_memory_unlock_and_restore (vdev, cmd); vdev->num_ctx = nvec; vdev->irq_type = msix ? VFIO_PCI_MSIX_IRQ_INDEX :
@@ -290,6 +294,7 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_device *vdev,struct pci_dev *pdev = vdev->pdev;struct eventfd_ctx *trigger;int irq, ret; +u16 cmd;if (vector <0 || vector >= vdev->num_ctx)return -EINVAL ;
@@ -298,7 +303,11 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_device *vdev,if (vdev->ctx[vector].trigger) {irq_bypass_unregister_producer (&vdev->ctx[vector].producer); + + cmd =vfio_pci_memory_lock_and_enable (vdev);free_irq (irq, vdev->ctx[vector].trigger); +vfio_pci_memory_unlock_and_restore (vdev, cmd); +kfree (vdev->ctx[vector].name);eventfd_ctx_put (vdev->ctx[vector].trigger); vdev->ctx[vector].trigger =NULL ;
@@ -326,6 +335,7 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_device *vdev,* such a reset it would be unsuccessful. To avoid this, restore the * cached value of the message prior to enabling. */ + cmd =vfio_pci_memory_lock_and_enable (vdev);if (msix) {struct msi_msg msg;
@@ -335,6 +345,7 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_device *vdev, ret =request_irq (irq, vfio_msihandler,0 , vdev->ctx[vector].name, trigger); +vfio_pci_memory_unlock_and_restore (vdev, cmd);if (ret) {kfree (vdev->ctx[vector].name);eventfd_ctx_put (trigger);
@@ -379,6 +390,7 @@ static void vfio_msi_disable(struct vfio_pci_device *vdev, bool msix) {struct pci_dev *pdev = vdev->pdev;int i; +u16 cmd;for (i =0 ; i < vdev->num_ctx; i++) {vfio_virqfd_disable (&vdev->ctx[i].unmask);
@@ -387,7 +399,9 @@ static void vfio_msi_disable(struct vfio_pci_device *vdev, bool msix)vfio_msi_set_block (vdev,0 , vdev->num_ctx,NULL , msix); + cmd =vfio_pci_memory_lock_and_enable (vdev);pci_free_irq_vectors (pdev); +vfio_pci_memory_unlock_and_restore (vdev, cmd);/* * Both disable paths above use pci_intx_for_msi() to clear DisINTx
drivers/vfio/pci/vfio_pci_private.h +16 -0
@@ -63,6 +63,11 @@ struct vfio_pci_dummy_resource {struct list_head res_next; }; +struct vfio_pci_mmap_vma { +struct vm_area_struct *vma; +struct list_head vma_next; +}; +struct vfio_pci_device {struct pci_dev *pdev;void __iomem *barmap[PCI_STD_RESOURCE_END +1 ];
@@ -95,6 +100,9 @@ struct vfio_pci_device {struct eventfd_ctx *err_trigger;struct eventfd_ctx *req_trigger;struct list_head dummy_resources_list; +struct mutex vma_lock; +struct list_head vma_list; +struct rw_semaphore memory_lock; };#define is_intx (vdev) (vdev->irq_type == VFIO_PCI_INTX_IRQ_INDEX)
@@ -130,6 +138,14 @@ extern int vfio_pci_register_dev_region(struct vfio_pci_device *vdev, unsigned int type, unsigned int subtype, const struct vfio_pci_regops *ops, size_t size, u32 flags, void *data); + +extern bool __vfio_pci_memory_enabled (struct vfio_pci_device *vdev); +extern void vfio_pci_zap_and_down_write_memory_lock (struct vfio_pci_device + *vdev); +extern u16 vfio_pci_memory_lock_and_enable (struct vfio_pci_device *vdev); +extern void vfio_pci_memory_unlock_and_restore (struct vfio_pci_device *vdev, +u16 cmd); +#ifdef CONFIG_VFIO_PCI_IGD extern int vfio_pci_igd_init (struct vfio_pci_device *vdev);#else
drivers/vfio/pci/vfio_pci_rdwr.c +21 -8
@@ -122,6 +122,7 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_device *vdev, char __user *buf,size_t x_start =0 , x_end =0 ;resource_size_t end;void __iomem *io; +struct resource *res = &vdev->pdev->resource[bar];ssize_t done;if (pci_resource_start (pdev, bar))
@@ -137,6 +138,14 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_device *vdev, char __user *buf, count =min (count, (size_t )(end - pos)); +if (res->flags &IORESOURCE_MEM ) { +down_read (&vdev->memory_lock); +if (!__vfio_pci_memory_enabled (vdev)) { +up_read (&vdev->memory_lock); +return -EIO ; + } + } +if (bar ==PCI_ROM_RESOURCE ) {/* * The ROM can fill less space than the BAR, so we start the
@@ -144,20 +153,21 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_device *vdev, char __user *buf,* filling large ROM BARs much faster. */ io =pci_map_rom (pdev, &x_start); -if (!io) -return -ENOMEM ; +if (!io) { + done = -ENOMEM ; + goto out; + } x_end = end; }else if (!vdev->barmap[bar]) { -int ret; - - ret =pci_request_selected_regions (pdev,1 << bar,"vfio" ); -if (ret) -return ret; + done =pci_request_selected_regions (pdev,1 << bar,"vfio" ); +if (done) + goto out; io =pci_iomap (pdev, bar,0 );if (!io) {pci_release_selected_regions (pdev,1 << bar); -return -ENOMEM ; + done = -ENOMEM ; + goto out; } vdev->barmap[bar] = io;
@@ -176,6 +186,9 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_device *vdev, char __user *buf,if (bar ==PCI_ROM_RESOURCE )pci_unmap_rom (pdev, io); +out: +if (res->flags &IORESOURCE_MEM ) +up_read (&vdev->memory_lock);return done; }
drivers/vfio/vfio_iommu_type1.c +33 -3
@@ -213,6 +213,32 @@ static int put_pfn(unsigned long pfn, int prot)return 0 ; } +static int follow_fault_pfn (struct vm_area_struct *vma,struct mm_struct *mm, +unsigned long vaddr,unsigned long *pfn, +bool write_fault) +{ +int ret; + + ret =follow_pfn (vma, vaddr, pfn); +if (ret) { +bool unlocked = false; + + ret =fixup_user_fault (NULL , mm, vaddr, +FAULT_FLAG_REMOTE | + (write_fault ?FAULT_FLAG_WRITE :0 ), + &unlocked); +if (unlocked) +return -EAGAIN ; + +if (ret) +return ret; + + ret =follow_pfn (vma, vaddr, pfn); + } + +return ret; +} +static int vaddr_get_pfn (unsigned long vaddr,int prot,unsigned long *pfn) {struct page *page[1 ];
@@ -226,12 +252,16 @@ static int vaddr_get_pfn(unsigned long vaddr, int prot, unsigned long *pfn)down_read (¤t->mm->mmap_sem); +retry: vma =find_vma_intersection (current->mm, vaddr, vaddr +1 );if (vma && vma->vm_flags &VM_PFNMAP ) { -if (!follow_pfn (vma, vaddr, pfn) && -is_invalid_reserved_pfn (*pfn)) - ret =0 ; + ret =follow_fault_pfn (vma, current->mm, vaddr, pfn, prot &IOMMU_WRITE ); +if (ret == -EAGAIN ) + goto retry; + +if (!ret && !is_invalid_reserved_pfn (*pfn)) + ret = -EFAULT ; }up_read (¤t->mm->mmap_sem);
drivers/xen/xenbus/xenbus_client.c +8 -2
@@ -384,8 +384,14 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr,int i, j;for (i =0 ; i < nr_pages; i++) { - err =gnttab_grant_foreign_access (dev->otherend_id, -virt_to_gfn (vaddr),0 ); +unsigned long gfn; + +if (is_vmalloc_addr (vaddr)) + gfn =pfn_to_gfn (vmalloc_to_pfn (vaddr)); +else + gfn =virt_to_gfn (vaddr); + + err =gnttab_grant_foreign_access (dev->otherend_id, gfn,0 );if (err <0 ) {xenbus_dev_fatal (dev, err,"granting access to ring page" );
fs/affs/amigaffs.c +45 -18
92 lines not on this page · raw message
fs/affs/file.c +25 -1
@@ -427,6 +427,24 @@ static int affs_write_begin(struct file *file, struct address_space *mapping,return ret; } +static int affs_write_end (struct file *file,struct address_space *mapping, +loff_t pos,unsigned int len,unsigned int copied, +struct page *page,void *fsdata) +{ +struct inode *inode = mapping->host; +int ret; + + ret =generic_write_end (file, mapping, pos, len, copied, page, fsdata); + +/* Clear Archived bit on file writes, as AmigaOS would do */ +if (AFFS_I (inode)->i_protect &FIBF_ARCHIVED ) { +AFFS_I (inode)->i_protect &= ~FIBF_ARCHIVED ; +mark_inode_dirty (inode); + } + +return ret; +} +static sector_t _affs_bmap (struct address_space *mapping,sector_t block) {return generic_block_bmap (mapping,block,affs_get_block);
@@ -436,7 +454,7 @@ const struct address_space_operations affs_aops = { .readpage = affs_readpage, .writepage = affs_writepage, .write_begin = affs_write_begin, - .write_end = generic_write_end, + .write_end = affs_write_end, .direct_IO = affs_direct_IO, .bmap = _affs_bmap };
@@ -793,6 +811,12 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,if (tmp > inode->i_size) inode->i_size =AFFS_I (inode)->mmu_private = tmp; +/* Clear Archived bit on file writes, as AmigaOS would do */ +if (AFFS_I (inode)->i_protect &FIBF_ARCHIVED ) { +AFFS_I (inode)->i_protect &= ~FIBF_ARCHIVED ; +mark_inode_dirty (inode); + } + err_first_bh:unlock_page (page);put_page (page);
fs/btrfs/ctree.c +5 -3
@@ -1360,7 +1360,8 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct btrfs_path *path,btrfs_tree_read_unlock_blocking (eb);free_extent_buffer (eb); -extent_buffer_get (eb_rewin); +btrfs_set_buffer_lockdep_class (btrfs_header_owner (eb_rewin), + eb_rewin,btrfs_header_level (eb_rewin));btrfs_tree_read_lock (eb_rewin);__tree_mod_log_rewind (fs_info, eb_rewin, time_seq, tm); WARN_ON(btrfs_header_nritems(eb_rewin) >
@@ -1430,8 +1431,6 @@ get_old_root(struct btrfs_root *root, u64 time_seq)if (!eb)return NULL ; -extent_buffer_get (eb); -btrfs_tree_read_lock (eb);if (old_root) {btrfs_set_header_bytenr (eb, eb->start);btrfs_set_header_backref_rev (eb,BTRFS_MIXED_BACKREF_REV );
@@ -1439,6 +1438,9 @@ get_old_root(struct btrfs_root *root, u64 time_seq)btrfs_set_header_level (eb, old_root->level);btrfs_set_header_generation (eb, old_generation); } +btrfs_set_buffer_lockdep_class (btrfs_header_owner (eb), eb, +btrfs_header_level (eb)); +btrfs_tree_read_lock (eb);if (tm)__tree_mod_log_rewind (root->fs_info, eb, time_seq, tm);else
fs/btrfs/extent_io.c +4 -4
@@ -5488,9 +5488,9 @@ void read_extent_buffer(const struct extent_buffer *eb, void *dstv, } } -int read_extent_buffer_to_user (const struct extent_buffer *eb, -void __user *dstv, -unsigned long start,unsigned long len) +int read_extent_buffer_to_user_nofault (const struct extent_buffer *eb, +void __user *dstv, +unsigned long start,unsigned long len) {size_t cur;size_t offset;
@@ -5511,7 +5511,7 @@ int read_extent_buffer_to_user(const struct extent_buffer *eb, cur =min (len, (PAGE_SIZE - offset)); kaddr =page_address (page); -if (copy_to_user (dst, kaddr + offset, cur)) { +if (probe_user_write (dst, kaddr + offset, cur)) { ret = -EFAULT ;break ; }
fs/btrfs/extent_io.h +3 -3
@@ -401,9 +401,9 @@ int memcmp_extent_buffer(const struct extent_buffer *eb, const void *ptrv,void read_extent_buffer (const struct extent_buffer *eb,void *dst,unsigned long start,unsigned long len); -int read_extent_buffer_to_user (const struct extent_buffer *eb, -void __user *dst,unsigned long start, -unsigned long len); +int read_extent_buffer_to_user_nofault (const struct extent_buffer *eb, +void __user *dst,unsigned long start, +unsigned long len);void write_extent_buffer (struct extent_buffer *eb,const void *src,unsigned long start,unsigned long len); void copy_extent_buffer(struct extent_buffer *dst, struct extent_buffer *src,
fs/btrfs/ioctl.c +20 -7
@@ -2041,9 +2041,14 @@ static noinline int copy_to_sk(struct btrfs_path *path, sh.len = item_len; sh.transid = found_transid; -/* copy search result header */ -if (copy_to_user (ubuf + *sk_offset, &sh,sizeof (sh))) { - ret = -EFAULT ; +/* +* Copy search result header. If we fault then loop again so we +* can fault in the pages and -EFAULT there if there's a +* problem. Otherwise we'll fault and then copy the buffer in +* properly this next time through +*/ +if (probe_user_write (ubuf + *sk_offset, &sh,sizeof (sh))) { + ret =0 ; goto out; }
@@ -2051,10 +2056,14 @@ static noinline int copy_to_sk(struct btrfs_path *path,if (item_len) {char __user *up = ubuf + *sk_offset; -/* copy the item */ -if (read_extent_buffer_to_user (leaf, up, - item_off, item_len)) { - ret = -EFAULT ; +/* +* Copy the item, same behavior as above, but reset the +* * sk_offset so we copy the full thing again. +*/ +if (read_extent_buffer_to_user_nofault (leaf, up, + item_off, item_len)) { + ret =0 ; + *sk_offset -=sizeof (sh); goto out; }
@@ -2142,6 +2151,10 @@ static noinline int search_ioctl(struct inode *inode, key.offset = sk->min_offset;while (1 ) { + ret =fault_in_pages_writeable (ubuf, *buf_size - sk_offset); +if (ret) +break ; + ret =btrfs_search_forward (root, &key, path, sk->min_transid);if (ret !=0 ) {if (ret >0 )
fs/btrfs/volumes.c +2 -1
@@ -4181,6 +4181,7 @@ static int btrfs_uuid_scan_kthread(void *data) goto skip; } update_tree: +btrfs_release_path (path);if (!btrfs_is_empty_uuid (root_item.uuid)) { ret = btrfs_uuid_tree_add(trans, fs_info->uuid_root, root_item.uuid,
@@ -4206,6 +4207,7 @@ static int btrfs_uuid_scan_kthread(void *data) } skip: +btrfs_release_path (path);if (trans) { ret =btrfs_end_transaction (trans, fs_info->uuid_root); trans =NULL ;
@@ -4213,7 +4215,6 @@ static int btrfs_uuid_scan_kthread(void *data)break ; } -btrfs_release_path (path);if (key.offset < (u64)-1 ) { key.offset++; }else if (key.type <BTRFS_ROOT_ITEM_KEY ) {
fs/ceph/file.c +1 -0
@@ -1773,6 +1773,7 @@ const struct file_operations ceph_file_fops = { .mmap = ceph_mmap, .fsync = ceph_fsync, .lock = ceph_lock, + .setlease = simple_nosetlease, .flock = ceph_flock, .splice_write = iter_file_splice_write, .unlocked_ioctl = ceph_ioctl,
fs/eventpoll.c +3 -3
@@ -1748,9 +1748,9 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)* during ep_insert(). */ if (list_empty (&epi->ffd.file->f_tfile_llink)) { -get_file (epi->ffd.file); -list_add (&epi->ffd.file->f_tfile_llink, - &tfile_check_list); +if (get_file_rcu (epi->ffd.file)) +list_add (&epi->ffd.file->f_tfile_llink, + &tfile_check_list); } } }
include/linux/blkdev.h +31 -11
94 lines not on this page · raw message
include/linux/bvec.h +8 -1
@@ -88,10 +88,17 @@ static inline void bvec_iter_advance(const struct bio_vec *bv, } } +static inline void bvec_iter_skip_zero_bvec (struct bvec_iter *iter) +{ + iter->bi_bvec_done =0 ; + iter->bi_idx++; +} +#define for_each_bvec (bvl, bio_vec, iter, start) \ for (iter = (start); \ (iter).bi_size && \ ((bvl = bvec_iter_bvec((bio_vec), (iter))), 1); \ - bvec_iter_advance((bio_vec), &(iter), (bvl).bv_len)) + (bvl).bv_len ? (void)bvec_iter_advance((bio_vec), &(iter), \ + (bvl).bv_len) : bvec_iter_skip_zero_bvec(&(iter)))#endif /* __LINUX_BVEC_ITER_H */
include/linux/device-mapper.h +0 -2
@@ -576,8 +576,6 @@ extern struct ratelimit_state dm_ratelimit_state; #define DMEMIT(x...) sz += ((sz >= maxlen) ? \ 0 : scnprintf(result + sz, maxlen - sz, x)) -#define SECTOR_SHIFT 9 -/* * Definitions of return values from target end_io function. */
include/linux/hid.h +29 -13
70 lines not on this page · raw message
include/linux/ide.h +0 -1
@@ -128,7 +128,6 @@ struct ide_io_ports {*/ #define PARTN_BITS 6/* number of minor dev bits for partitions */ #define MAX_DRIVES 2/* per interface; 2 assumed by lots of code */ -#define SECTOR_SIZE 512/* * Timeouts for various operations:
include/linux/libata.h +1 -0
@@ -435,6 +435,7 @@ enum {ATA_HORKAGE_NO_NCQ_LOG = (1 <<23 ),/* don't use NCQ for log read */ ATA_HORKAGE_NOTRIM = (1 <<24 ),/* don't use TRIM */ ATA_HORKAGE_MAX_SEC_1024 = (1 <<25 ),/* Limit max sects to 1024 */ + ATA_HORKAGE_MAX_TRIM_128M = (1 << 26), /* Limit max trim size to 128M *//* DMA mask for user DMA control: User visible values; DO NOT renumber */
include/linux/log2.h +1 -1
@@ -159,7 +159,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)#define roundup_pow_of_two (n) \ ( \ __builtin_constant_p(n) ? ( \ - (n == 1) ? 1 : \ + ((n) == 1) ? 1 : \ (1UL << (ilog2((n) - 1) + 1)) \ ) : \ __roundup_pow_of_two(n) \
include/linux/uaccess.h +26 -0
@@ -90,6 +90,17 @@ static inline unsigned long __copy_from_user_nocache(void *to,extern long probe_kernel_read (void *dst,const void *src,size_t size);extern long __probe_kernel_read (void *dst,const void *src,size_t size); +/* +* probe_user_read(): safely attempt to read from a location in user space +* @dst: pointer to the buffer that shall take the data +* @src: address to read from +* @size: size of the data chunk +* +* Safely read from address @src to the buffer at @dst. If a kernel fault +* happens, handle that and return -EFAULT. +*/ +extern long probe_user_read (void *dst,const void __user *src,size_t size); +/* * probe_kernel_write(): safely attempt to write to a location * @dst: address to write to
@@ -102,7 +113,22 @@ extern long __probe_kernel_read(void *dst, const void *src, size_t size);extern long notrace probe_kernel_write (void *dst,const void *src,size_t size);extern long notrace __probe_kernel_write (void *dst,const void *src,size_t size); +/* +* probe_user_write(): safely attempt to write to a location in user space +* @dst: address to write to +* @src: pointer to the data that shall be written +* @size: size of the data chunk +* +* Safely write to address @dst from the buffer at @src. If a kernel fault +* happens, handle that and return -EFAULT. +*/ +extern long notrace probe_user_write (void __user *dst,const void *src,size_t size); +extern long notrace __probe_user_write (void __user *dst,const void *src,size_t size); +extern long strncpy_from_unsafe (char *dst,const void *unsafe_addr,long count); +extern long strncpy_from_unsafe_user (char *dst,const void __user *unsafe_addr, +long count); +extern long strnlen_unsafe_user (const void __user *unsafe_addr,long count);/** * probe_kernel_address(): safely attempt to read from a location
include/net/inet_connection_sock.h +4 -0
@@ -319,5 +319,9 @@ int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname,int inet_csk_compat_setsockopt (struct sock *sk,int level,int optname,char __user *optval,unsigned int optlen); +/* update the fast reuse flag when adding a socket */ +void inet_csk_update_fastreuse (struct inet_bind_bucket *tb, +struct sock *sk); +struct dst_entry *inet_csk_update_pmtu (struct sock *sk,u32 mtu);#endif /* _INET_CONNECTION_SOCK_H */
include/net/netfilter/nf_tables.h +2 -0
@@ -119,6 +119,8 @@ static inline u8 nft_reg_load8(u32 *sreg)static inline void nft_data_copy (u32 *dst,const struct nft_data *src,unsigned int len) { +if (len %NFT_REG32_SIZE ) + dst[len /NFT_REG32_SIZE ] =0 ;memcpy (dst, src, len); }
include/uapi/linux/msdos_fs.h +2 -0
@@ -9,7 +9,9 @@* The MS-DOS filesystem constants/structures */ +#ifndef SECTOR_SIZE #define SECTOR_SIZE 512/* sector size (bytes) */ +#endif #define SECTOR_BITS 9/* log2(SECTOR_SIZE) */ #define MSDOS_DPB (MSDOS_DPS)/* dir entries per block */ #define MSDOS_DPB_BITS 4/* log2(MSDOS_DPB) */
include/uapi/linux/netfilter/nf_tables.h +1 -1
@@ -114,7 +114,7 @@ enum nf_tables_msg_types {* @NFTA_LIST_ELEM: list element (NLA_NESTED) */ enum nft_list_attributes { -NFTA_LIST_UNPEC , +NFTA_LIST_UNSPEC ,NFTA_LIST_ELEM , __NFTA_LIST_MAX };
mm/hugetlb.c +20 -6
@@ -2921,6 +2921,22 @@ static unsigned int cpuset_mems_nr(unsigned int *array) }#ifdef CONFIG_SYSCTL +static int proc_hugetlb_doulongvec_minmax (struct ctl_table *table,int write, +void *buffer,size_t *length, +loff_t *ppos,unsigned long *out) +{ +struct ctl_table dup_table; + +/* +* In order to avoid races with __do_proc_doulongvec_minmax(), we +* can duplicate the @table and alter the duplicate of it. +*/ + dup_table = *table; + dup_table.data = out; + +return proc_doulongvec_minmax (&dup_table, write, buffer, length, ppos); +} +static int hugetlb_sysctl_handler_common (bool obey_mempolicy,struct ctl_table *table,int write,void __user *buffer,size_t *length,loff_t *ppos)
@@ -2932,9 +2948,8 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,if (!hugepages_supported ())return -EOPNOTSUPP ; - table->data = &tmp; - table->maxlen =sizeof (unsigned long ); - ret =proc_doulongvec_minmax (table, write, buffer, length, ppos); + ret =proc_hugetlb_doulongvec_minmax (table, write, buffer, length, ppos, + &tmp);if (ret) goto out;
@@ -2978,9 +2993,8 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,if (write &&hstate_is_gigantic (h))return -EINVAL ; - table->data = &tmp; - table->maxlen =sizeof (unsigned long ); - ret =proc_doulongvec_minmax (table, write, buffer, length, ppos); + ret =proc_hugetlb_doulongvec_minmax (table, write, buffer, length, ppos, + &tmp);if (ret) goto out;
mm/maccess.c +157 -10
205 lines not on this page · raw message
mm/slub.c +6 -6
@@ -625,12 +625,12 @@ static void slab_fix(struct kmem_cache *s, char *fmt, ...) }static bool freelist_corrupted (struct kmem_cache *s,struct page *page, -void *freelist,void *nextfree) +void **freelist,void *nextfree) {if ((s->flags &SLAB_CONSISTENCY_CHECKS ) && - !check_valid_pointer (s, page, nextfree)) { -object_err (s, page, freelist,"Freechain corrupt" ); - freelist =NULL ; + !check_valid_pointer (s, page, nextfree) && freelist) { +object_err (s, page, *freelist,"Freechain corrupt" ); + *freelist =NULL ;slab_fix (s,"Isolate corrupted freechain" );return true; }
@@ -1320,7 +1320,7 @@ static inline void dec_slabs_node(struct kmem_cache *s, int node, int objects) {}static bool freelist_corrupted (struct kmem_cache *s,struct page *page, -void *freelist,void *nextfree) +void **freelist,void *nextfree) {return false; }
@@ -2040,7 +2040,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page,* 'freelist' is already corrupted. So isolate all objects * starting at 'freelist'. */ -if (freelist_corrupted (s, page, freelist, nextfree)) +if (freelist_corrupted (s, page, &freelist, nextfree))break ; do {
net/batman-adv/bridge_loop_avoidance.c +4 -1
@@ -451,7 +451,10 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac, skb->len + ETH_HLEN); soft_iface->last_rx = jiffies; -netif_rx (skb); +if (in_interrupt ()) +netif_rx (skb); +else +netif_rx_ni (skb); out:if (primary_if)batadv_hardif_put (primary_if);
net/batman-adv/gateway_client.c +4 -2
@@ -673,8 +673,10 @@ batadv_gw_dhcp_recipient_get(struct sk_buff *skb, unsigned int *header_len, chaddr_offset = *header_len +BATADV_DHCP_CHADDR_OFFSET ;/* store the client address if the message is going to a client */ -if (ret ==BATADV_DHCP_TO_CLIENT && -pskb_may_pull (skb, chaddr_offset +ETH_ALEN )) { +if (ret ==BATADV_DHCP_TO_CLIENT ) { +if (!pskb_may_pull (skb, chaddr_offset +ETH_ALEN )) +return BATADV_DHCP_NO ; +/* check if the DHCP packet carries an Ethernet DHCP */ p = skb->data + *header_len +BATADV_DHCP_HTYPE_OFFSET ;if (*p !=BATADV_DHCP_HTYPE_ETHERNET )
net/core/dev.c +2 -1
@@ -5188,13 +5188,14 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,pr_err_once ("netif_napi_add() called with weight %d on device %s\n" , weight, dev->name); napi->weight = weight; -list_add (&napi->dev_list, &dev->napi_list); napi->dev = dev;#ifdef CONFIG_NETPOLL spin_lock_init (&napi->poll_lock); napi->poll_owner =-1 ;#endif set_bit (NAPI_STATE_SCHED , &napi->state); +set_bit (NAPI_STATE_NPSVC , &napi->state); +list_add_rcu (&napi->dev_list, &dev->napi_list);napi_hash_add (napi); }EXPORT_SYMBOL (netif_napi_add);
net/core/netpoll.c +1 -1
@@ -178,7 +178,7 @@ static void poll_napi(struct net_device *dev) {struct napi_struct *napi; -list_for_each_entry (napi, &dev->napi_list, dev_list) { +list_for_each_entry_rcu (napi, &dev->napi_list, dev_list) {if (napi->poll_owner !=smp_processor_id () &&spin_trylock (&napi->poll_lock)) {poll_one_napi (napi);
net/ipv4/inet_connection_sock.c +25 -12
@@ -89,6 +89,28 @@ int inet_csk_bind_conflict(const struct sock *sk, }EXPORT_SYMBOL_GPL (inet_csk_bind_conflict); +void inet_csk_update_fastreuse (struct inet_bind_bucket *tb, +struct sock *sk) +{ +kuid_t uid =sock_i_uid (sk); +bool reuse = sk->sk_reuse && sk->sk_state !=TCP_LISTEN ; + +if (!hlist_empty (&tb->owners)) { +if (!reuse) + tb->fastreuse =0 ; +if (!sk->sk_reuseport || !uid_eq (tb->fastuid, uid)) + tb->fastreuseport =0 ; + }else { + tb->fastreuse = reuse; +if (sk->sk_reuseport) { + tb->fastreuseport =1 ; + tb->fastuid = uid; + }else { + tb->fastreuseport =0 ; + } + } +} +/* Obtain a reference to a local port for the given sock, * if snum is zero it means select any available local port. * We try to allocate an odd port (and leave even ports for connect())
@@ -218,19 +240,10 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum) } goto fail_unlock; } -if (!reuse) - tb->fastreuse =0 ; -if (!sk->sk_reuseport || !uid_eq (tb->fastuid, uid)) - tb->fastreuseport =0 ; - }else { - tb->fastreuse = reuse; -if (sk->sk_reuseport) { - tb->fastreuseport =1 ; - tb->fastuid = uid; - }else { - tb->fastreuseport =0 ; - } } + +inet_csk_update_fastreuse (tb, sk); + success:if (!inet_csk (sk)->icsk_bind_hash)inet_bind_hash (sk, tb, port);
net/ipv4/inet_hashtables.c +1 -0
@@ -163,6 +163,7 @@ int __inet_inherit_port(const struct sock *sk, struct sock *child)return -ENOMEM ; } } +inet_csk_update_fastreuse (tb, child); }inet_bind_hash (child, tb, port);spin_unlock (&head->lock);
net/netfilter/nf_tables_api.c +2 -1
@@ -2592,7 +2592,8 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx, goto nla_put_failure; } -if (nla_put (skb,NFTA_SET_USERDATA , set->udlen, set->udata)) +if (set->udata && +nla_put (skb,NFTA_SET_USERDATA , set->udlen, set->udata)) goto nla_put_failure; desc =nla_nest_start (skb,NFTA_SET_DESC );
net/netfilter/nft_payload.c +3 -1
@@ -74,7 +74,9 @@ static void nft_payload_eval(const struct nft_expr *expr,u32 *dest = ®s->data[priv->dreg];int offset; - dest[priv->len /NFT_REG32_SIZE ] =0 ; +if (priv->len %NFT_REG32_SIZE ) + dest[priv->len /NFT_REG32_SIZE ] =0 ; +switch (priv->base) {case NFT_PAYLOAD_LL_HEADER :if (!skb_mac_header_was_set (skb))
net/netlabel/netlabel_domainhash.c +30 -29
64 lines not on this page · raw message
tools/perf/Documentation/perf-record.txt +4 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.