Linux 4.4.155
Greg KH
maintainerI'm announcing the release of the 4.4.155 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/alpha/kernel/osf_sys.c | 64 ++++++++----------- arch/arm/boot/dts/tegra30-cardhu.dtsi | 1 arch/powerpc/include/asm/fadump.h | 3 arch/powerpc/kernel/fadump.c | 92 +++++++++++++++++++++++----- arch/powerpc/platforms/pseries/ras.c | 2 arch/sparc/kernel/sys_sparc_32.c | 22 +++--- arch/sparc/kernel/sys_sparc_64.c | 20 +++--- arch/x86/include/asm/io.h | 6 + arch/x86/mm/pageattr.c | 2 arch/x86/mm/pat.c | 14 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 + drivers/gpu/drm/ast/ast_ttm.c | 6 + drivers/gpu/drm/cirrus/cirrus_ttm.c | 7 ++ drivers/gpu/drm/i915/i915_gem_userptr.c | 3 drivers/gpu/drm/mgag200/mgag200_ttm.c | 7 ++ drivers/gpu/drm/nouveau/nouveau_ttm.c | 8 ++ drivers/gpu/drm/radeon/radeon_object.c | 5 + drivers/iio/frequency/ad9523.c | 4 - drivers/iommu/dmar.c | 6 - drivers/iommu/intel-iommu.c | 18 +++++ drivers/md/bcache/writeback.c | 4 - drivers/md/dm-cache-metadata.c | 3 drivers/misc/vmw_balloon.c | 67 ++++++++++++-------- drivers/net/usb/lan78xx.c | 4 - drivers/pwm/pwm-tiehrpwm.c | 2 drivers/spi/spi-davinci.c | 2 drivers/video/fbdev/core/fbmem.c | 38 +++++++++-- fs/9p/xattr.c | 6 + fs/nfs/blocklayout/dev.c | 2 fs/quota/quota.c | 2 fs/ubifs/journal.c | 18 ++++- fs/ubifs/lprops.c | 8 +- fs/xattr.c | 2 include/linux/intel-iommu.h | 8 +- include/linux/io.h | 22 ++++++ include/video/udlfb.h | 2 kernel/kthread.c | 8 ++ kernel/power/Kconfig | 1 kernel/sys.c | 95 +++++++++++++---------------- kernel/trace/blktrace.c | 4 + kernel/trace/trace.c | 4 - kernel/trace/trace_uprobe.c | 2 kernel/user_namespace.c | 39 +++++------ kernel/utsname_sysctl.c | 41 +++++++----- mm/memory.c | 9 -- net/9p/client.c | 2 net/9p/trans_fd.c | 7 +- net/9p/trans_rdma.c | 3 net/9p/trans_virtio.c | 13 +++ net/ieee802154/6lowpan/tx.c | 21 +++++- net/mac802154/tx.c | 15 ++++ tools/perf/util/auxtrace.c | 3 53 files changed, 519 insertions(+), 235 deletions(-)
Adrian Hunter (1):
perf auxtrace: Fix queue resize
Al Viro (1):
osf_getdomainname(): use copy_to_user()
Alexander Aring (2):
net: 6lowpan: fix reserved space for single frames
net: mac802154: tx: expand tailroom if necessary
Bartosz Golaszewski (1):
spi: davinci: fix a NULL pointer dereference
Ben Hutchings (1):
net: lan78xx: Fix misplaced tasklet_schedule() call
Chirantan Ekbote (1):
9p/net: Fix zero-copy path in the 9p virtio transport
Christian Brauner (1):
getxattr: use correct xattr length
Dan Carpenter (1):
pnfs/blocklayout: off by one in bl_map_stripe()
Dave Airlie (2):
x86/io: add interface to reserve io memtype for a resource range. (v1.1) drm/drivers: add support for using the arch wc mapping API.
Greg Kroah-Hartman (1):
Linux 4.4.155
Hari Bathini (1):
powerpc/fadump: handle crash memory ranges array index overflow
Jacob Pan (2):
iommu/vt-d: Add definitions for PFSID
iommu/vt-d: Fix dev iotlb pfsid use
Jann Horn (2):
sys: don't hold uts_sem while accessing userspace memory
userns: move user access out of the mutex
Jeremy Cline (1):
fs/quota: Fix spectre gadget in do_quotactl
Jiri Slaby (1):
x86/mm/pat: Fix L1TF stable backport for CPA, 2nd call
Jon Hunter (1):
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Lars-Peter Clausen (2):
iio: ad9523: Fix displayed phase
iio: ad9523: Fix return value for ad952x_store()
Mahesh Salgaonkar (1):
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
Matthew Auld (1):
drm/i915/userptr: reject zero user_size
Mike Snitzer (1):
dm cache metadata: save in-core policy_hint_size to on-disk superblock
Mikulas Patocka (2):
fb: fix lost console when the user unplugs a USB adapter
udlfb: set optimal write delay
Nadav Amit (4):
vmw_balloon: fix inflation of 64-bit GFNs
vmw_balloon: do not use 2MB without batching
vmw_balloon: VMCI_DOORBELL_SET does not check status
vmw_balloon: fix VMCI use when balloon built into kernel
Peter Zijlstra (1):
mm/tlb: Remove tlb_remove_table() non-concurrent condition
Richard Weinberger (4):
ubifs: Fix memory leak in lprobs self-check Revert "UBIFS: Fix potential integer overflow in allocation"
ubifs: Check data node size before truncate
ubifs: Fix synced_i_size calculation for xattr inodes
Shan Hai (1):
bcache: release dc->writeback_lock properly in bch_writeback_thread()
Snild Dolkow (1):
kthread, tracing: Don't expose half-written comm when creating kthreads
Steven Rostedt (VMware) (3):
tracing: Do not call start/stop() functions when tracing_on does not change tracing/blktrace: Fix to allow setting same value
uprobes: Use synchronize_rcu() not synchronize_sched()
Tomas Bortoli (3):
net/9p/client.c: version pointer uninitialized net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree() 9p: fix multiple NULL-pointer-dereferences
Vignesh R (1):
pwm: tiehrpwm: Fix disabling of output of PWMs
jiangyiwen (1):
9p/virtio: fix off-by-one error in sg list bounds check
piaojun (1):
fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
zhangyi (F) (1):
PM / sleep: wakeup: Fix build error caused by missing SRCU support
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 154 +SUBLEVEL = 155 EXTRAVERSION = NAME = Blurry Fish Butt
arch/alpha/kernel/osf_sys.c +28 -36
102 lines not on this page · raw message
arch/arm/boot/dts/tegra30-cardhu.dtsi +1 -0
@@ -201,6 +201,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x70>; + reset-gpio = <&gpio TEGRA_GPIO(BB, 0) GPIO_ACTIVE_LOW>; }; };
arch/powerpc/include/asm/fadump.h +0 -3
@@ -194,9 +194,6 @@ struct fadump_crash_info_header {struct cpumask cpu_online_mask; }; -/* Crash memory ranges */ -#define INIT_CRASHMEM_RANGES (INIT_MEMBLOCK_REGIONS + 2) -struct fad_crash_memory_ranges {unsigned long long base;unsigned long long size;
arch/powerpc/kernel/fadump.c +78 -14
174 lines not on this page · raw message
arch/powerpc/platforms/pseries/ras.c +1 -1
@@ -300,7 +300,7 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs) } savep =__va (regs->gpr[3 ]); - regs->gpr[3 ] = savep[0 ];/* restore original r3 */ + regs->gpr[3 ] =be64_to_cpu (savep[0 ]);/* restore original r3 */ /* If it isn't an extended log we can use the per cpu 64bit buffer */ h = (struct rtas_error_log *)&savep[1 ];
arch/sparc/kernel/sys_sparc_32.c +13 -9
@@ -201,23 +201,27 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig,asmlinkage long sys_getdomainname (char __user *name,int len) { -int nlen, err; - +int nlen, err; +char tmp[__NEW_UTS_LEN +1 ]; +if (len <0 )return -EINVAL ; -down_read (&uts_sem); - +down_read (&uts_sem); + nlen =strlen (utsname ()->domainname) +1 ; err = -EINVAL ;if (nlen > len) - goto out; + goto out_unlock; +memcpy (tmp,utsname ()->domainname, nlen); - err = -EFAULT ; -if (!copy_to_user (name,utsname ()->domainname, nlen)) - err =0 ; +up_read (&uts_sem); -out: +if (copy_to_user (name, tmp, nlen)) +return -EFAULT ; +return 0 ; + +out_unlock:up_read (&uts_sem);return err; }
arch/sparc/kernel/sys_sparc_64.c +12 -8
@@ -524,23 +524,27 @@ extern void check_pending(int signum); SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len) { -int nlen, err; +int nlen, err; +char tmp[__NEW_UTS_LEN +1 ];if (len <0 )return -EINVAL ; -down_read (&uts_sem); - +down_read (&uts_sem); + nlen =strlen (utsname ()->domainname) +1 ; err = -EINVAL ;if (nlen > len) - goto out; + goto out_unlock; +memcpy (tmp,utsname ()->domainname, nlen); + +up_read (&uts_sem); - err = -EFAULT ; -if (!copy_to_user (name,utsname ()->domainname, nlen)) - err =0 ; +if (copy_to_user (name, tmp, nlen)) +return -EFAULT ; +return 0 ; -out: +out_unlock:up_read (&uts_sem);return err; }
arch/x86/include/asm/io.h +6 -0
@@ -351,4 +351,10 @@ extern void arch_phys_wc_del(int handle);#define arch_phys_wc_add arch_phys_wc_add#endif +#ifdef CONFIG_X86_PAT +extern int arch_io_reserve_memtype_wc (resource_size_t start,resource_size_t size); +extern void arch_io_free_memtype_wc (resource_size_t start,resource_size_t size); +#define arch_io_reserve_memtype_wc arch_io_reserve_memtype_wc +#endif +#endif /* _ASM_X86_IO_H */
arch/x86/mm/pageattr.c +1 -1
@@ -1079,7 +1079,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,* Map everything starting from the Gb boundary, possibly with 1G pages */ while (end - start >=PUD_SIZE ) { -set_pud (pud,pud_mkhuge (pfn_pud (cpa->pfn, +set_pud (pud,pud_mkhuge (pfn_pud (cpa->pfn >>PAGE_SHIFT ,canon_pgprot (pud_pgprot)))); start +=PUD_SIZE ;
arch/x86/mm/pat.c +14 -0
@@ -726,6 +726,20 @@ void io_free_memtype(resource_size_t start, resource_size_t end)free_memtype (start, end); } +int arch_io_reserve_memtype_wc (resource_size_t start,resource_size_t size) +{ +enum page_cache_mode type = _PAGE_CACHE_MODE_WC; + +return io_reserve_memtype (start, start + size, &type); +} +EXPORT_SYMBOL (arch_io_reserve_memtype_wc); + +void arch_io_free_memtype_wc (resource_size_t start,resource_size_t size) +{ +io_free_memtype (start, start + size); +} +EXPORT_SYMBOL (arch_io_free_memtype_wc); +pgprot_t phys_mem_access_prot (struct file *file,unsigned long pfn,unsigned long size,pgprot_t vma_prot) {
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +5 -0
@@ -492,6 +492,10 @@ void amdgpu_bo_force_delete(struct amdgpu_device *adev)int amdgpu_bo_init (struct amdgpu_device *adev) { +/* reserve PAT memory space to WC for VRAM */ +arch_io_reserve_memtype_wc (adev->mc.aper_base, + adev->mc.aper_size); +/* Add an MTRR for the VRAM */ adev->mc.vram_mtrr =arch_phys_wc_add (adev->mc.aper_base, adev->mc.aper_size);
@@ -507,6 +511,7 @@ void amdgpu_bo_fini(struct amdgpu_device *adev) {amdgpu_ttm_fini (adev);arch_phys_wc_del (adev->mc.vram_mtrr); +arch_io_free_memtype_wc (adev->mc.aper_base, adev->mc.aper_size); } int amdgpu_bo_fbdev_mmap(struct amdgpu_bo *bo,
drivers/gpu/drm/ast/ast_ttm.c +6 -0
@@ -275,6 +275,8 @@ int ast_mm_init(struct ast_private *ast)return ret; } +arch_io_reserve_memtype_wc (pci_resource_start (dev->pdev,0 ), +pci_resource_len (dev->pdev,0 )); ast->fb_mtrr =arch_phys_wc_add (pci_resource_start (dev->pdev,0 ),pci_resource_len (dev->pdev,0 ));
@@ -283,11 +285,15 @@ int ast_mm_init(struct ast_private *ast)void ast_mm_fini (struct ast_private *ast) { +struct drm_device *dev = ast->dev; +ttm_bo_device_release (&ast->ttm.bdev);ast_ttm_global_release (ast);arch_phys_wc_del (ast->fb_mtrr); +arch_io_free_memtype_wc (pci_resource_start (dev->pdev,0 ), +pci_resource_len (dev->pdev,0 )); }void ast_ttm_placement (struct ast_bo *bo,int domain)
drivers/gpu/drm/cirrus/cirrus_ttm.c +7 -0
@@ -275,6 +275,9 @@ int cirrus_mm_init(struct cirrus_device *cirrus)return ret; } +arch_io_reserve_memtype_wc (pci_resource_start (dev->pdev,0 ), +pci_resource_len (dev->pdev,0 )); + cirrus->fb_mtrr =arch_phys_wc_add (pci_resource_start (dev->pdev,0 ),pci_resource_len (dev->pdev,0 ));
@@ -284,6 +287,8 @@ int cirrus_mm_init(struct cirrus_device *cirrus)void cirrus_mm_fini (struct cirrus_device *cirrus) { +struct drm_device *dev = cirrus->dev; +if (!cirrus->mm_inited)return ;
@@ -293,6 +298,8 @@ void cirrus_mm_fini(struct cirrus_device *cirrus)arch_phys_wc_del (cirrus->fb_mtrr); cirrus->fb_mtrr =0 ; +arch_io_free_memtype_wc (pci_resource_start (dev->pdev,0 ), +pci_resource_len (dev->pdev,0 )); }void cirrus_ttm_placement (struct cirrus_bo *bo,int domain)
drivers/gpu/drm/i915/i915_gem_userptr.c +3 -0
@@ -842,6 +842,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev, void *data, struct drm_file *file I915_USERPTR_UNSYNCHRONIZED))return -EINVAL ; +if (!args->user_size) +return -EINVAL ; +if (offset_in_page (args->user_ptr | args->user_size))return -EINVAL ;
drivers/gpu/drm/mgag200/mgag200_ttm.c +7 -0
@@ -274,6 +274,9 @@ int mgag200_mm_init(struct mga_device *mdev)return ret; } +arch_io_reserve_memtype_wc (pci_resource_start (dev->pdev,0 ), +pci_resource_len (dev->pdev,0 )); + mdev->fb_mtrr =arch_phys_wc_add (pci_resource_start (dev->pdev,0 ),pci_resource_len (dev->pdev,0 ));
@@ -282,10 +285,14 @@ int mgag200_mm_init(struct mga_device *mdev)void mgag200_mm_fini (struct mga_device *mdev) { +struct drm_device *dev = mdev->dev; +ttm_bo_device_release (&mdev->ttm.bdev);mgag200_ttm_global_release (mdev); +arch_io_free_memtype_wc (pci_resource_start (dev->pdev,0 ), +pci_resource_len (dev->pdev,0 ));arch_phys_wc_del (mdev->fb_mtrr); mdev->fb_mtrr =0 ; }
drivers/gpu/drm/nouveau/nouveau_ttm.c +8 -0
@@ -397,6 +397,9 @@ nouveau_ttm_init(struct nouveau_drm *drm)/* VRAM init */ drm->gem.vram_available = drm->device.info.ram_user; +arch_io_reserve_memtype_wc (device->func->resource_addr (device,1 ), + device->func->resource_size (device,1 )); + ret =ttm_bo_init_mm (&drm->ttm.bdev,TTM_PL_VRAM , drm->gem.vram_available >>PAGE_SHIFT );if (ret) {
@@ -429,6 +432,8 @@ nouveau_ttm_init(struct nouveau_drm *drm)void nouveau_ttm_fini (struct nouveau_drm *drm) { +struct nvkm_device *device =nvxx_device (&drm->device); +ttm_bo_clean_mm (&drm->ttm.bdev,TTM_PL_VRAM );ttm_bo_clean_mm (&drm->ttm.bdev,TTM_PL_TT );
@@ -438,4 +443,7 @@ nouveau_ttm_fini(struct nouveau_drm *drm)arch_phys_wc_del (drm->ttm.mtrr); drm->ttm.mtrr =0 ; +arch_io_free_memtype_wc (device->func->resource_addr (device,1 ), + device->func->resource_size (device,1 )); + }
drivers/gpu/drm/radeon/radeon_object.c +5 -0
@@ -447,6 +447,10 @@ void radeon_bo_force_delete(struct radeon_device *rdev)int radeon_bo_init (struct radeon_device *rdev) { +/* reserve PAT memory space to WC for VRAM */ +arch_io_reserve_memtype_wc (rdev->mc.aper_base, + rdev->mc.aper_size); +/* Add an MTRR for the VRAM */ if (!rdev->fastfb_working) { rdev->mc.vram_mtrr = arch_phys_wc_add(rdev->mc.aper_base,
@@ -464,6 +468,7 @@ void radeon_bo_fini(struct radeon_device *rdev) {radeon_ttm_fini (rdev);arch_phys_wc_del (rdev->mc.vram_mtrr); +arch_io_free_memtype_wc (rdev->mc.aper_base, rdev->mc.aper_size); }/* Returns how many bytes TTM can move per IB.
drivers/iio/frequency/ad9523.c +2 -2
@@ -507,7 +507,7 @@ static ssize_t ad9523_store(struct device *dev,return ret;if (!state) -return 0 ; +return len;mutex_lock (&indio_dev->mlock);switch ((u32 )this_attr->address) {
@@ -641,7 +641,7 @@ static int ad9523_read_raw(struct iio_dev *indio_dev, code = (AD9523_CLK_DIST_DIV_PHASE_REV (ret) *3141592 ) /AD9523_CLK_DIST_DIV_REV (ret); *val = code /1000000 ; - *val2 = (code %1000000 ) *10 ; + *val2 = code %1000000 ;return IIO_VAL_INT_PLUS_MICRO ;default :return -EINVAL ;
drivers/iommu/dmar.c +3 -3
@@ -1315,8 +1315,8 @@ void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,qi_submit_sync (&desc, iommu); } -void qi_flush_dev_iotlb (struct intel_iommu *iommu,u16 sid,u16 qdep, -u64 addr,unsigned mask) +void qi_flush_dev_iotlb (struct intel_iommu *iommu,u16 sid,u16 pfsid, +u16 qdep,u64 addr,unsigned mask) {struct qi_desc desc;
@@ -1331,7 +1331,7 @@ void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, qdep =0 ; desc.low =QI_DEV_IOTLB_SID (sid) |QI_DEV_IOTLB_QDEP (qdep) | -QI_DIOTLB_TYPE ; +QI_DIOTLB_TYPE |QI_DEV_IOTLB_PFSID (pfsid);qi_submit_sync (&desc, iommu); }
drivers/iommu/intel-iommu.c +17 -1
@@ -419,6 +419,7 @@ struct device_domain_info {struct list_head global;/* link to global list */ u8 bus;/* PCI bus number */ u8 devfn;/* PCI devfn number */ +u16 pfsid;/* SRIOV physical function source ID */ u8 pasid_supported:3; u8 pasid_enabled:1; u8 pri_supported:1;
@@ -1479,6 +1480,20 @@ static void iommu_enable_dev_iotlb(struct device_domain_info *info)return ; pdev =to_pci_dev (info->dev); +/* For IOMMU that supports device IOTLB throttling (DIT), we assign +* PFSID to the invalidation desc of a VF such that IOMMU HW can gauge +* queue depth at PF level. If DIT is not set, PFSID will be treated as +* reserved, which should be set to 0. +*/ +if (!ecap_dit (info->iommu->ecap)) + info->pfsid =0 ; +else { +struct pci_dev *pf_pdev; + +/* pdev will be returned if device is not a vf */ + pf_pdev =pci_physfn (pdev); + info->pfsid =PCI_DEVID (pf_pdev->bus->number, pf_pdev->devfn); + }#ifdef CONFIG_INTEL_IOMMU_SVM /* The PCIe spec, in its wisdom, declares that the behaviour of
@@ -1537,7 +1552,8 @@ static void iommu_flush_dev_iotlb(struct dmar_domain *domain, sid = info->bus <<8 | info->devfn; qdep = info->ats_qdep; -qi_flush_dev_iotlb (info->iommu, sid, qdep, addr, mask); +qi_flush_dev_iotlb (info->iommu, sid, info->pfsid, + qdep, addr, mask); }spin_unlock_irqrestore (&device_domain_lock, flags); }
drivers/md/bcache/writeback.c +3 -1
@@ -462,8 +462,10 @@ static int bch_writeback_thread(void *arg)* data on cache. BCACHE_DEV_DETACHING flag is set in * bch_cached_dev_detach(). */ -if (test_bit (BCACHE_DEV_DETACHING , &dc->disk.flags)) +if (test_bit (BCACHE_DEV_DETACHING , &dc->disk.flags)) { +up_write (&dc->writeback_lock);break ; + } }up_write (&dc->writeback_lock);
drivers/md/dm-cache-metadata.c +2 -1
@@ -337,7 +337,7 @@ static int __write_initial_superblock(struct dm_cache_metadata *cmd) disk_super->version =cpu_to_le32 (MAX_CACHE_VERSION );memset (disk_super->policy_name,0 ,sizeof (disk_super->policy_name));memset (disk_super->policy_version,0 ,sizeof (disk_super->policy_version)); - disk_super->policy_hint_size =0 ; + disk_super->policy_hint_size =cpu_to_le32 (0 );__copy_sm_root (cmd, disk_super);
@@ -652,6 +652,7 @@ static int __commit_transaction(struct dm_cache_metadata *cmd, disk_super->policy_version[0 ] =cpu_to_le32 (cmd->policy_version[0 ]); disk_super->policy_version[1 ] =cpu_to_le32 (cmd->policy_version[1 ]); disk_super->policy_version[2 ] =cpu_to_le32 (cmd->policy_version[2 ]); + disk_super->policy_hint_size =cpu_to_le32 (cmd->policy_hint_size); disk_super->read_hits =cpu_to_le32 (cmd->stats.read_hits); disk_super->read_misses =cpu_to_le32 (cmd->stats.read_misses);
drivers/misc/vmw_balloon.c +41 -26
116 lines not on this page · raw message
drivers/net/usb/lan78xx.c +2 -2
@@ -902,6 +902,8 @@ static int lan78xx_link_reset(struct lan78xx_net *dev) ret =lan78xx_update_flowcontrol (dev, ecmd.duplex, ladv, radv);netif_carrier_on (dev->net); + +tasklet_schedule (&dev->bh); }return ret;
@@ -1361,8 +1363,6 @@ static void lan78xx_init_mac_address(struct lan78xx_net *dev)netif_dbg (dev, ifup, dev->net,"MAC address set to random addr" ); } - -tasklet_schedule (&dev->bh); } ret =lan78xx_write_reg (dev,MAF_LO (0 ), addr_lo);
drivers/pwm/pwm-tiehrpwm.c +2 -0
@@ -384,6 +384,8 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) aqcsfrc_mask =AQCSFRC_CSFA_MASK ; } +/* Update shadow register first before modifying active register */ +ehrpwm_modify (pc->mmio_base,AQCSFRC , aqcsfrc_mask, aqcsfrc_val);/* * Changes to immediate action on Action Qualifier. This puts * Action Qualifier control on PWM output from next TBCLK
drivers/spi/spi-davinci.c +1 -1
@@ -220,7 +220,7 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value) pdata = &dspi->pdata;/* program delay transfers if tx_delay is non zero */ -if (spicfg->wdelay) +if (spicfg && spicfg->wdelay) spidat1 |=SPIDAT1_WDEL ;/*
drivers/video/fbdev/core/fbmem.c +32 -6
@@ -1687,12 +1687,12 @@ static int do_register_framebuffer(struct fb_info *fb_info)return 0 ; } -static int do_unregister_framebuffer (struct fb_info *fb_info) +static int unbind_console (struct fb_info *fb_info) {struct fb_event event; -int i, ret =0 ; +int ret; +int i = fb_info->node; - i = fb_info->node;if (i <0 || i >=FB_MAX || registered_fb[i] != fb_info)return -EINVAL ;
@@ -1707,17 +1707,29 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)unlock_fb_info (fb_info);console_unlock (); +return ret; +} + +static int __unlink_framebuffer (struct fb_info *fb_info); + +static int do_unregister_framebuffer (struct fb_info *fb_info) +{ +struct fb_event event; +int ret; + + ret =unbind_console (fb_info); +if (ret)return -EINVAL ;pm_vt_switch_unregister (fb_info->dev); -unlink_framebuffer (fb_info); +__unlink_framebuffer (fb_info);if (fb_info->pixmap.addr && (fb_info->pixmap.flags &FB_PIXMAP_DEFAULT ))kfree (fb_info->pixmap.addr);fb_destroy_modelist (&fb_info->modelist); - registered_fb[i] =NULL ; + registered_fb[fb_info->node] =NULL ; num_registered_fb--;fb_cleanup_device (fb_info); event.info = fb_info;
@@ -1730,7 +1742,7 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)return 0 ; } -int unlink_framebuffer (struct fb_info *fb_info) +static int __unlink_framebuffer (struct fb_info *fb_info) {int i;
@@ -1742,6 +1754,20 @@ int unlink_framebuffer(struct fb_info *fb_info)device_destroy (fb_class,MKDEV (FB_MAJOR , i)); fb_info->dev =NULL ; } + +return 0 ; +} + +int unlink_framebuffer (struct fb_info *fb_info) +{ +int ret; + + ret =__unlink_framebuffer (fb_info); +if (ret) +return ret; + +unbind_console (fb_info); +return 0 ; }EXPORT_SYMBOL (unlink_framebuffer);
fs/9p/xattr.c +4 -2
@@ -107,7 +107,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, {struct kvec kvec = {.iov_base = (void *)value, .iov_len = value_len};struct iov_iter from; -int retval; +int retval, err;iov_iter_kvec (&from,WRITE |ITER_KVEC , &kvec,1 , value_len);
@@ -128,7 +128,9 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, retval); else p9_client_write(fid, 0, &from, &retval); -p9_client_clunk (fid); + err =p9_client_clunk (fid); +if (!retval && err) + retval = err;return retval; }
fs/nfs/blocklayout/dev.c +1 -1
@@ -162,7 +162,7 @@ static bool bl_map_stripe(struct pnfs_block_dev *dev, u64 offset, chunk =div_u64 (offset, dev->chunk_size);div_u64_rem (chunk, dev->nr_children, &chunk_idx); -if (chunk_idx > dev->nr_children) { +if (chunk_idx >= dev->nr_children) {dprintk ("%s: invalid chunk idx %d (%lld/%lld)\n" , __func__, chunk_idx, offset, dev->chunk_size);/* error, should not happen */
fs/quota/quota.c +2 -0
@@ -17,6 +17,7 @@#include <linux/quotaops.h> #include <linux/types.h> #include <linux/writeback.h> +#include <linux/nospec.h> static int check_quotactl_permission (struct super_block *sb,int type,int cmd,qid_t id)
@@ -644,6 +645,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,if (type >= (XQM_COMMAND (cmd) ?XQM_MAXQUOTAS :MAXQUOTAS ))return -EINVAL ; + type =array_index_nospec (type,MAXQUOTAS );/* * Quota not supported on this fs? Check this before s_quota_types * since they needn't be set if quota is not supported at all.
fs/ubifs/journal.c +16 -2
@@ -661,6 +661,11 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,spin_lock (&ui->ui_lock); ui->synced_i_size = ui->ui_size;spin_unlock (&ui->ui_lock); +if (xent) { +spin_lock (&host_ui->ui_lock); + host_ui->synced_i_size = host_ui->ui_size; +spin_unlock (&host_ui->ui_lock); + }mark_inode_clean (c, ui);mark_inode_clean (c, host_ui);return 0 ;
@@ -1107,7 +1112,7 @@ static int recomp_data_node(const struct ubifs_info *c,int err, len, compr_type, out_len; out_len =le32_to_cpu (dn->size); - buf =kmalloc_array (out_len,WORST_COMPR_FACTOR ,GFP_NOFS ); + buf =kmalloc (out_len *WORST_COMPR_FACTOR ,GFP_NOFS );if (!buf)return -ENOMEM ;
@@ -1186,7 +1191,16 @@ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,else if (err) goto out_free;else { -if (le32_to_cpu (dn->size) <= dlen) +int dn_len =le32_to_cpu (dn->size); + +if (dn_len <=0 || dn_len >UBIFS_BLOCK_SIZE ) { +ubifs_err (c,"bad data node (block %u, inode %lu)" , + blk, inode->i_ino); +ubifs_dump_node (c, dn); + goto out_free; + } + +if (dn_len <= dlen) dlen =0 ;/* Nothing to do */ else {int compr_type =le16_to_cpu (dn->compr_type);
fs/ubifs/lprops.c +4 -4
@@ -1091,10 +1091,6 @@ static int scan_check_cb(struct ubifs_info *c, } } - buf =__vmalloc (c->leb_size,GFP_NOFS ,PAGE_KERNEL ); -if (!buf) -return -ENOMEM ; -/* * After an unclean unmount, empty and freeable LEBs * may contain garbage - do not scan them.
@@ -1113,6 +1109,10 @@ static int scan_check_cb(struct ubifs_info *c,return LPT_SCAN_CONTINUE ; } + buf =__vmalloc (c->leb_size,GFP_NOFS ,PAGE_KERNEL ); +if (!buf) +return -ENOMEM ; + sleb =ubifs_scan (c, lnum,0 , buf,0 );if (IS_ERR (sleb)) { ret =PTR_ERR (sleb);
fs/xattr.c +1 -1
@@ -453,7 +453,7 @@ getxattr(struct dentry *d, const char __user *name, void __user *value,if (error >0 ) {if ((strcmp (kname,XATTR_NAME_POSIX_ACL_ACCESS ) ==0 ) || (strcmp (kname,XATTR_NAME_POSIX_ACL_DEFAULT ) ==0 )) -posix_acl_fix_xattr_to_user (kvalue, size); +posix_acl_fix_xattr_to_user (kvalue, error);if (size &©_to_user (value, kvalue, error)) error = -EFAULT ; }else if (error == -ERANGE && size >=XATTR_SIZE_MAX ) {
include/linux/intel-iommu.h +5 -3
@@ -125,6 +125,7 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)* Extended Capability Register */ +#define ecap_dit (e) ((e >> 41) & 0x1)#define ecap_pasid (e) ((e >> 40) & 0x1)#define ecap_pss (e) ((e >> 35) & 0x1f)#define ecap_eafs (e) ((e >> 34) & 0x1)
@@ -294,6 +295,7 @@ enum {#define QI_DEV_IOTLB_SID (sid) ((u64)((sid) & 0xffff) << 32)#define QI_DEV_IOTLB_QDEP (qdep) (((qdep) & 0x1f) << 16)#define QI_DEV_IOTLB_ADDR (addr) ((u64)(addr) & VTD_PAGE_MASK) +#define QI_DEV_IOTLB_PFSID (pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xfff) << 52))#define QI_DEV_IOTLB_SIZE 1#define QI_DEV_IOTLB_MAX_INVS 32
@@ -318,6 +320,7 @@ enum {#define QI_DEV_EIOTLB_PASID (p) (((u64)p) << 32)#define QI_DEV_EIOTLB_SID (sid) ((u64)((sid) & 0xffff) << 16)#define QI_DEV_EIOTLB_QDEP (qd) ((u64)((qd) & 0x1f) << 4) +#define QI_DEV_EIOTLB_PFSID (pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xfff) << 52))#define QI_DEV_EIOTLB_MAX_INVS 32#define QI_PGRP_IDX (idx) (((u64)(idx)) << 55)
@@ -463,9 +466,8 @@ extern void qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm, u64 type);extern void qi_flush_iotlb (struct intel_iommu *iommu,u16 did,u64 addr,unsigned int size_order,u64 type); -extern void qi_flush_dev_iotlb (struct intel_iommu *iommu,u16 sid,u16 qdep, -u64 addr,unsigned mask); - +extern void qi_flush_dev_iotlb (struct intel_iommu *iommu,u16 sid,u16 pfsid, +u16 qdep,u64 addr,unsigned mask);extern int qi_submit_sync (struct qi_desc *desc,struct intel_iommu *iommu);extern int dmar_ir_support (void );
include/linux/io.h +22 -0
@@ -154,4 +154,26 @@ enum {void *memremap (resource_size_t offset,size_t size,unsigned long flags);void memunmap (void *addr); +/* +* On x86 PAT systems we have memory tracking that keeps track of +* the allowed mappings on memory ranges. This tracking works for +* all the in-kernel mapping APIs (ioremap*), but where the user +* wishes to map a range from a physical device into user memory +* the tracking won't be updated. This API is to be used by +* drivers which remap physical device pages into userspace, +* and wants to make sure they are mapped WC and not UC. +*/ +#ifndef arch_io_reserve_memtype_wc +static inline int arch_io_reserve_memtype_wc (resource_size_t base, +resource_size_t size) +{ +return 0 ; +} + +static inline void arch_io_free_memtype_wc (resource_size_t base, +resource_size_t size) +{ +} +#endif +#endif /* _LINUX_IO_H */
include/video/udlfb.h +1 -1
@@ -87,7 +87,7 @@ struct dlfb_data {#define MIN_RAW_PIX_BYTES 2#define MIN_RAW_CMD_BYTES (RAW_HEADER_BYTES + MIN_RAW_PIX_BYTES) -#define DL_DEFIO_WRITE_DELAY 5/* fb_deferred_io.delay in jiffies */ +#define DL_DEFIO_WRITE_DELAY msecs_to_jiffies(HZ <= 300 ? 4 : 10)/* optimal value for 720p video */ #define DL_DEFIO_WRITE_DISABLE (HZ*60)/* "disable" with long delay */ /* remove these once align.h patch is taken into kernel */
kernel/kthread.c +7 -1
@@ -313,10 +313,16 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), task = create->result;if (!IS_ERR (task)) {static const struct sched_param param = { .sched_priority =0 }; +char name[TASK_COMM_LEN ];va_list args;va_start (args, namefmt); -vsnprintf (task->comm,sizeof (task->comm), namefmt, args); +/* +* task is already visible to other tasks, so updating +* COMM must be protected. +*/ +vsnprintf (name,sizeof (name), namefmt, args); +set_task_comm (task, name);va_end (args);/* * root may have changed our (kthreadd's) priority or CPU mask.
kernel/power/Kconfig +1 -0
@@ -105,6 +105,7 @@ config PM_SLEEP def_bool y depends on SUSPEND || HIBERNATE_CALLBACKS select PM + select SRCU config PM_SLEEP_SMP def_bool y
kernel/sys.c +45 -50
171 lines not on this page · raw message
kernel/trace/blktrace.c +4 -0
@@ -1716,6 +1716,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,mutex_lock (&bdev->bd_mutex);if (attr == &dev_attr_enable) { +if (!!value == !!q->blk_trace) { + ret =0 ; + goto out_unlock_bdev; + }if (value) ret =blk_trace_setup_queue (q, bdev);else
kernel/trace/trace.c +3 -1
@@ -6496,7 +6496,9 @@ rb_simple_write(struct file *filp, const char __user *ubuf,if (buffer) {mutex_lock (&trace_types_lock); -if (val) { +if (!!val ==tracer_tracing_is_on (tr)) { + val =0 ;/* do nothing */ + }else if (val) {tracer_tracing_on (tr);if (tr->current_trace->start) tr->current_trace->start (tr);
kernel/trace/trace_uprobe.c +1 -1
@@ -969,7 +969,7 @@ probe_event_disable(struct trace_uprobe *tu, struct trace_event_file *file)list_del_rcu (&link->list);/* synchronize with u{,ret}probe_trace_func */ -synchronize_sched (); +synchronize_rcu ();kfree (link);if (!list_empty (&tu->tp.files))
kernel/user_namespace.c +19 -20
@@ -602,9 +602,26 @@ static ssize_t map_write(struct file *file, const char __user *buf,struct uid_gid_map new_map;unsigned idx;struct uid_gid_extent *extent =NULL ; -unsigned long page =0 ; +unsigned long page;char *kbuf, *pos, *next_line; -ssize_t ret = -EINVAL ; +ssize_t ret; + +/* Only allow < page size writes at the beginning of the file */ +if ((*ppos !=0 ) || (count >=PAGE_SIZE )) +return -EINVAL ; + +/* Get a buffer */ + page =__get_free_page (GFP_TEMPORARY ); + kbuf = (char *) page; +if (!page) +return -ENOMEM ; + +/* Slurp in the user data */ +if (copy_from_user (kbuf, buf, count)) { +free_page (page); +return -EFAULT ; + } + kbuf[count] ='\0' ;/* * The userns_state_mutex serializes all writes to any given map.
@@ -638,24 +655,6 @@ static ssize_t map_write(struct file *file, const char __user *buf,if (cap_valid (cap_setid) && !file_ns_capable (file, ns,CAP_SYS_ADMIN )) goto out; -/* Get a buffer */ - ret = -ENOMEM ; - page =__get_free_page (GFP_TEMPORARY ); - kbuf = (char *) page; -if (!page) - goto out; - -/* Only allow < page size writes at the beginning of the file */ - ret = -EINVAL ; -if ((*ppos !=0 ) || (count >=PAGE_SIZE )) - goto out; - -/* Slurp in the user data */ - ret = -EFAULT ; -if (copy_from_user (kbuf, buf, count)) - goto out; - kbuf[count] ='\0' ; -/* Parse the user data */ ret = -EINVAL ; pos = kbuf;
kernel/utsname_sysctl.c +25 -16
66 lines not on this page · raw message
mm/memory.c +0 -9
@@ -361,15 +361,6 @@ void tlb_remove_table(struct mmu_gather *tlb, void *table) {struct mmu_table_batch **batch = &tlb->batch; -/* -* When there's less then two users of this mm there cannot be a -* concurrent page-table walk. -*/ -if (atomic_read (&tlb->mm->mm_users) <2 ) { -__tlb_remove_table (table); -return ; - } -if (*batch ==NULL ) { *batch = (struct mmu_table_batch *)__get_free_page (GFP_NOWAIT | __GFP_NOWARN);if (*batch ==NULL ) {
net/9p/client.c +1 -1
@@ -931,7 +931,7 @@ static int p9_client_version(struct p9_client *c) {int err =0 ;struct p9_req_t *req; -char *version; +char *version =NULL ;int msize; p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
net/9p/trans_fd.c +6 -1
@@ -185,6 +185,8 @@ static void p9_mux_poll_stop(struct p9_conn *m)spin_lock_irqsave (&p9_poll_lock, flags);list_del_init (&m->poll_pending_link);spin_unlock_irqrestore (&p9_poll_lock, flags); + +flush_work (&p9_poll_work); }/**
@@ -933,7 +935,7 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)if (err <0 )return err; -if (valid_ipaddr4 (addr) <0 ) +if (addr ==NULL ||valid_ipaddr4 (addr) <0 )return -EINVAL ; csocket =NULL ;
@@ -981,6 +983,9 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args) csocket =NULL ; +if (addr ==NULL ) +return -EINVAL ; +if (strlen (addr) >=UNIX_PATH_MAX ) {pr_err ("%s (%d): address too long: %s\n" , __func__,task_pid_nr (current), addr);
net/9p/trans_rdma.c +3 -0
@@ -644,6 +644,9 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args)struct ib_qp_init_attr qp_attr;struct ib_cq_init_attr cq_attr = {}; +if (addr ==NULL ) +return -EINVAL ; +/* Parse the transport specific mount options */ err =parse_opts (args, &opts);if (err <0 )
net/9p/trans_virtio.c +12 -1
@@ -192,7 +192,7 @@ static int pack_sg_list(struct scatterlist *sg, int start, s =rest_of_page (data);if (s > count) s = count; -BUG_ON (index > limit); +BUG_ON (index >= limit);/* Make sure we don't terminate early. */ sg_unmark_end (&sg[index]);sg_set_buf (&sg[index++], data, s);
@@ -237,6 +237,7 @@ pack_sg_list_p(struct scatterlist *sg, int start, int limit, s =PAGE_SIZE - data_off;if (s > count) s = count; +BUG_ON (index >= limit);/* Make sure we don't terminate early. */ sg_unmark_end (&sg[index]);sg_set_page (&sg[index++], pdata[i++], s, data_off);
@@ -409,6 +410,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,p9_debug (P9_DEBUG_TRANS ,"virtio request\n" );if (uodata) { +__le32 sz;int n =p9_get_mapped_pages (chan, &out_pages, uodata, outlen, &offs, &need_drop);if (n <0 )
@@ -419,6 +421,12 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,memcpy (&req->tc->sdata[req->tc->size -4 ], &v,4 ); outlen = n; } +/* The size field of the message must include the length of the +* header and the length of the data. We didn't actually know +* the length of the data until this point so add it in now. +*/ + sz =cpu_to_le32 (req->tc->size + outlen); +memcpy (&req->tc->sdata[0 ], &sz,sizeof (sz)); }else if (uidata) {int n =p9_get_mapped_pages (chan, &in_pages, uidata, inlen, &offs, &need_drop);
@@ -646,6 +654,9 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args)int ret = -ENOENT ;int found =0 ; +if (devname ==NULL ) +return -EINVAL ; +mutex_lock (&virtio_9p_lock);list_for_each_entry (chan, &virtio_chan_list, chan_list) { if (!strncmp(devname, chan->tag, chan->tag_len) &&
net/ieee802154/6lowpan/tx.c +18 -3
@@ -265,9 +265,24 @@ netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *ldev)/* We must take a copy of the skb before we modify/replace the ipv6 * header as the header could be used elsewhere */ - skb =skb_unshare (skb,GFP_ATOMIC ); -if (!skb) -return NET_XMIT_DROP ; +if (unlikely (skb_headroom (skb) < ldev->needed_headroom || +skb_tailroom (skb) < ldev->needed_tailroom)) { +struct sk_buff *nskb; + + nskb =skb_copy_expand (skb, ldev->needed_headroom, + ldev->needed_tailroom,GFP_ATOMIC ); +if (likely (nskb)) { +consume_skb (skb); + skb = nskb; + }else { +kfree_skb (skb); +return NET_XMIT_DROP ; + } + }else { + skb =skb_unshare (skb,GFP_ATOMIC ); +if (!skb) +return NET_XMIT_DROP ; + } ret =lowpan_header (skb, ldev, &dgram_size, &dgram_offset);if (ret <0 ) {
net/mac802154/tx.c +14 -1
@@ -72,8 +72,21 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)int ret;if (!(local->hw.flags &IEEE802154_HW_TX_OMIT_CKSUM )) { -u16 crc =crc_ccitt (0 , skb->data, skb->len); +struct sk_buff *nskb; +u16 crc; + +if (unlikely (skb_tailroom (skb) <IEEE802154_FCS_LEN )) { + nskb =skb_copy_expand (skb,0 ,IEEE802154_FCS_LEN , +GFP_ATOMIC ); +if (likely (nskb)) { +consume_skb (skb); + skb = nskb; + }else { + goto err_tx; + } + } + crc =crc_ccitt (0 , skb->data, skb->len);put_unaligned_le16 (crc,skb_put (skb,2 )); }
tools/perf/util/auxtrace.c +3 -0
@@ -186,6 +186,9 @@ static int auxtrace_queues__grow(struct auxtrace_queues *queues,for (i =0 ; i < queues->nr_queues; i++) {list_splice_tail (&queues->queue_array[i].head, &queue_array[i].head); + queue_array[i].tid = queues->queue_array[i].tid; + queue_array[i].cpu = queues->queue_array[i].cpu; + queue_array[i].set = queues->queue_array[i].set; queue_array[i].priv = queues->queue_array[i].priv; }