Linux 4.9.1
Greg KH
maintainerI'm announcing the release of the 4.9.1 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:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/alpha/kernel/ptrace.c | 2 arch/arm/xen/enlighten.c | 3 arch/blackfin/kernel/ptrace.c | 4 arch/cris/arch-v32/kernel/ptrace.c | 2 arch/ia64/kernel/ptrace.c | 2 arch/mips/kernel/ptrace32.c | 4 arch/powerpc/kernel/ptrace32.c | 4 arch/x86/include/asm/asm-prototypes.h | 16 +++ block/blk-mq.c | 6 - drivers/base/power/opp/core.c | 38 +++---- drivers/block/loop.c | 2 drivers/char/tpm/xen-tpmfront.c | 1 drivers/clk/ti/clk-3xxx.c | 20 ++-- drivers/clk/ti/clock.h | 9 + drivers/clk/ti/dpll.c | 19 +++ drivers/clk/ti/dpll3xxx.c | 67 +++++++++++++ drivers/cpufreq/cpufreq-dt.c | 12 +- drivers/crypto/caam/caamalg.c | 4 drivers/md/dm-crypt.c | 7 + drivers/md/dm-flakey.c | 2 drivers/md/dm-raid.c | 9 - drivers/md/dm-rq.c | 10 +- drivers/md/dm-table.c | 24 +++- drivers/md/persistent-data/dm-space-map-metadata.c | 14 +- drivers/nvme/target/configfs.c | 6 - drivers/nvme/target/core.c | 14 +- drivers/nvme/target/nvmet.h | 6 - drivers/usb/class/cdc-acm.c | 1 drivers/usb/core/hub.c | 101 +++++++-------------- drivers/usb/core/ledtrig-usbport.c | 7 - drivers/usb/dwc3/gadget.c | 13 ++ drivers/usb/gadget/composite.c | 11 +- drivers/usb/gadget/function/f_uac2.c | 14 +- drivers/usb/gadget/function/uvc_video.c | 2 drivers/usb/host/uhci-pci.c | 4 drivers/usb/serial/kl5kusb105.c | 33 ++++-- drivers/usb/serial/option.c | 7 + drivers/usb/usbip/vudc_transfer.c | 2 drivers/watchdog/mei_wdt.c | 2 drivers/watchdog/qcom-wdt.c | 2 drivers/xen/gntdev.c | 2 fs/block_dev.c | 2 fs/btrfs/async-thread.c | 14 ++ fs/btrfs/async-thread.h | 1 fs/btrfs/ctree.h | 4 fs/btrfs/delayed-inode.c | 6 - fs/btrfs/disk-io.c | 23 +++- fs/btrfs/qgroup.c | 5 - fs/btrfs/relocation.c | 15 ++- fs/btrfs/tree-log.c | 7 - fs/cifs/cifsglob.h | 4 fs/cifs/cifsproto.h | 3 fs/cifs/connect.c | 34 +++++-- fs/cifs/file.c | 8 + fs/cifs/ioctl.c | 2 fs/cifs/smb2file.c | 2 fs/cifs/smb2pdu.c | 87 ++++++++++++------ fs/cifs/smb2pdu.h | 2 fs/cifs/smb2proto.h | 1 fs/cifs/smbencrypt.c | 40 +------- fs/exec.c | 31 +++++- fs/ext4/ext4_jbd2.h | 14 +- fs/ext4/inline.c | 4 fs/ext4/inode.c | 6 + fs/ext4/mballoc.c | 4 fs/ext4/super.c | 74 +++++++++------ fs/f2fs/checkpoint.c | 8 + fs/f2fs/debug.c | 1 fs/f2fs/f2fs.h | 36 ++++--- fs/f2fs/file.c | 4 fs/f2fs/super.c | 7 - fs/splice.c | 9 + fs/xfs/xfs_bmap_util.c | 7 + fs/xfs/xfs_log_recover.c | 1 include/asm-generic/asm-prototypes.h | 7 + include/linux/capability.h | 2 include/linux/cpu.h | 15 --- include/linux/mm.h | 2 include/linux/mm_types.h | 1 include/linux/pm_opp.h | 11 +- include/linux/ptrace.h | 4 include/linux/sched.h | 1 kernel/capability.c | 36 +++++++ kernel/cpu.c | 2 kernel/debug/debug_core.c | 4 kernel/fork.c | 9 + kernel/ptrace.c | 70 ++++++++++---- kernel/watchdog.c | 1 mm/filemap.c | 2 mm/init-mm.c | 2 mm/memory.c | 2 mm/nommu.c | 2 mm/page_alloc.c | 12 ++ mm/vmscan.c | 14 ++ scripts/package/builddeb | 2 sound/pci/hda/hda_auto_parser.c | 4 sound/pci/hda/patch_ca0132.c | 1 sound/pci/hda/patch_conexant.c | 17 +++ sound/pci/hda/patch_realtek.c | 3 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 6 + sound/usb/hiface/pcm.c | 2 sound/usb/mixer.c | 3 103 files changed, 813 insertions(+), 400 deletions(-)
Adam Borowski (2):
builddeb: fix cross-building to arm64 producing host-arch debs x86/kbuild: enable modversions for symbols exported from asm
Alan Stern (1):
USB: UHCI: report non-PME wakeup signalling for Intel hardware
Aleksa Sarai (1):
fs: exec: apply CLOEXEC before changing dumpable task flags
Alex Porosanu (1):
crypto: caam - fix AEAD givenc descriptors
Alexander Usyskin (1):
watchdog: mei_wdt: request stop on reboot to prevent false positive event
Andy Lutomirski (1):
cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack
Bart Van Assche (3):
blk-mq: Do not invoke .queue_rq() for a stopped queue
dm table: an 'all_blk_mq' table must be loaded for a blk-mq DM device dm rq: fix a race condition in rq_completed()
Benjamin Marzinski (1):
dm space map metadata: fix 'struct sm_metadata' leak on failed create
Boris Ostrovsky (1):
xen/gntdev: Use VM_MIXEDMAP instead of VM_IO to avoid NUMA balancing
Chandan Rajendra (2):
ext4: fix mballoc breakage with 64k block size
ext4: fix stack memory corruption with 64k block size
Christian Lamparter (1):
watchdog: qcom: fix kernel panic due to external abort on non-linefetch
Con Kolivas (1):
ALSA: usb-audio: Add QuickCam Communicate Deluxe/S7500 to volume_control_quirks
Dan Carpenter (1):
ext4: return -ENOMEM instead of success
Daniele Palmas (1):
USB: serial: option: add support for Telit LE922A PIDs 0x1040, 0x1041
Darrick J. Wong (1):
ext4: reject inodes with negative size
David Sterba (1):
btrfs: store and load values of stripes_min/stripes_max in balance status item
Douglas Anderson (1):
kernel/debug/debug_core.c: more properly delay for secondary CPUs
Eric Sandeen (2):
xfs: fix up xfs_swap_extent_forks inline extent handling
xfs: set AGI buffer type in xlog_recover_clear_agi_bucket
Eric W. Biederman (4):
exec: Ensure mm->user_ns contains the execed files
mm: Add a user_ns owner to mm_struct and fix ptrace permission checks
ptrace: Capture the ptracer's creds not PT_PTRACE_CAP
ptrace: Don't allow accessing an undumpable mm
Felipe Balbi (3):
usb: dwc3: gadget: set PCM1 field of isochronous-first TRBs
usb: gadget: composite: correctly initialize ep->maxpacket
usb: gadget: composite: always set ep->mult to a sensible valueFilipe Manana (3):
Btrfs: fix relocation incorrectly dropping data references
Btrfs: fix emptiness check for dirtied extent buffers at check_leaf()
Btrfs: fix qgroup rescan worker initialization
Giuseppe Lippolis (1):
USB: serial: option: add dlink dwm-158
Greg Kroah-Hartman (1):
Linux 4.9.1
Heinz Mauelshagen (1):
dm raid: fix discard support regression
Hui Wang (2):
ALSA: hda - ignore the assoc and seq when comparing pin configurations
ALSA: hda - fix headset-mic problem on a Dell laptop
Jaegeuk Kim (3):
Revert "f2fs: use percpu_counter for # of dirty pages in inode"
f2fs: fix overflow due to condition check order
f2fs: fix to determine start_cp_addr by sbi->cur_cp_pack
Jason Gunthorpe (1):
tpm xen: Remove bogus tpm_chip_unregister
Johan Hovold (1):
USB: serial: kl5kusb105: fix open error path
Julien Grall (1):
arm/xen: Use alloc_percpu rather than __alloc_percpu
Jussi Laako (1):
ALSA: hiface: Fix M2Tech hiFace driver sampling rate change
Kai-Heng Feng (1):
ALSA: hda: when comparing pin configurations, ignore assoc in addition to seq
Konstantin Khlebnikov (1):
kernel/watchdog: use nmi registers snapshot in hardlockup handler
Krzysztof Opasiak (1):
usbip: vudc: fix: Clear already_seen flag also for ep0
Linus Torvalds (2):
splice: reinstate SIGPIPE/EPIPE handling vfs,mm: fix return value of read() at s_maxbytes
Liu Bo (1):
Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty
Mathias Nyman (1):
usb: hub: Fix auto-remount of safely removed or ejected USB-3 devices
Maxim Patlasov (1):
btrfs: limit async_work allocation and worker func duration
Mel Gorman (1):
mm, page_alloc: keep pcp count and list contents in sync if struct page is corrupted
Michal Hocko (1):
hotplug: Make register and unregister notifier API symmetric
Mike Snitzer (1):
dm table: fix 'all_blk_mq' inconsistency when an empty table is loaded
Nathaniel Quillin (1):
USB: cdc-acm: add device id for GW Instek AFG-125
NeilBrown (1):
block_dev: don't test bdev->bd_contains when it is not stable
Nicolai Stange (1):
f2fs: set ->owner for debugfs status file's file_operations
Omar Sandoval (1):
loop: return proper error from loop_queue_rq()
Ondrej Kozina (1):
dm crypt: mark key as invalid until properly loaded
Pavel Shilovsky (5):
CIFS: Fix a possible memory corruption during reconnect
CIFS: Fix missing nls unload in smb2_reconnect()
CIFS: Fix a possible double locking of mutex during reconnect
CIFS: Decrease verbosity of ioctl call
CIFS: Fix a possible memory corruption in push locks
Peter Chen (1):
usb: gadget: f_uac2: fix error handling at afunc_bind
Rafał Miłecki (1):
usb: core: usbport: Use proper LED API to fix potential crash
Richard Watts (1):
clk: ti: omap36xx: Work around sprz319 advisory 2.1
Robbie Ko (2):
Btrfs: fix deadlock caused by fsync when logging directory entries
Btrfs: fix tree search logic when replaying directory entry deletes
Sergey Karamov (1):
ext4: do not perform data journaling when data is encrypted
Shaohua Li (1):
mm/vmscan.c: set correct defer count for shrinker
Solganik Alexander (1):
nvmet: Fix possible infinite loop triggered on hot namespace removal
Stephen Boyd (1):
PM / OPP: Pass opp_table to dev_pm_opp_put_regulator()
Sven Hahne (1):
ALSA: hda/ca0132 - Add quirk for Alienware 15 R2 2016
Takashi Iwai (2):
ALSA: hda - Gate the mic jack on HP Z1 Gen3 AiO
ASoC: intel: Fix crash at suspend/resume without card registration
Theodore Ts'o (4):
ext4: don't lock buffer in ext4_commit_super if holding spinlock
ext4: use more strict checks for inodes_per_block on mount
ext4: fix in-superblock mount options processing
ext4: add sanity checking to count_overhead()
Viresh Kumar (1):
PM / OPP: Don't use OPP structure outside of rcu protected section
Wei Yongjun (1):
dm flakey: return -EINVAL on interval bounds error in flakey_ctr()
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 0 +SUBLEVEL = 1 EXTRAVERSION = NAME = Roaring Lionus
arch/alpha/kernel/ptrace.c +1 -1
@@ -283,7 +283,7 @@ long arch_ptrace(struct task_struct *child, long request,/* When I and D space are separate, these will need to be fixed. */ case PTRACE_PEEKTEXT :/* read word at location addr. */ case PTRACE_PEEKDATA : - copied =access_process_vm (child, addr, &tmp,sizeof (tmp), + copied =ptrace_access_vm (child, addr, &tmp,sizeof (tmp),FOLL_FORCE ); ret = -EIO ;if (copied !=sizeof (tmp))
arch/arm/xen/enlighten.c +1 -2
@@ -372,8 +372,7 @@ static int __init xen_guest_init(void)* for secondary CPUs as they are brought up. * For uniformity we use VCPUOP_register_vcpu_info even on cpu0. */ - xen_vcpu_info =__alloc_percpu (sizeof (struct vcpu_info ), -sizeof (struct vcpu_info )); + xen_vcpu_info = alloc_percpu(struct vcpu_info);if (xen_vcpu_info ==NULL )return -ENOMEM ;
arch/blackfin/kernel/ptrace.c +2 -2
@@ -270,7 +270,7 @@ long arch_ptrace(struct task_struct *child, long request,switch (bfin_mem_access_type (addr, to_copy)) {case BFIN_MEM_ACCESS_CORE :case BFIN_MEM_ACCESS_CORE_ONLY : - copied =access_process_vm (child, addr, &tmp, + copied =ptrace_access_vm (child, addr, &tmp, to_copy,FOLL_FORCE );if (copied)break ;
@@ -323,7 +323,7 @@ long arch_ptrace(struct task_struct *child, long request,switch (bfin_mem_access_type (addr, to_copy)) {case BFIN_MEM_ACCESS_CORE :case BFIN_MEM_ACCESS_CORE_ONLY : - copied =access_process_vm (child, addr, &data, + copied =ptrace_access_vm (child, addr, &data, to_copy,FOLL_FORCE |FOLL_WRITE );break ;
arch/cris/arch-v32/kernel/ptrace.c +1 -1
@@ -147,7 +147,7 @@ long arch_ptrace(struct task_struct *child, long request,/* The trampoline page is globally mapped, no page table to traverse.*/ tmp = *(unsigned long *)addr; }else { - copied =access_process_vm (child, addr, &tmp,sizeof (tmp),FOLL_FORCE ); + copied =ptrace_access_vm (child, addr, &tmp,sizeof (tmp),FOLL_FORCE );if (copied !=sizeof (tmp))break ;
arch/ia64/kernel/ptrace.c +1 -1
@@ -1159,7 +1159,7 @@ arch_ptrace (struct task_struct *child, long request,case PTRACE_PEEKTEXT :case PTRACE_PEEKDATA :/* read word at location addr */ -if (access_process_vm (child, addr, &data,sizeof (data), +if (ptrace_access_vm (child, addr, &data,sizeof (data),FOLL_FORCE ) !=sizeof (data))return -EIO ;
arch/mips/kernel/ptrace32.c +2 -2
@@ -69,7 +69,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,if (get_user (addrOthers, (u32 __user *__user *) (unsigned long ) addr) !=0 )break ; - copied =access_process_vm (child, (u64 )addrOthers, &tmp, + copied =ptrace_access_vm (child, (u64 )addrOthers, &tmp,sizeof (tmp),FOLL_FORCE );if (copied !=sizeof (tmp))break ;
@@ -178,7 +178,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,if (get_user (addrOthers, (u32 __user *__user *) (unsigned long ) addr) !=0 )break ; ret =0 ; -if (access_process_vm (child, (u64 )addrOthers, &data, +if (ptrace_access_vm (child, (u64 )addrOthers, &data,sizeof (data),FOLL_FORCE |FOLL_WRITE ) ==sizeof (data))break ;
arch/powerpc/kernel/ptrace32.c +2 -2
@@ -73,7 +73,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,if (get_user (addrOthers, (u32 __user *__user *)addr) !=0 )break ; - copied =access_process_vm (child, (u64 )addrOthers, &tmp, + copied =ptrace_access_vm (child, (u64 )addrOthers, &tmp,sizeof (tmp),FOLL_FORCE );if (copied !=sizeof (tmp))break ;
@@ -178,7 +178,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,if (get_user (addrOthers, (u32 __user *__user *)addr) !=0 )break ; ret =0 ; -if (access_process_vm (child, (u64 )addrOthers, &tmp, +if (ptrace_access_vm (child, (u64 )addrOthers, &tmp,sizeof (tmp),FOLL_FORCE |FOLL_WRITE ) ==sizeof (tmp))break ;
arch/x86/include/asm/asm-prototypes.h new file +16 -0
@@ -0,0 +1,16 @@ +#include <asm/ftrace.h> +#include <asm/uaccess.h> +#include <asm/string.h> +#include <asm/page.h> +#include <asm/checksum.h> + +#include <asm-generic/asm-prototypes.h> + +#include <asm/page.h> +#include <asm/pgtable.h> +#include <asm/special_insns.h> +#include <asm/preempt.h> + +#ifndef CONFIG_X86_CMPXCHG64 +extern void cmpxchg8b_emu (void ); +#endif
block/blk-mq.c +3 -3
@@ -1332,9 +1332,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)blk_mq_put_ctx (data.ctx);if (!old_rq) goto done; -if (!blk_mq_direct_issue_request (old_rq, &cookie)) - goto done; -blk_mq_insert_request (old_rq, false, true, true); +if (test_bit (BLK_MQ_S_STOPPED , &data.hctx->state) || +blk_mq_direct_issue_request (old_rq, &cookie) !=0 ) +blk_mq_insert_request (old_rq, false, true, true); goto done; }
drivers/base/power/opp/core.c +19 -19
@@ -584,6 +584,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)struct clk *clk;unsigned long freq, old_freq;unsigned long u_volt, u_volt_min, u_volt_max; +unsigned long old_u_volt, old_u_volt_min, old_u_volt_max;int ret;if (unlikely (!target_freq)) {
@@ -633,6 +634,14 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)return ret; } +if (IS_ERR (old_opp)) { + old_u_volt =0 ; + }else { + old_u_volt = old_opp->u_volt; + old_u_volt_min = old_opp->u_volt_min; + old_u_volt_max = old_opp->u_volt_max; + } + u_volt = opp->u_volt; u_volt_min = opp->u_volt_min; u_volt_max = opp->u_volt_max;
@@ -677,9 +686,10 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) __func__, old_freq); restore_voltage:/* This shouldn't harm even if the voltages weren't updated earlier */ -if (!IS_ERR (old_opp)) -_set_opp_voltage (dev, reg, old_opp->u_volt, - old_opp->u_volt_min, old_opp->u_volt_max); +if (old_u_volt) { +_set_opp_voltage (dev, reg, old_u_volt, old_u_volt_min, + old_u_volt_max); + }return ret; }
@@ -1316,7 +1326,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_put_prop_name);* that this function is *NOT* called under RCU protection or in contexts where * mutex cannot be locked. */ -int dev_pm_opp_set_regulator (struct device *dev,const char *name) +struct opp_table *dev_pm_opp_set_regulator (struct device *dev,const char *name) {struct opp_table *opp_table;struct regulator *reg;
@@ -1354,20 +1364,20 @@ int dev_pm_opp_set_regulator(struct device *dev, const char *name) opp_table->regulator = reg;mutex_unlock (&opp_table_lock); -return 0 ; +return opp_table; err:_remove_opp_table (opp_table); unlock:mutex_unlock (&opp_table_lock); -return ret; +return ERR_PTR (ret); }EXPORT_SYMBOL_GPL (dev_pm_opp_set_regulator);/** * dev_pm_opp_put_regulator() - Releases resources blocked for regulator -* @dev: Device for which regulator was set. +* @opp_table: OPP table returned from dev_pm_opp_set_regulator(). * * Locking: The internal opp_table and opp structures are RCU protected. * Hence this function internally uses RCU updater strategy with mutex locks
@@ -1375,22 +1385,12 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_set_regulator);* that this function is *NOT* called under RCU protection or in contexts where * mutex cannot be locked. */ -void dev_pm_opp_put_regulator (struct device *dev) +void dev_pm_opp_put_regulator (struct opp_table *opp_table) { -struct opp_table *opp_table; -mutex_lock (&opp_table_lock); -/* Check for existing table for 'dev' first */ - opp_table =_find_opp_table (dev); -if (IS_ERR (opp_table)) { -dev_err (dev,"Failed to find opp_table: %ld\n" , -PTR_ERR (opp_table)); - goto unlock; - } -if (IS_ERR (opp_table->regulator)) { -dev_err (dev,"%s: Doesn't have regulator set\n" , __func__); +pr_err ("%s: Doesn't have regulator set\n" , __func__); goto unlock; }
drivers/block/loop.c +1 -1
@@ -1646,7 +1646,7 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx,blk_mq_start_request (bd->rq);if (lo->lo_state != Lo_bound) -return -EIO ; +return BLK_MQ_RQ_QUEUE_ERROR ;switch (req_op (cmd->rq)) {case REQ_OP_FLUSH :
drivers/char/tpm/xen-tpmfront.c +0 -1
@@ -307,7 +307,6 @@ static int tpmfront_probe(struct xenbus_device *dev, rv =setup_ring (dev, priv);if (rv) { chip =dev_get_drvdata (&dev->dev); -tpm_chip_unregister (chip);ring_free (priv);return rv; }
drivers/clk/ti/clk-3xxx.c +10 -10
@@ -22,13 +22,6 @@#include "clock.h" -/* -* DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks -* that are sourced by DPLL5, and both of these require this clock -* to be at 120 MHz for proper operation. -*/ -#define DPLL5_FREQ_FOR_USBHOST 120000000 -#define OMAP3430ES2_ST_DSS_IDLE_SHIFT 1#define OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT 5#define OMAP3430ES2_ST_SSI_IDLE_SHIFT 8
@@ -546,14 +539,21 @@ void __init omap3_clk_lock_dpll5(void)struct clk *dpll5_clk;struct clk *dpll5_m2_clk; +/* +* Errata sprz319f advisory 2.1 documents a USB host clock drift issue +* that can be worked around using specially crafted dpll5 settings +* with a dpll5_m2 divider set to 8. Set the dpll5 rate to 8x the USB +* host clock rate, its .set_rate handler() will detect that frequency +* and use the errata settings. +*/ dpll5_clk =clk_get (NULL ,"dpll5_ck" ); -clk_set_rate (dpll5_clk,DPLL5_FREQ_FOR_USBHOST ); +clk_set_rate (dpll5_clk,OMAP3_DPLL5_FREQ_FOR_USBHOST *8 );clk_prepare_enable (dpll5_clk); -/* Program dpll5_m2_clk divider for no division */ +/* Program dpll5_m2_clk divider */ dpll5_m2_clk =clk_get (NULL ,"dpll5_m2_ck" );clk_prepare_enable (dpll5_m2_clk); -clk_set_rate (dpll5_m2_clk,DPLL5_FREQ_FOR_USBHOST ); +clk_set_rate (dpll5_m2_clk,OMAP3_DPLL5_FREQ_FOR_USBHOST );clk_disable_unprepare (dpll5_m2_clk);clk_disable_unprepare (dpll5_clk);
drivers/clk/ti/clock.h +9 -0
@@ -257,11 +257,20 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,unsigned long omap3_clkoutx2_recalc (struct clk_hw *hw,unsigned long parent_rate); +/* +* OMAP3_DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks +* that are sourced by DPLL5, and both of these require this clock +* to be at 120 MHz for proper operation. +*/ +#define OMAP3_DPLL5_FREQ_FOR_USBHOST 120000000 +unsigned long omap3_dpll_recalc (struct clk_hw *hw,unsigned long parent_rate);int omap3_dpll4_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate);int omap3_dpll4_set_rate_and_parent (struct clk_hw *hw,unsigned long rate,unsigned long parent_rate,u8 index); +int omap3_dpll5_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long parent_rate);void omap3_clk_lock_dpll5 (void ); unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
drivers/clk/ti/dpll.c +18 -1
@@ -114,6 +114,18 @@ static const struct clk_ops omap3_dpll_ck_ops = { .round_rate = &omap2_dpll_round_rate, }; +static const struct clk_ops omap3_dpll5_ck_ops = { + .enable = &omap3_noncore_dpll_enable, + .disable = &omap3_noncore_dpll_disable, + .get_parent = &omap2_init_dpll_parent, + .recalc_rate = &omap3_dpll_recalc, + .set_rate = &omap3_dpll5_set_rate, + .set_parent = &omap3_noncore_dpll_set_parent, + .set_rate_and_parent = &omap3_noncore_dpll_set_rate_and_parent, + .determine_rate = &omap3_noncore_dpll_determine_rate, + .round_rate = &omap2_dpll_round_rate, +}; +static const struct clk_ops omap3_dpll_per_ck_ops = { .enable = &omap3_noncore_dpll_enable, .disable = &omap3_noncore_dpll_disable,
@@ -474,7 +486,12 @@ static void __init of_ti_omap3_dpll_setup(struct device_node *node) .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), }; -of_ti_dpll_setup (node, &omap3_dpll_ck_ops, &dd); +if ((of_machine_is_compatible ("ti,omap3630" ) || +of_machine_is_compatible ("ti,omap36xx" )) && + !strcmp (node->name,"dpll5_ck" )) +of_ti_dpll_setup (node, &omap3_dpll5_ck_ops, &dd); +else +of_ti_dpll_setup (node, &omap3_dpll_ck_ops, &dd); }CLK_OF_DECLARE (ti_omap3_dpll_clock,"ti,omap3-dpll-clock" , of_ti_omap3_dpll_setup);
drivers/clk/ti/dpll3xxx.c +67 -0
70 lines not on this page · raw message
drivers/cpufreq/cpufreq-dt.c +8 -4
@@ -28,6 +28,7 @@#include "cpufreq-dt.h" struct private_data { +struct opp_table *opp_table;struct device *cpu_dev;struct thermal_cooling_device *cdev;const char *reg_name;
@@ -143,6 +144,7 @@ static int resources_available(void)static int cpufreq_init (struct cpufreq_policy *policy) {struct cpufreq_frequency_table *freq_table; +struct opp_table *opp_table =NULL ;struct private_data *priv;struct device *cpu_dev;struct clk *cpu_clk;
@@ -186,8 +188,9 @@ static int cpufreq_init(struct cpufreq_policy *policy)*/ name =find_supply_name (cpu_dev);if (name) { - ret =dev_pm_opp_set_regulator (cpu_dev, name); -if (ret) { + opp_table =dev_pm_opp_set_regulator (cpu_dev, name); +if (IS_ERR (opp_table)) { + ret =PTR_ERR (opp_table);dev_err (cpu_dev,"Failed to set regulator for cpu%d: %d\n" , policy->cpu, ret); goto out_put_clk;
@@ -237,6 +240,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) } priv->reg_name = name; + priv->opp_table = opp_table; ret =dev_pm_opp_init_cpufreq_table (cpu_dev, &freq_table);if (ret) {
@@ -285,7 +289,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) out_free_opp:dev_pm_opp_of_cpumask_remove_table (policy->cpus);if (name) -dev_pm_opp_put_regulator (cpu_dev); +dev_pm_opp_put_regulator (opp_table); out_put_clk:clk_put (cpu_clk);
@@ -300,7 +304,7 @@ static int cpufreq_exit(struct cpufreq_policy *policy)dev_pm_opp_free_cpufreq_table (priv->cpu_dev, &policy->freq_table);dev_pm_opp_of_cpumask_remove_table (policy->related_cpus);if (priv->reg_name) -dev_pm_opp_put_regulator (priv->cpu_dev); +dev_pm_opp_put_regulator (priv->opp_table);clk_put (policy->clk);kfree (priv);
drivers/crypto/caam/caamalg.c +3 -1
@@ -736,7 +736,9 @@ static int aead_set_sh_desc(struct crypto_aead *aead)/* Will read cryptlen */ append_math_add (desc,VARSEQINLEN ,SEQINLEN ,REG0 ,CAAM_CMD_SZ ); -aead_append_src_dst (desc,FIFOLD_TYPE_MSG1OUT2 ); +append_seq_fifo_load (desc,0 ,FIFOLD_CLASS_BOTH |KEY_VLF | +FIFOLD_TYPE_MSG1OUT2 |FIFOLD_TYPE_LASTBOTH ); +append_seq_fifo_store (desc,0 ,FIFOST_TYPE_MESSAGE_DATA |KEY_VLF );/* Write ICV */ append_seq_store(desc, ctx->authsize, LDST_CLASS_2_CCB |
drivers/md/dm-crypt.c +5 -2
@@ -1503,12 +1503,15 @@ static int crypt_set_key(struct crypt_config *cc, char *key)if (!cc->key_size &&strcmp (key,"-" )) goto out; +/* clear the flag since following operations may invalidate previously valid key */ +clear_bit (DM_CRYPT_KEY_VALID , &cc->flags); +if (cc->key_size &&crypt_decode_key (cc->key, key, cc->key_size) <0 ) goto out; -set_bit (DM_CRYPT_KEY_VALID , &cc->flags); - r =crypt_setkey_allcpus (cc); +if (!r) +set_bit (DM_CRYPT_KEY_VALID , &cc->flags); out:/* Hex key string not needed after here, so wipe it. */
drivers/md/dm-flakey.c +2 -0
@@ -200,11 +200,13 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)if (!(fc->up_interval + fc->down_interval)) { ti->error ="Total (up + down) interval is zero" ; + r = -EINVAL ; goto bad; }if (fc->up_interval + fc->down_interval < fc->up_interval) { ti->error ="Interval overflow" ; + r = -EINVAL ; goto bad; }
drivers/md/dm-raid.c +3 -6
@@ -2994,6 +2994,9 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) } } +/* Disable/enable discard support on raid set. */ +configure_discard_support (rs); +mddev_unlock (&rs->md);return 0 ;
@@ -3580,12 +3583,6 @@ static int raid_preresume(struct dm_target *ti)if (test_bit (RT_FLAG_UPDATE_SBS , &rs->runtime_flags))rs_update_sbs (rs); -/* -* Disable/enable discard support on raid set after any -* conversion, because devices can have been added -*/ -configure_discard_support (rs); -/* Load the bitmap from disk unless raid0 */ r =__load_dirty_region_bitmap (rs);if (r)
drivers/md/dm-rq.c +8 -2
@@ -226,6 +226,9 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig)*/ static void rq_completed (struct mapped_device *md,int rw,bool run_queue) { +struct request_queue *q = md->queue; +unsigned long flags; +atomic_dec (&md->pending[rw]);/* nudge anyone waiting on suspend queue */
@@ -238,8 +241,11 @@ static void rq_completed(struct mapped_device *md, int rw, bool run_queue)* back into ->request_fn() could deadlock attempting to grab the * queue lock again. */ -if (!md->queue->mq_ops && run_queue) -blk_run_queue_async (md->queue); +if (!q->mq_ops && run_queue) { +spin_lock_irqsave (q->queue_lock, flags); +blk_run_queue_async (q); +spin_unlock_irqrestore (q->queue_lock, flags); + }/* * dm_put() must be at the end of this function. See the comment above
drivers/md/dm-table.c +18 -6
@@ -924,12 +924,6 @@ static int dm_table_determine_type(struct dm_table *t)BUG_ON (!request_based);/* No targets in this table */ -if (list_empty (devices) &&__table_type_request_based (live_md_type)) { -/* inherit live MD type */ - t->type = live_md_type; -return 0 ; - } -/* * The only way to establish DM_TYPE_MQ_REQUEST_BASED is by * having a compatible target use dm_table_set_type.
@@ -948,6 +942,19 @@ static int dm_table_determine_type(struct dm_table *t)return -EINVAL ; } +if (list_empty (devices)) { +int srcu_idx; +struct dm_table *live_table =dm_get_live_table (t->md, &srcu_idx); + +/* inherit live table's type and all_blk_mq */ +if (live_table) { + t->type = live_table->type; + t->all_blk_mq = live_table->all_blk_mq; + } +dm_put_live_table (t->md, srcu_idx); +return 0 ; + } +/* Non-request-stackable devices can't be used for request-based dm */ list_for_each_entry (dd, devices, list) {struct request_queue *q =bdev_get_queue (dd->dm_dev->bdev);
@@ -974,6 +981,11 @@ static int dm_table_determine_type(struct dm_table *t) t->all_blk_mq = true; } +if (t->type ==DM_TYPE_MQ_REQUEST_BASED && !t->all_blk_mq) { +DMERR ("table load rejected: all devices are not blk-mq request-stackable" ); +return -EINVAL ; + } +return 0 ; }
drivers/md/persistent-data/dm-space-map-metadata.c +6 -8
@@ -775,17 +775,15 @@ int dm_sm_metadata_create(struct dm_space_map *sm,memcpy (&smm->sm, &bootstrap_ops,sizeof (smm->sm)); r =sm_ll_new_metadata (&smm->ll, tm); +if (!r) { +if (nr_blocks >DM_SM_METADATA_MAX_BLOCKS ) + nr_blocks =DM_SM_METADATA_MAX_BLOCKS ; + r =sm_ll_extend (&smm->ll, nr_blocks); + } +memcpy (&smm->sm, &ops,sizeof (smm->sm));if (r)return r; -if (nr_blocks >DM_SM_METADATA_MAX_BLOCKS ) - nr_blocks =DM_SM_METADATA_MAX_BLOCKS ; - r =sm_ll_extend (&smm->ll, nr_blocks); -if (r) -return r; - -memcpy (&smm->sm, &ops,sizeof (smm->sm)); -/* * Now we need to update the newly created data structures with the * allocated blocks that they were built from.
drivers/nvme/target/configfs.c +3 -3
@@ -271,7 +271,7 @@ static ssize_t nvmet_ns_device_path_store(struct config_item *item,mutex_lock (&subsys->lock); ret = -EBUSY ; -if (nvmet_ns_enabled (ns)) +if (ns->enabled) goto out_unlock;kfree (ns->device_path);
@@ -307,7 +307,7 @@ static ssize_t nvmet_ns_device_nguid_store(struct config_item *item,int ret =0 ;mutex_lock (&subsys->lock); -if (nvmet_ns_enabled (ns)) { +if (ns->enabled) { ret = -EBUSY ; goto out_unlock; }
@@ -339,7 +339,7 @@ CONFIGFS_ATTR(nvmet_ns_, device_nguid);static ssize_t nvmet_ns_enable_show (struct config_item *item,char *page) { -return sprintf (page,"%d\n" ,nvmet_ns_enabled (to_nvmet_ns (item))); +return sprintf (page,"%d\n" ,to_nvmet_ns (item)->enabled); } static ssize_t nvmet_ns_enable_store(struct config_item *item,
drivers/nvme/target/core.c +8 -6
@@ -264,7 +264,7 @@ int nvmet_ns_enable(struct nvmet_ns *ns)int ret =0 ;mutex_lock (&subsys->lock); -if (!list_empty (&ns->dev_link)) +if (ns->enabled) goto out_unlock; ns->bdev = blkdev_get_by_path(ns->device_path, FMODE_READ | FMODE_WRITE,
@@ -309,6 +309,7 @@ int nvmet_ns_enable(struct nvmet_ns *ns)list_for_each_entry (ctrl, &subsys->ctrls, subsys_entry)nvmet_add_async_event (ctrl,NVME_AER_TYPE_NOTICE ,0 ,0 ); + ns->enabled = true; ret =0 ; out_unlock:mutex_unlock (&subsys->lock);
@@ -325,11 +326,11 @@ void nvmet_ns_disable(struct nvmet_ns *ns)struct nvmet_ctrl *ctrl;mutex_lock (&subsys->lock); -if (list_empty (&ns->dev_link)) { -mutex_unlock (&subsys->lock); -return ; - } -list_del_init (&ns->dev_link); +if (!ns->enabled) + goto out_unlock; + + ns->enabled = false; +list_del_rcu (&ns->dev_link);mutex_unlock (&subsys->lock);/*
@@ -351,6 +352,7 @@ void nvmet_ns_disable(struct nvmet_ns *ns)if (ns->bdev)blkdev_put (ns->bdev,FMODE_WRITE |FMODE_READ ); +out_unlock:mutex_unlock (&subsys->lock); }
drivers/nvme/target/nvmet.h +1 -5
@@ -47,6 +47,7 @@ struct nvmet_ns {loff_t size;u8 nguid[16 ]; +bool enabled;struct nvmet_subsys *subsys;const char *device_path;
@@ -61,11 +62,6 @@ static inline struct nvmet_ns *to_nvmet_ns(struct config_item *item) return container_of(to_config_group(item), struct nvmet_ns, group); } -static inline bool nvmet_ns_enabled (struct nvmet_ns *ns) -{ -return !list_empty_careful (&ns->dev_link); -} -struct nvmet_cq {u16 qid;u16 size;
drivers/usb/class/cdc-acm.c +1 -0
@@ -1719,6 +1719,7 @@ static const struct usb_device_id acm_ids[] = { { USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */ .driver_info = QUIRK_CONTROL_LINE_STATE, }, { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */ + { USB_DEVICE(0x2184, 0x0036) }, /* GW Instek AFG-125 */ { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ },/* Motorola H24 HSPA module: */
drivers/usb/core/hub.c +36 -65
136 lines not on this page · raw message
drivers/usb/core/ledtrig-usbport.c +3 -4
@@ -74,8 +74,7 @@ static void usbport_trig_update_count(struct usbport_trig_data *usbport_data) usbport_data->count =0 ;usb_for_each_dev (usbport_data, usbport_trig_usb_dev_check); - led_cdev->brightness_set (led_cdev, - usbport_data->count ?LED_FULL :LED_OFF ); +led_set_brightness (led_cdev, usbport_data->count ?LED_FULL :LED_OFF ); }/***************************************
@@ -228,12 +227,12 @@ static int usbport_trig_notify(struct notifier_block *nb, unsigned long action,case USB_DEVICE_ADD :usbport_trig_add_usb_dev_ports (usb_dev, usbport_data);if (observed && usbport_data->count++ ==0 ) - led_cdev->brightness_set (led_cdev,LED_FULL ); +led_set_brightness (led_cdev,LED_FULL );return NOTIFY_OK ;case USB_DEVICE_REMOVE :usbport_trig_remove_usb_dev_ports (usbport_data, usb_dev);if (observed && --usbport_data->count ==0 ) - led_cdev->brightness_set (led_cdev,LED_OFF ); +led_set_brightness (led_cdev,LED_OFF );return NOTIFY_OK ; }
drivers/usb/dwc3/gadget.c +11 -2
@@ -771,6 +771,9 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep, unsigned length, unsigned chain, unsigned node) { struct dwc3_trb *trb; +struct dwc3 *dwc = dep->dwc; +struct usb_gadget *gadget = &dwc->gadget; +enum usb_device_speed speed = gadget->speed; dwc3_trace(trace_dwc3_gadget, "%s: req %p dma %08llx length %d%s", dep->name, req, (unsigned long long) dma,
@@ -798,10 +801,16 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,break ;case USB_ENDPOINT_XFER_ISOC : -if (!node) +if (!node) { trb->ctrl =DWC3_TRBCTL_ISOCHRONOUS_FIRST ; -else + +if (speed ==USB_SPEED_HIGH ) { +struct usb_ep *ep = &dep->endpoint; + trb->size |=DWC3_TRB_SIZE_PCM1 (ep->mult -1 ); + } + }else { trb->ctrl =DWC3_TRBCTL_ISOCHRONOUS ; + }/* always enable Interrupt on Missed ISOC */ trb->ctrl |=DWC3_TRB_CTRL_ISP_IMI ;
drivers/usb/gadget/composite.c +8 -3
@@ -197,11 +197,16 @@ int config_ep_by_speed(struct usb_gadget *g, ep_found:/* commit results */ - _ep->maxpacket =usb_endpoint_maxp (chosen_desc); + _ep->maxpacket =usb_endpoint_maxp (chosen_desc) &0x7ff ; _ep->desc = chosen_desc; _ep->comp_desc =NULL ; _ep->maxburst =0 ; - _ep->mult =0 ; + _ep->mult =1 ; + +if (g->speed ==USB_SPEED_HIGH && (usb_endpoint_xfer_isoc (_ep->desc) || +usb_endpoint_xfer_int (_ep->desc))) + _ep->mult =usb_endpoint_maxp (_ep->desc) &0x7ff ; +if (!want_comp_desc)return 0 ;
@@ -218,7 +223,7 @@ int config_ep_by_speed(struct usb_gadget *g,switch (usb_endpoint_type (_ep->desc)) {case USB_ENDPOINT_XFER_ISOC :/* mult: bits 1:0 of bmAttributes */ - _ep->mult = comp_desc->bmAttributes &0x3 ; + _ep->mult = (comp_desc->bmAttributes &0x3 ) +1 ;case USB_ENDPOINT_XFER_BULK :case USB_ENDPOINT_XFER_INT : _ep->maxburst = comp_desc->bMaxBurst +1 ;
drivers/usb/gadget/function/f_uac2.c +7 -7
@@ -1067,13 +1067,13 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) agdev->out_ep =usb_ep_autoconfig (gadget, &fs_epout_desc);if (!agdev->out_ep) {dev_err (dev,"%s:%d Error!\n" , __func__, __LINE__); - goto err; +return ret; } agdev->in_ep =usb_ep_autoconfig (gadget, &fs_epin_desc);if (!agdev->in_ep) {dev_err (dev,"%s:%d Error!\n" , __func__, __LINE__); - goto err; +return ret; } uac2->p_prm.uac2 = uac2;
@@ -1091,7 +1091,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) ret =usb_assign_descriptors (fn, fs_audio_desc, hs_audio_desc,NULL ,NULL );if (ret) - goto err; +return ret; prm = &agdev->uac2.c_prm; prm->max_psize = hs_epout_desc.wMaxPacketSize;
@@ -1106,19 +1106,19 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) prm->rbuf =kzalloc (prm->max_psize *USB_XFERS ,GFP_KERNEL );if (!prm->rbuf) { prm->max_psize =0 ; - goto err_free_descs; + goto err; } ret =alsa_uac2_init (agdev);if (ret) - goto err_free_descs; + goto err;return 0 ; -err_free_descs: -usb_free_all_descriptors (fn); err:kfree (agdev->uac2.p_prm.rbuf);kfree (agdev->uac2.c_prm.rbuf); +err_free_descs: +usb_free_all_descriptors (fn);return -EINVAL ; }
drivers/usb/gadget/function/uvc_video.c +1 -1
@@ -243,7 +243,7 @@ uvc_video_alloc_requests(struct uvc_video *video) req_size = video->ep->maxpacket * max_t(unsigned int, video->ep->maxburst, 1) - * (video->ep->mult +1 ); + * (video->ep->mult);for (i =0 ; i <UVC_NUM_REQUESTS ; ++i) { video->req_buffer[i] =kmalloc (req_size,GFP_KERNEL );
drivers/usb/host/uhci-pci.c +4 -0
@@ -129,6 +129,10 @@ static int uhci_pci_init(struct usb_hcd *hcd)if (to_pci_dev (uhci_dev (uhci))->vendor ==PCI_VENDOR_ID_HP ) uhci->wait_for_hp =1 ; +/* Intel controllers use non-PME wakeup signalling */ +if (to_pci_dev (uhci_dev (uhci))->vendor ==PCI_VENDOR_ID_INTEL ) +device_set_run_wake (uhci_dev (uhci),1 ); +/* Set up pointers to PCI-specific functions */ uhci->reset_hc = uhci_pci_reset_hc; uhci->check_and_reset_hc = uhci_pci_check_and_reset_hc;
drivers/usb/serial/kl5kusb105.c +24 -9
@@ -296,7 +296,7 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port) rc =usb_serial_generic_open (tty, port);if (rc) { retval = rc; - goto exit; + goto err_free_cfg; } rc = usb_control_msg(port->serial->dev,
@@ -315,17 +315,32 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)dev_dbg (&port->dev,"%s - enabled reading\n" , __func__); rc =klsi_105_get_line_state (port, &line_state); -if (rc >=0 ) { -spin_lock_irqsave (&priv->lock, flags); - priv->line_state = line_state; -spin_unlock_irqrestore (&priv->lock, flags); -dev_dbg (&port->dev,"%s - read line state 0x%lx\n" , __func__, line_state); - retval =0 ; - }else +if (rc <0 ) { retval = rc; + goto err_disable_read; + } + +spin_lock_irqsave (&priv->lock, flags); + priv->line_state = line_state; +spin_unlock_irqrestore (&priv->lock, flags); +dev_dbg (&port->dev,"%s - read line state 0x%lx\n" , __func__, + line_state); + +return 0 ; -exit: +err_disable_read: +usb_control_msg (port->serial->dev, +usb_sndctrlpipe (port->serial->dev,0 ), +KL5KUSB105A_SIO_CONFIGURE , +USB_TYPE_VENDOR |USB_DIR_OUT , +KL5KUSB105A_SIO_CONFIGURE_READ_OFF , +0 ,/* index */ +NULL ,0 , +KLSI_TIMEOUT ); +usb_serial_generic_close (port); +err_free_cfg:kfree (cfg); +return retval; }
drivers/usb/serial/option.c +7 -0
@@ -268,6 +268,8 @@ static void option_instat_callback(struct urb *urb);#define TELIT_PRODUCT_CC864_SINGLE 0x1006#define TELIT_PRODUCT_DE910_DUAL 0x1010#define TELIT_PRODUCT_UE910_V2 0x1012 +#define TELIT_PRODUCT_LE922_USBCFG1 0x1040 +#define TELIT_PRODUCT_LE922_USBCFG2 0x1041#define TELIT_PRODUCT_LE922_USBCFG0 0x1042#define TELIT_PRODUCT_LE922_USBCFG3 0x1043#define TELIT_PRODUCT_LE922_USBCFG5 0x1045
@@ -1210,6 +1212,10 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0), .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG1), + .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG2), + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3), .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff),
@@ -1989,6 +1995,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
drivers/usb/usbip/vudc_transfer.c +2 -0
@@ -339,6 +339,8 @@ static void v_timer(unsigned long _vudc) total = timer->frame_limit; } +/* We have to clear ep0 flags separately as it's not on the list */ + udc->ep[0 ].already_seen =0 ;list_for_each_entry (_ep, &udc->gadget.ep_list, ep_list) { ep =to_vep (_ep); ep->already_seen =0 ;
drivers/watchdog/mei_wdt.c +2 -0
@@ -389,6 +389,8 @@ static int mei_wdt_register(struct mei_wdt *wdt) wdt->wdd.max_timeout =MEI_WDT_MAX_TIMEOUT ;watchdog_set_drvdata (&wdt->wdd, wdt); +watchdog_stop_on_reboot (&wdt->wdd); + ret =watchdog_register_device (&wdt->wdd);if (ret) {dev_err (dev,"unable to register watchdog device = %d.\n" , ret);
drivers/watchdog/qcom-wdt.c +1 -1
@@ -209,7 +209,7 @@ static int qcom_wdt_probe(struct platform_device *pdev) wdt->wdd.parent = &pdev->dev; wdt->layout = regs; -if (readl (wdt->base +WDT_STS ) &1 ) +if (readl (wdt_addr (wdt,WDT_STS )) &1 ) wdt->wdd.bootstatus =WDIOF_CARDRESET ;/*
drivers/xen/gntdev.c +1 -1
@@ -1007,7 +1007,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) vma->vm_ops = &gntdev_vmops; - vma->vm_flags |=VM_DONTEXPAND |VM_DONTDUMP |VM_IO ; + vma->vm_flags |=VM_DONTEXPAND |VM_DONTDUMP |VM_MIXEDMAP ;if (use_ptemod) vma->vm_flags |=VM_DONTCOPY ;
fs/block_dev.c +1 -1
@@ -832,7 +832,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole,return true;/* already a holder */ else if (bdev->bd_holder != NULL) return false; /* held by someone else */ - else if (bdev->bd_contains == bdev) + else if (whole == bdev) return true; /* is a whole device which isn't held */ else if (whole->bd_holder == bd_may_claim)
fs/btrfs/async-thread.c +14 -0
@@ -86,6 +86,20 @@ btrfs_work_owner(struct btrfs_work *work)return work->wq->fs_info; } +bool btrfs_workqueue_normal_congested (struct btrfs_workqueue *wq) +{ +/* +* We could compare wq->normal->pending with num_online_cpus() +* to support "thresh == NO_THRESHOLD" case, but it requires +* moving up atomic_inc/dec in thresh_queue/exec_hook. Let's +* postpone it until someone needs the support of that case. +*/ +if (wq->normal->thresh ==NO_THRESHOLD ) +return false; + +return atomic_read (&wq->normal->pending) > wq->normal->thresh *2 ; +} +BTRFS_WORK_HELPER (worker_helper);BTRFS_WORK_HELPER (delalloc_helper);BTRFS_WORK_HELPER (flush_delalloc_helper);
fs/btrfs/async-thread.h +1 -0
@@ -84,4 +84,5 @@ void btrfs_workqueue_set_max(struct btrfs_workqueue *wq, int max);void btrfs_set_work_high_priority (struct btrfs_work *work);struct btrfs_fs_info *btrfs_work_owner (struct btrfs_work *work);struct btrfs_fs_info *btrfs_workqueue_owner (struct __btrfs_workqueue *wq); +bool btrfs_workqueue_normal_congested (struct btrfs_workqueue *wq);#endif
fs/btrfs/ctree.h +4 -0
@@ -2210,6 +2210,8 @@ btrfs_disk_balance_args_to_cpu(struct btrfs_balance_args *cpu, cpu->target =le64_to_cpu (disk->target); cpu->flags =le64_to_cpu (disk->flags); cpu->limit =le64_to_cpu (disk->limit); + cpu->stripes_min =le32_to_cpu (disk->stripes_min); + cpu->stripes_max =le32_to_cpu (disk->stripes_max); } static inline void
@@ -2228,6 +2230,8 @@ btrfs_cpu_balance_args_to_disk(struct btrfs_disk_balance_args *disk, disk->target =cpu_to_le64 (cpu->target); disk->flags =cpu_to_le64 (cpu->flags); disk->limit =cpu_to_le64 (cpu->limit); + disk->stripes_min =cpu_to_le32 (cpu->stripes_min); + disk->stripes_max =cpu_to_le32 (cpu->stripes_max); }/* struct btrfs_super_block */
fs/btrfs/delayed-inode.c +4 -2
@@ -1353,7 +1353,8 @@ static void btrfs_async_run_delayed_root(struct btrfs_work *work) total_done++;btrfs_release_prepared_delayed_node (delayed_node); -if (async_work->nr ==0 || total_done < async_work->nr) +if ((async_work->nr ==0 && total_done <BTRFS_DELAYED_WRITEBACK ) || + total_done < async_work->nr) goto again; free_path:
@@ -1369,7 +1370,8 @@ static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root, {struct btrfs_async_delayed_work *async_work; -if (atomic_read (&delayed_root->items) <BTRFS_DELAYED_BACKGROUND ) +if (atomic_read (&delayed_root->items) <BTRFS_DELAYED_BACKGROUND || +btrfs_workqueue_normal_congested (fs_info->delayed_workers))return 0 ; async_work =kmalloc (sizeof (*async_work),GFP_NOFS );
fs/btrfs/disk-io.c +19 -4
@@ -559,7 +559,15 @@ static noinline int check_leaf(struct btrfs_root *root,u32 nritems =btrfs_header_nritems (leaf);int slot; -if (nritems ==0 ) { +/* +* Extent buffers from a relocation tree have a owner field that +* corresponds to the subvolume tree they are based on. So just from an +* extent buffer alone we can not find out what is the id of the +* corresponding subvolume tree, so we can not figure out if the extent +* buffer corresponds to the root of the relocation tree or not. So skip +* this check for relocation trees. +*/ +if (nritems ==0 && !btrfs_header_flag (leaf,BTRFS_HEADER_FLAG_RELOC )) {struct btrfs_root *check_root; key.objectid =btrfs_header_owner (leaf);
@@ -572,17 +580,24 @@ static noinline int check_leaf(struct btrfs_root *root,* open_ctree() some roots has not yet been set up. */ if (!IS_ERR_OR_NULL (check_root)) { +struct extent_buffer *eb; + + eb =btrfs_root_node (check_root);/* if leaf is the root, then it's fine */ -if (leaf->start != -btrfs_root_bytenr (&check_root->root_item)) { +if (leaf != eb) {CORRUPT ("non-root leaf's nritems is 0" , - leaf, root,0 ); + leaf, check_root,0 ); +free_extent_buffer (eb);return -EIO ; } +free_extent_buffer (eb); }return 0 ; } +if (nritems ==0 ) +return 0 ; +/* Check the 0 item */ if (btrfs_item_offset_nr (leaf,0 ) +btrfs_item_size_nr (leaf,0 ) !=BTRFS_LEAF_DATA_SIZE (root)) {
fs/btrfs/qgroup.c +1 -4
@@ -2335,10 +2335,6 @@ static void btrfs_qgroup_rescan_worker(struct btrfs_work *work)int err = -ENOMEM ;int ret =0 ; -mutex_lock (&fs_info->qgroup_rescan_lock); - fs_info->qgroup_rescan_running = true; -mutex_unlock (&fs_info->qgroup_rescan_lock); - path =btrfs_alloc_path ();if (!path) goto out;
@@ -2449,6 +2445,7 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, sizeof(fs_info->qgroup_rescan_progress)); fs_info->qgroup_rescan_progress.objectid = progress_objectid;init_completion (&fs_info->qgroup_rescan_completion); + fs_info->qgroup_rescan_running = true;spin_unlock (&fs_info->qgroup_lock);mutex_unlock (&fs_info->qgroup_rescan_lock);
fs/btrfs/relocation.c +12 -3
@@ -1395,14 +1395,23 @@ static struct btrfs_root *create_reloc_root(struct btrfs_trans_handle *trans, root_key.offset = objectid;if (root->root_key.objectid == objectid) { +u64 commit_root_gen; +/* called by btrfs_init_reloc_root */ ret =btrfs_copy_root (trans, root, root->commit_root, &eb,BTRFS_TREE_RELOC_OBJECTID );BUG_ON (ret); - last_snap =btrfs_root_last_snapshot (&root->root_item); -btrfs_set_root_last_snapshot (&root->root_item, - trans->transid -1 ); +/* +* Set the last_snapshot field to the generation of the commit +* root - like this ctree.c:btrfs_block_can_be_shared() behaves +* correctly (returns true) when the relocation root is created +* either inside the critical section of a transaction commit +* (through transaction.c:qgroup_account_snapshot()) and when +* it's created before the transaction commit is started. +*/ + commit_root_gen =btrfs_header_generation (root->commit_root); +btrfs_set_root_last_snapshot (&root->root_item, commit_root_gen); }else {/* * called by btrfs_reloc_post_snapshot_hook.
fs/btrfs/tree-log.c +3 -4
@@ -1940,12 +1940,11 @@ static noinline int find_dir_range(struct btrfs_root *root, next:/* check the next slot in the tree to see if it is a valid item */ nritems =btrfs_header_nritems (path->nodes[0 ]); + path->slots[0 ]++;if (path->slots[0 ] >= nritems) { ret =btrfs_next_leaf (root, path);if (ret) goto out; - }else { - path->slots[0 ]++; }btrfs_item_key_to_cpu (path->nodes[0 ], &key, path->slots[0 ]);
@@ -5205,6 +5204,7 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans,if (di_key.type ==BTRFS_ROOT_ITEM_KEY )continue ; +btrfs_release_path (path); di_inode =btrfs_iget (root->fs_info->sb, &di_key, root,NULL );if (IS_ERR (di_inode)) {
@@ -5214,13 +5214,12 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans,if (btrfs_inode_in_log (di_inode, trans->transid)) {iput (di_inode); -continue ; +break ; } ctx->log_new_dentries = false;if (type ==BTRFS_FT_DIR || type ==BTRFS_FT_SYMLINK ) log_mode =LOG_INODE_ALL ; -btrfs_release_path (path); ret =btrfs_log_inode (trans, root, di_inode, log_mode,0 ,LLONG_MAX , ctx); if (!ret &&
fs/cifs/cifsglob.h +4 -0
@@ -646,6 +646,8 @@ struct TCP_Server_Info {unsigned int max_read;unsigned int max_write;__u8 preauth_hash[512 ]; +struct delayed_work reconnect;/* reconnect workqueue job */ +struct mutex reconnect_mutex;/* prevent simultaneous reconnects */ #endif /* CONFIG_CIFS_SMB2 */ unsigned long echo_interval; };
@@ -849,6 +851,7 @@ cap_unix(struct cifs_ses *ses)struct cifs_tcon {struct list_head tcon_list;int tc_count; +struct list_head rlist;/* reconnect list */ struct list_head openFileList;spinlock_t open_file_lock;/* protects list above */ struct cifs_ses *ses;/* pointer to session associated with */
@@ -922,6 +925,7 @@ struct cifs_tcon {bool broken_posix_open;/* e.g. Samba server versions < 3.3.2, 3.2.9 */ bool broken_sparse_sup;/* if server or share does not support sparse */ bool need_reconnect:1; /* connection reset, tid now invalid */ + bool need_reopen_files:1; /* need to reopen tcon file handles */ bool use_resilient:1; /* use resilient instead of durable handles */ bool use_persistent:1; /* use persistent instead of durable handles */#ifdef CONFIG_CIFS_SMB2
fs/cifs/cifsproto.h +3 -0
@@ -206,6 +206,9 @@ extern void cifs_add_pending_open_locked(struct cifs_fid *fid,struct tcon_link *tlink, struct cifs_pending_open *open);extern void cifs_del_pending_open (struct cifs_pending_open *open); +extern void cifs_put_tcp_session (struct TCP_Server_Info *server, +int from_reconnect); +extern void cifs_put_tcon (struct cifs_tcon *tcon);#if IS_ENABLED (CONFIG_CIFS_DFS_UPCALL )extern void cifs_dfs_release_automount_timer (void );
fs/cifs/connect.c +27 -7
@@ -52,6 +52,9 @@#include "nterr.h" #include "rfc1002pdu.h" #include "fscache.h" +#ifdef CONFIG_CIFS_SMB2 +#include "smb2proto.h" +#endif #define CIFS_PORT 445#define RFC1001_PORT 139
@@ -2100,8 +2103,8 @@ cifs_find_tcp_session(struct smb_vol *vol)return NULL ; } -static void -cifs_put_tcp_session (struct TCP_Server_Info *server) +void +cifs_put_tcp_session (struct TCP_Server_Info *server,int from_reconnect) {struct task_struct *task;
@@ -2118,6 +2121,19 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)cancel_delayed_work_sync (&server->echo); +#ifdef CONFIG_CIFS_SMB2 +if (from_reconnect) +/* +* Avoid deadlock here: reconnect work calls +* cifs_put_tcp_session() at its end. Need to be sure +* that reconnect work does nothing with server pointer after +* that step. +*/ +cancel_delayed_work (&server->reconnect); +else +cancel_delayed_work_sync (&server->reconnect); +#endif +spin_lock (&GlobalMid_Lock); server->tcpStatus = CifsExiting;spin_unlock (&GlobalMid_Lock);
@@ -2182,6 +2198,10 @@ cifs_get_tcp_session(struct smb_vol *volume_info)INIT_LIST_HEAD (&tcp_ses->tcp_ses_list);INIT_LIST_HEAD (&tcp_ses->smb_ses_list);INIT_DELAYED_WORK (&tcp_ses->echo, cifs_echo_request); +#ifdef CONFIG_CIFS_SMB2 +INIT_DELAYED_WORK (&tcp_ses->reconnect, smb2_reconnect_server); +mutex_init (&tcp_ses->reconnect_mutex); +#endif memcpy (&tcp_ses->srcaddr, &volume_info->srcaddr,sizeof (tcp_ses->srcaddr)); memcpy(&tcp_ses->dstaddr, &volume_info->dstaddr,
@@ -2340,7 +2360,7 @@ cifs_put_smb_ses(struct cifs_ses *ses)spin_unlock (&cifs_tcp_ses_lock);sesInfoFree (ses); -cifs_put_tcp_session (server); +cifs_put_tcp_session (server,0 ); }#ifdef CONFIG_KEYS
@@ -2514,7 +2534,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)mutex_unlock (&ses->session_mutex);/* existing SMB ses has a server reference already */ -cifs_put_tcp_session (server); +cifs_put_tcp_session (server,0 );free_xid (xid);return ses; }
@@ -2604,7 +2624,7 @@ cifs_find_tcon(struct cifs_ses *ses, const char *unc)return NULL ; } -static void +void cifs_put_tcon (struct cifs_tcon *tcon) {unsigned int xid;
@@ -3792,7 +3812,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)else if (ses)cifs_put_smb_ses (ses);else -cifs_put_tcp_session (server); +cifs_put_tcp_session (server,0 );bdi_destroy (&cifs_sb->bdi); }
@@ -4103,7 +4123,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) ses =cifs_get_smb_ses (master_tcon->ses->server, vol_info);if (IS_ERR (ses)) { tcon = (struct cifs_tcon *)ses; -cifs_put_tcp_session (master_tcon->ses->server); +cifs_put_tcp_session (master_tcon->ses->server,0 ); goto out; }
fs/cifs/file.c +7 -1
@@ -777,6 +777,11 @@ cifs_reopen_persistent_handles(struct cifs_tcon *tcon)struct list_head *tmp1;struct list_head tmp_list; +if (!tcon->use_persistent || !tcon->need_reopen_files) +return ; + + tcon->need_reopen_files = false; +cifs_dbg (FYI ,"Reopen persistent handles" );INIT_LIST_HEAD (&tmp_list);
@@ -793,7 +798,8 @@ cifs_reopen_persistent_handles(struct cifs_tcon *tcon)list_for_each_safe (tmp, tmp1, &tmp_list) { open_file = list_entry(tmp, struct cifsFileInfo, rlist); -cifs_reopen_file (open_file, false/* do not flush */ ); +if (cifs_reopen_file (open_file, false/* do not flush */ )) + tcon->need_reopen_files = true;list_del_init (&open_file->rlist);cifsFileInfo_put (open_file); }
fs/cifs/ioctl.c +1 -1
@@ -189,7 +189,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) xid =get_xid (); cifs_sb =CIFS_SB (inode->i_sb); -cifs_dbg (VFS ,"cifs ioctl 0x%x\n" , command); +cifs_dbg (FYI ,"cifs ioctl 0x%x\n" , command);switch (command) {case FS_IOC_GETFLAGS :if (pSMBFile ==NULL )
fs/cifs/smb2file.c +1 -1
@@ -260,7 +260,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile)* and check it for zero before using. */ max_buf =tlink_tcon (cfile->tlink)->ses->server->maxBuf; -if (!max_buf) { +if (max_buf <sizeof (struct smb2_lock_element )) {free_xid (xid);return -EINVAL ; }
fs/cifs/smb2pdu.c +59 -28
120 lines not on this page · raw message
fs/cifs/smb2pdu.h +2 -0
@@ -80,6 +80,8 @@#define SMB2_SET_INFO cpu_to_le16(SMB2_SET_INFO_HE)#define SMB2_OPLOCK_BREAK cpu_to_le16(SMB2_OPLOCK_BREAK_HE) +#define SMB2_INTERNAL_CMD cpu_to_le16(0xFFFF) +#define NUMBER_OF_SMB2_COMMANDS 0x0013/* BB FIXME - analyze following length BB */
fs/cifs/smb2proto.h +1 -0
@@ -96,6 +96,7 @@ extern int smb2_open_file(const unsigned int xid,extern int smb2_unlock_range (struct cifsFileInfo *cfile,struct file_lock *flock,const unsigned int xid);extern int smb2_push_mandatory_locks (struct cifsFileInfo *cfile); +extern void smb2_reconnect_server (struct work_struct *work);/* * SMB2 Worker functions - most of protocol specific implementation details
fs/cifs/smbencrypt.c +8 -32
@@ -23,7 +23,7 @@Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <crypto/skcipher.h> +#include <linux/crypto.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/fs.h>
@@ -69,46 +69,22 @@ str_to_key(unsigned char *str, unsigned char *key)static int smbhash (unsigned char *out,const unsigned char *in,unsigned char *key) { -int rc;unsigned char key2[8 ]; -struct crypto_skcipher *tfm_des; -struct scatterlist sgin, sgout; -struct skcipher_request *req; +struct crypto_cipher *tfm_des;str_to_key (key, key2); - tfm_des =crypto_alloc_skcipher ("ecb(des)" ,0 ,CRYPTO_ALG_ASYNC ); + tfm_des =crypto_alloc_cipher ("des" ,0 ,0 );if (IS_ERR (tfm_des)) { - rc =PTR_ERR (tfm_des); -cifs_dbg (VFS ,"could not allocate des crypto API\n" ); - goto smbhash_err; - } - - req =skcipher_request_alloc (tfm_des,GFP_KERNEL ); -if (!req) { - rc = -ENOMEM ;cifs_dbg (VFS ,"could not allocate des crypto API\n" ); - goto smbhash_free_skcipher; +return PTR_ERR (tfm_des); } -crypto_skcipher_setkey (tfm_des, key2,8 ); - -sg_init_one (&sgin, in,8 ); -sg_init_one (&sgout, out,8 ); +crypto_cipher_setkey (tfm_des, key2,8 ); +crypto_cipher_encrypt_one (tfm_des, out, in); +crypto_free_cipher (tfm_des); -skcipher_request_set_callback (req,0 ,NULL ,NULL ); -skcipher_request_set_crypt (req, &sgin, &sgout,8 ,NULL ); - - rc =crypto_skcipher_encrypt (req); -if (rc) -cifs_dbg (VFS ,"could not encrypt crypt key rc: %d\n" , rc); - -skcipher_request_free (req); - -smbhash_free_skcipher: -crypto_free_skcipher (tfm_des); -smbhash_err: -return rc; +return 0 ; } static int
fs/exec.c +26 -5
@@ -19,7 +19,7 @@* current->executable is only used by the procfs. This allows a dispatch * table to check for several different types of binary formats. We keep * trying until we recognize the file or we run out of supported binary -* formats. +* formats. */ #include <linux/slab.h>
@@ -1266,6 +1266,13 @@ int flush_old_exec(struct linux_binprm * bprm)flush_thread (); current->personality &= ~bprm->per_clear; +/* +* We have to apply CLOEXEC before we change whether the process is +* dumpable (in setup_new_exec) to avoid a race with a process in userspace +* trying to access the should-be-closed file descriptors of a process +* undergoing exec(2). +*/ +do_close_on_exec (current->files);return 0 ; out:
@@ -1275,8 +1282,22 @@ EXPORT_SYMBOL(flush_old_exec);void would_dump (struct linux_binprm *bprm,struct file *file) { -if (inode_permission (file_inode (file),MAY_READ ) <0 ) +struct inode *inode =file_inode (file); +if (inode_permission (inode,MAY_READ ) <0 ) { +struct user_namespace *old, *user_ns; bprm->interp_flags |=BINPRM_FLAGS_ENFORCE_NONDUMP ; + +/* Ensure mm->user_ns contains the executable */ + user_ns = old = bprm->mm->user_ns; +while ((user_ns != &init_user_ns) && + !privileged_wrt_inode_uidgid (user_ns, inode)) + user_ns = user_ns->parent; + +if (old != user_ns) { + bprm->mm->user_ns =get_user_ns (user_ns); +put_user_ns (old); + } + } }EXPORT_SYMBOL (would_dump);
@@ -1306,7 +1327,6 @@ void setup_new_exec(struct linux_binprm * bprm) !gid_eq(bprm->cred->gid, current_egid())) { current->pdeath_signal = 0; } else { -would_dump (bprm, bprm->file);if (bprm->interp_flags &BINPRM_FLAGS_ENFORCE_NONDUMP )set_dumpable (current->mm, suid_dumpable); }
@@ -1315,7 +1335,6 @@ void setup_new_exec(struct linux_binprm * bprm)group */ current->self_exec_id++;flush_signal_handlers (current,0 ); -do_close_on_exec (current->files); }EXPORT_SYMBOL (setup_new_exec);
@@ -1406,7 +1425,7 @@ static void check_unsafe_exec(struct linux_binprm *bprm)unsigned n_fs;if (p->ptrace) { -if (p->ptrace &PT_PTRACE_CAP ) +if (ptracer_capable (p,current_user_ns ())) bprm->unsafe |=LSM_UNSAFE_PTRACE_CAP ;else bprm->unsafe |=LSM_UNSAFE_PTRACE ;
@@ -1741,6 +1760,8 @@ static int do_execveat_common(int fd, struct filename *filename,if (retval <0 ) goto out; +would_dump (bprm, bprm->file); + retval =exec_binprm (bprm);if (retval <0 ) goto out;
fs/ext4/ext4_jbd2.h +8 -6
@@ -414,17 +414,19 @@ static inline int ext4_inode_journal_mode(struct inode *inode)return EXT4_INODE_WRITEBACK_DATA_MODE ;/* writeback */ /* We do not support data journalling with delayed allocation */ if (!S_ISREG (inode->i_mode) || -test_opt (inode->i_sb,DATA_FLAGS ) ==EXT4_MOUNT_JOURNAL_DATA ) -return EXT4_INODE_JOURNAL_DATA_MODE ;/* journal data */ -if (ext4_test_inode_flag (inode,EXT4_INODE_JOURNAL_DATA ) && - !test_opt (inode->i_sb,DELALLOC )) +test_opt (inode->i_sb,DATA_FLAGS ) ==EXT4_MOUNT_JOURNAL_DATA || + (ext4_test_inode_flag (inode,EXT4_INODE_JOURNAL_DATA ) && + !test_opt (inode->i_sb,DELALLOC ))) { +/* We do not support data journalling for encrypted data */ +if (S_ISREG (inode->i_mode) &&ext4_encrypted_inode (inode)) +return EXT4_INODE_ORDERED_DATA_MODE ;/* ordered */ return EXT4_INODE_JOURNAL_DATA_MODE ;/* journal data */ + }if (test_opt (inode->i_sb,DATA_FLAGS ) ==EXT4_MOUNT_ORDERED_DATA )return EXT4_INODE_ORDERED_DATA_MODE ;/* ordered */ if (test_opt (inode->i_sb,DATA_FLAGS ) ==EXT4_MOUNT_WRITEBACK_DATA )return EXT4_INODE_WRITEBACK_DATA_MODE ;/* writeback */ -else -BUG (); +BUG (); }static inline int ext4_should_journal_data (struct inode *inode)
fs/ext4/inline.c +3 -1
@@ -336,8 +336,10 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode, len -=EXT4_MIN_INLINE_DATA_SIZE ; value =kzalloc (len,GFP_NOFS ); -if (!value) +if (!value) { + error = -ENOMEM ; goto out; + } error =ext4_xattr_ibody_get (inode, i.name_index, i.name, value, len);
fs/ext4/inode.c +6 -0
@@ -4434,6 +4434,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)struct inode *inode;journal_t *journal =EXT4_SB (sb)->s_journal;long ret; +loff_t size;int block;uid_t i_uid;gid_t i_gid;
@@ -4534,6 +4535,11 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) ei->i_file_acl |= ((__u64 )le16_to_cpu (raw_inode->i_file_acl_high)) <<32 ; inode->i_size =ext4_isize (raw_inode); +if ((size =i_size_read (inode)) <0 ) { +EXT4_ERROR_INODE (inode,"bad i_size value: %lld" , size); + ret = -EFSCORRUPTED ; + goto bad_inode; + } ei->i_disksize = inode->i_size;#ifdef CONFIG_QUOTA ei->i_reserved_quota =0 ;
fs/ext4/mballoc.c +2 -2
@@ -669,7 +669,7 @@ static void ext4_mb_mark_free_simple(struct super_block *sb,ext4_grpblk_t min;ext4_grpblk_t max;ext4_grpblk_t chunk; -unsigned short border; +unsigned int border;BUG_ON (len >EXT4_CLUSTERS_PER_GROUP (sb));
@@ -2287,7 +2287,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)struct ext4_group_info *grinfo;struct sg {struct ext4_group_info info; -ext4_grpblk_t counters[16 ]; +ext4_grpblk_t counters[EXT4_MAX_BLOCK_LOG_SIZE +2 ]; } sg; group--;
fs/ext4/super.c +45 -29
150 lines not on this page · raw message
fs/f2fs/checkpoint.c +7 -1
@@ -772,6 +772,11 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi)if (sanity_check_ckpt (sbi)) goto fail_no_cp; +if (cur_page == cp1) + sbi->cur_cp_pack =1 ; +else + sbi->cur_cp_pack =2 ; +if (cp_blks <=1 ) goto done;
@@ -1123,7 +1128,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc) le32_to_cpu(ckpt->checksum_offset))) =cpu_to_le32 (crc32); - start_blk =__start_cp_addr (sbi); + start_blk =__start_cp_next_addr (sbi);/* need to wait for end_io results */ wait_on_all_pages_writeback (sbi);
@@ -1187,6 +1192,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)clear_prefree_segments (sbi, cpc);clear_sbi_flag (sbi,SBI_IS_DIRTY );clear_sbi_flag (sbi,SBI_NEED_CP ); +__set_cp_next_pack (sbi);/* * redirty superblock if metadata like node page or inode cache is
fs/f2fs/debug.c +1 -0
@@ -373,6 +373,7 @@ static int stat_open(struct inode *inode, struct file *file) }static const struct file_operations stat_fops = { + .owner =THIS_MODULE , .open = stat_open, .read = seq_read, .llseek = seq_lseek,
fs/f2fs/f2fs.h +21 -15
@@ -428,7 +428,7 @@ struct f2fs_inode_info {/* Use below internally in f2fs*/ unsigned long flags;/* use to pass per-file flags */ struct rw_semaphore i_sem;/* protect fi info */ -struct percpu_counter dirty_pages;/* # of dirty pages */ +atomic_t dirty_pages;/* # of dirty pages */ f2fs_hash_t chash;/* hash value of given file name */ unsigned int clevel;/* maximum level of given file name */ nid_t i_xattr_nid;/* node id that contains xattrs */
@@ -764,6 +764,7 @@ struct f2fs_sb_info {/* for checkpoint */ struct f2fs_checkpoint *ckpt;/* raw checkpoint pointer */ +int cur_cp_pack;/* remain current cp pack */ spinlock_t cp_lock;/* for flag in ckpt */ struct inode *meta_inode;/* cache meta blocks */ struct mutex cp_mutex;/* checkpoint procedure lock */
@@ -1242,7 +1243,7 @@ static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type)static inline void inode_inc_dirty_pages (struct inode *inode) { -percpu_counter_inc (&F2FS_I (inode)->dirty_pages); +atomic_inc (&F2FS_I (inode)->dirty_pages);inc_page_count (F2FS_I_SB (inode),S_ISDIR (inode->i_mode) ?F2FS_DIRTY_DENTS :F2FS_DIRTY_DATA ); }
@@ -1258,7 +1259,7 @@ static inline void inode_dec_dirty_pages(struct inode *inode) !S_ISLNK(inode->i_mode))return ; -percpu_counter_dec (&F2FS_I (inode)->dirty_pages); +atomic_dec (&F2FS_I (inode)->dirty_pages);dec_page_count (F2FS_I_SB (inode),S_ISDIR (inode->i_mode) ?F2FS_DIRTY_DENTS :F2FS_DIRTY_DATA ); }
@@ -1268,9 +1269,9 @@ static inline s64 get_pages(struct f2fs_sb_info *sbi, int count_type)return percpu_counter_sum_positive (&sbi->nr_pages[count_type]); } -static inline s64 get_dirty_pages (struct inode *inode) +static inline int get_dirty_pages (struct inode *inode) { -return percpu_counter_sum_positive (&F2FS_I (inode)->dirty_pages); +return atomic_read (&F2FS_I (inode)->dirty_pages); }static inline int get_blocktype_secs (struct f2fs_sb_info *sbi,int block_type)
@@ -1329,22 +1330,27 @@ static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag)static inline block_t __start_cp_addr (struct f2fs_sb_info *sbi) { -block_t start_addr; -struct f2fs_checkpoint *ckpt =F2FS_CKPT (sbi); -unsigned long long ckpt_version =cur_cp_version (ckpt); - - start_addr =le32_to_cpu (F2FS_RAW_SUPER (sbi)->cp_blkaddr); +block_t start_addr =le32_to_cpu (F2FS_RAW_SUPER (sbi)->cp_blkaddr); -/* -* odd numbered checkpoint should at cp segment 0 -* and even segment must be at cp segment 1 -*/ -if (!(ckpt_version &1 )) +if (sbi->cur_cp_pack ==2 ) start_addr += sbi->blocks_per_seg; +return start_addr; +} +static inline block_t __start_cp_next_addr (struct f2fs_sb_info *sbi) +{ +block_t start_addr =le32_to_cpu (F2FS_RAW_SUPER (sbi)->cp_blkaddr); + +if (sbi->cur_cp_pack ==1 ) + start_addr += sbi->blocks_per_seg;return start_addr; } +static inline void __set_cp_next_pack (struct f2fs_sb_info *sbi) +{ + sbi->cur_cp_pack = (sbi->cur_cp_pack ==1 ) ?2 :1 ; +} +static inline block_t __start_sum_addr (struct f2fs_sb_info *sbi) {return le32_to_cpu (F2FS_CKPT (sbi)->cp_pack_start_sum);
fs/f2fs/file.c +2 -2
@@ -967,7 +967,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, new_size = (dst + i) <<PAGE_SHIFT ;if (dst_inode->i_size < new_size)f2fs_i_size_write (dst_inode, new_size); - }while ((do_replace[i] || blkaddr[i] ==NULL_ADDR ) && --ilen); + }while (--ilen && (do_replace[i] || blkaddr[i] ==NULL_ADDR ));f2fs_put_dnode (&dn); }else {
@@ -1526,7 +1526,7 @@ static int f2fs_ioc_start_atomic_write(struct file *filp) goto out;f2fs_msg (F2FS_I_SB (inode)->sb,KERN_WARNING , -"Unexpected flush for atomic writes: ino=%lu, npages=%lld" , +"Unexpected flush for atomic writes: ino=%lu, npages=%u" , inode->i_ino,get_dirty_pages (inode)); ret =filemap_write_and_wait_range (inode->i_mapping,0 ,LLONG_MAX );if (ret)
fs/f2fs/super.c +1 -6
@@ -558,13 +558,9 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)init_once ((void *) fi); -if (percpu_counter_init (&fi->dirty_pages,0 ,GFP_NOFS )) { -kmem_cache_free (f2fs_inode_cachep, fi); -return NULL ; - } -/* Initialize f2fs-specific inode info */ fi->vfs_inode.i_version =1 ; +atomic_set (&fi->dirty_pages,0 ); fi->i_current_depth =1 ; fi->i_advise =0 ;init_rwsem (&fi->i_sem);
@@ -687,7 +683,6 @@ static void f2fs_i_callback(struct rcu_head *head)static void f2fs_destroy_inode (struct inode *inode) { -percpu_counter_destroy (&F2FS_I (inode)->dirty_pages);call_rcu (&inode->i_rcu, f2fs_i_callback); }
fs/splice.c +7 -2
@@ -1086,7 +1086,13 @@ EXPORT_SYMBOL(do_splice_direct);static int wait_for_space (struct pipe_inode_info *pipe,unsigned flags) { -while (pipe->nrbufs == pipe->buffers) { +for (;;) { +if (unlikely (!pipe->readers)) { +send_sig (SIGPIPE , current,0 ); +return -EPIPE ; + } +if (pipe->nrbufs != pipe->buffers) +return 0 ;if (flags &SPLICE_F_NONBLOCK )return -EAGAIN ;if (signal_pending (current))
@@ -1095,7 +1101,6 @@ static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags)pipe_wait (pipe); pipe->waiting_writers--; } -return 0 ; } static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
fs/xfs/xfs_bmap_util.c +5 -2
@@ -1792,6 +1792,7 @@ xfs_swap_extent_forks(struct xfs_ifork tempifp, *ifp, *tifp;int aforkblks =0 ;int taforkblks =0 ; +xfs_extnum_t nextents;__uint64_t tmp;int error;
@@ -1881,7 +1882,8 @@ xfs_swap_extent_forks(* pointer. Otherwise it's already NULL or * pointing to the extent. */ -if (ip->i_d.di_nextents <=XFS_INLINE_EXTS ) { + nextents = ip->i_df.if_bytes / (uint )sizeof (xfs_bmbt_rec_t); +if (nextents <=XFS_INLINE_EXTS ) { ifp->if_u1.if_extents = ifp->if_u2.if_inline_ext; }
@@ -1900,7 +1902,8 @@ xfs_swap_extent_forks(* pointer. Otherwise it's already NULL or * pointing to the extent. */ -if (tip->i_d.di_nextents <=XFS_INLINE_EXTS ) { + nextents = tip->i_df.if_bytes / (uint )sizeof (xfs_bmbt_rec_t); +if (nextents <=XFS_INLINE_EXTS ) { tifp->if_u1.if_extents = tifp->if_u2.if_inline_ext; }
fs/xfs/xfs_log_recover.c +1 -0
@@ -4929,6 +4929,7 @@ xlog_recover_clear_agi_bucket( agi->agi_unlinked[bucket] =cpu_to_be32 (NULLAGINO ); offset = offsetof(xfs_agi_t , agi_unlinked) + (sizeof (xfs_agino_t) * bucket); +xfs_trans_buf_set_type (tp, agibp,XFS_BLFT_AGI_BUF );xfs_trans_log_buf (tp, agibp, offset, (offset +sizeof (xfs_agino_t) -1 ));
include/asm-generic/asm-prototypes.h new file +7 -0
@@ -0,0 +1,7 @@ +#include <linux/bitops.h> +extern void *__memset (void *,int ,__kernel_size_t ); +extern void *__memcpy (void *,const void *,__kernel_size_t ); +extern void *__memmove (void *,const void *,__kernel_size_t ); +extern void *memset (void *,int ,__kernel_size_t ); +extern void *memcpy (void *,const void *,__kernel_size_t ); +extern void *memmove (void *,const void *,__kernel_size_t );
include/linux/capability.h +2 -0
@@ -240,8 +240,10 @@ static inline bool ns_capable_noaudit(struct user_namespace *ns, int cap) return true; }#endif /* CONFIG_MULTIUSER */ +extern bool privileged_wrt_inode_uidgid (struct user_namespace *ns,const struct inode *inode);extern bool capable_wrt_inode_uidgid (const struct inode *inode,int cap);extern bool file_ns_capable (const struct file *file,struct user_namespace *ns,int cap); +extern bool ptracer_capable (struct task_struct *tsk,struct user_namespace *ns);/* audit system wants to get cap info from files as well */ extern int get_vfs_caps_from_disk (const struct dentry *dentry,struct cpu_vfs_cap_data *cpu_caps);
include/linux/cpu.h +4 -11
@@ -93,22 +93,16 @@ extern bool cpuhp_tasks_frozen; { .notifier_call = fn, .priority = pri }; \ __register_cpu_notifier(&fn##_nb); \ } -#else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ -#define cpu_notifier (fn, pri) do { (void)(fn); } while (0) -#define __cpu_notifier (fn, pri) do { (void)(fn); } while (0) -#endif /* #else #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ -#ifdef CONFIG_HOTPLUG_CPUextern int register_cpu_notifier (struct notifier_block *nb);extern int __register_cpu_notifier (struct notifier_block *nb);extern void unregister_cpu_notifier (struct notifier_block *nb);extern void __unregister_cpu_notifier (struct notifier_block *nb); -#else -#ifndef MODULE -extern int register_cpu_notifier(struct notifier_block *nb); -extern int __register_cpu_notifier(struct notifier_block *nb); -#else +#else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ +#define cpu_notifier (fn, pri) do { (void)(fn); } while (0) +#define __cpu_notifier (fn, pri) do { (void)(fn); } while (0) +static inline int register_cpu_notifier (struct notifier_block *nb) {return 0 ;
@@ -118,7 +112,6 @@ static inline int __register_cpu_notifier(struct notifier_block *nb) {return 0 ; } -#endif static inline void unregister_cpu_notifier (struct notifier_block *nb) {
include/linux/mm.h +2 -0
@@ -1270,6 +1270,8 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void * unsigned int gup_flags);extern int access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags); +extern int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, +unsigned long addr,void *buf,int len,unsigned int gup_flags); long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages,
include/linux/mm_types.h +1 -0
@@ -473,6 +473,7 @@ struct mm_struct {*/ struct task_struct __rcu *owner;#endif +struct user_namespace *user_ns;/* store ref to file /proc/<pid>/exe symlink points to */ struct file __rcu *exe_file;
include/linux/pm_opp.h +6 -5
@@ -19,6 +19,7 @@struct dev_pm_opp ;struct device ; +struct opp_table ;enum dev_pm_opp_event {OPP_EVENT_ADD ,OPP_EVENT_REMOVE ,OPP_EVENT_ENABLE ,OPP_EVENT_DISABLE ,
@@ -62,8 +63,8 @@ int dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions,void dev_pm_opp_put_supported_hw (struct device *dev);int dev_pm_opp_set_prop_name (struct device *dev,const char *name);void dev_pm_opp_put_prop_name (struct device *dev); -int dev_pm_opp_set_regulator (struct device *dev,const char *name); -void dev_pm_opp_put_regulator (struct device *dev); +struct opp_table *dev_pm_opp_set_regulator (struct device *dev,const char *name); +void dev_pm_opp_put_regulator (struct opp_table *opp_table);int dev_pm_opp_set_rate (struct device *dev,unsigned long target_freq);int dev_pm_opp_set_sharing_cpus (struct device *cpu_dev,const struct cpumask *cpumask);int dev_pm_opp_get_sharing_cpus (struct device *cpu_dev,struct cpumask *cpumask);
@@ -170,12 +171,12 @@ static inline int dev_pm_opp_set_prop_name(struct device *dev, const char *name)static inline void dev_pm_opp_put_prop_name (struct device *dev) {} -static inline int dev_pm_opp_set_regulator (struct device *dev,const char *name) +static inline struct opp_table *dev_pm_opp_set_regulator (struct device *dev,const char *name) { -return -ENOTSUPP ; +return ERR_PTR (-ENOTSUPP ); } -static inline void dev_pm_opp_put_regulator (struct device *dev) {} +static inline void dev_pm_opp_put_regulator (struct opp_table *opp_table) {}static inline int dev_pm_opp_set_rate (struct device *dev,unsigned long target_freq) {
include/linux/ptrace.h +3 -1
@@ -8,6 +8,9 @@#include <linux/pid_namespace.h> /* For task_active_pid_ns. */ #include <uapi/linux/ptrace.h> +extern int ptrace_access_vm (struct task_struct *tsk,unsigned long addr, +void *buf,int len,unsigned int gup_flags); +/* * Ptrace flags *
@@ -19,7 +22,6 @@#define PT_SEIZED 0x00010000/* SEIZE used, enable new behavior */ #define PT_PTRACED 0x00000001#define PT_DTRACE 0x00000002/* delayed trace (used on m68k, i386) */ -#define PT_PTRACE_CAP 0x00000004/* ptracer can follow suid-exec */ #define PT_OPT_FLAG_SHIFT 3/* PT_TRACE_* event enable flags */
include/linux/sched.h +1 -0
@@ -1656,6 +1656,7 @@ struct task_struct {struct list_head cpu_timers[3 ];/* process credentials */ +const struct cred __rcu *ptracer_cred;/* Tracer's credentials at attach */ const struct cred __rcu *real_cred;/* objective and real subjective task * credentials (COW) */ const struct cred __rcu *cred;/* effective (overridable) subjective task
kernel/capability.c +34 -2
@@ -457,6 +457,19 @@ bool file_ns_capable(const struct file *file, struct user_namespace *ns,EXPORT_SYMBOL (file_ns_capable);/** +* privileged_wrt_inode_uidgid - Do capabilities in the namespace work over the inode? +* @ns: The user namespace in question +* @inode: The inode in question +* +* Return true if the inode uid and gid are within the namespace. +*/ +bool privileged_wrt_inode_uidgid (struct user_namespace *ns,const struct inode *inode) +{ +return kuid_has_mapping (ns, inode->i_uid) && +kgid_has_mapping (ns, inode->i_gid); +} + +/** * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped * @inode: The inode in question * @cap: The capability in question
@@ -469,7 +482,26 @@ bool capable_wrt_inode_uidgid(const struct inode *inode, int cap) {struct user_namespace *ns =current_user_ns (); -return ns_capable (ns, cap) &&kuid_has_mapping (ns, inode->i_uid) && -kgid_has_mapping (ns, inode->i_gid); +return ns_capable (ns, cap) &&privileged_wrt_inode_uidgid (ns, inode); }EXPORT_SYMBOL (capable_wrt_inode_uidgid); + +/** +* ptracer_capable - Determine if the ptracer holds CAP_SYS_PTRACE in the namespace +* @tsk: The task that may be ptraced +* @ns: The user namespace to search for CAP_SYS_PTRACE in +* +* Return true if the task that is ptracing the current task had CAP_SYS_PTRACE +* in the specified user namespace. +*/ +bool ptracer_capable (struct task_struct *tsk,struct user_namespace *ns) +{ +int ret =0 ;/* An absent tracer adds no restrictions */ +const struct cred *cred; +rcu_read_lock (); + cred =rcu_dereference (tsk->ptracer_cred); +if (cred) + ret =security_capable_noaudit (cred, ns,CAP_SYS_PTRACE ); +rcu_read_unlock (); +return (ret ==0 ); +}
kernel/cpu.c +1 -1
@@ -659,7 +659,6 @@ void __init cpuhp_threads_init(void)kthread_unpark (this_cpu_read (cpuhp_state.thread)); } -#ifdef CONFIG_HOTPLUG_CPU EXPORT_SYMBOL (register_cpu_notifier);EXPORT_SYMBOL (__register_cpu_notifier);void unregister_cpu_notifier (struct notifier_block *nb)
@@ -676,6 +675,7 @@ void __unregister_cpu_notifier(struct notifier_block *nb) }EXPORT_SYMBOL (__unregister_cpu_notifier); +#ifdef CONFIG_HOTPLUG_CPU /** * clear_tasks_mm_cpumask - Safely clear tasks' mm_cpumask for a CPU * @cpu: a CPU id
kernel/debug/debug_core.c +2 -2
@@ -598,11 +598,11 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs,/* * Wait for the other CPUs to be notified and be waiting for us: */ - time_left = loops_per_jiffy *HZ ; + time_left =MSEC_PER_SEC ;while (kgdb_do_roundup && --time_left && (atomic_read (&masters_in_kgdb) +atomic_read (&slaves_in_kgdb)) != online_cpus) -cpu_relax (); +udelay (1000 );if (!time_left)pr_crit ("Timed out waiting for secondary CPUs.\n" );
kernel/fork.c +6 -3
@@ -745,7 +745,8 @@ static void mm_init_owner(struct mm_struct *mm, struct task_struct *p)#endif } -static struct mm_struct *mm_init (struct mm_struct *mm,struct task_struct *p) +static struct mm_struct *mm_init (struct mm_struct *mm,struct task_struct *p, +struct user_namespace *user_ns) { mm->mmap =NULL ; mm->mm_rb =RB_ROOT ;
@@ -785,6 +786,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p)if (init_new_context (p, mm)) goto fail_nocontext; + mm->user_ns =get_user_ns (user_ns);return mm; fail_nocontext:
@@ -830,7 +832,7 @@ struct mm_struct *mm_alloc(void)return NULL ;memset (mm,0 ,sizeof (*mm)); -return mm_init (mm, current); +return mm_init (mm, current,current_user_ns ()); }/*
@@ -845,6 +847,7 @@ void __mmdrop(struct mm_struct *mm)destroy_context (mm);mmu_notifier_mm_destroy (mm);check_mm (mm); +put_user_ns (mm->user_ns);free_mm (mm); }EXPORT_SYMBOL_GPL (__mmdrop);
@@ -1126,7 +1129,7 @@ static struct mm_struct *dup_mm(struct task_struct *tsk)memcpy (mm, oldmm,sizeof (*mm)); -if (!mm_init (mm, tsk)) +if (!mm_init (mm, tsk, mm->user_ns)) goto fail_nomem; err =dup_mmap (mm, oldmm);
kernel/ptrace.c +49 -21
148 lines not on this page · raw message
kernel/watchdog.c +0 -1
@@ -344,7 +344,6 @@ static void watchdog_overflow_callback(struct perf_event *event,*/ if (is_hardlockup ()) {int this_cpu =smp_processor_id (); -struct pt_regs *regs =get_irq_regs ();/* only print hardlockups once */ if (__this_cpu_read (hard_watchdog_warn) == true)
mm/filemap.c +1 -1
@@ -1686,7 +1686,7 @@ static ssize_t do_generic_file_read(struct file *filp, loff_t *ppos,int error =0 ;if (unlikely (*ppos >= inode->i_sb->s_maxbytes)) -return -EINVAL ; +return 0 ;iov_iter_truncate (iter, inode->i_sb->s_maxbytes); index = *ppos >>PAGE_SHIFT ;
mm/init-mm.c +2 -0
@@ -6,6 +6,7 @@#include <linux/cpumask.h> #include <linux/atomic.h> +#include <linux/user_namespace.h> #include <asm/pgtable.h> #include <asm/mmu.h>
@@ -21,5 +22,6 @@ struct mm_struct init_mm = { .mmap_sem = __RWSEM_INITIALIZER(init_mm.mmap_sem), .page_table_lock = __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock), .mmlist = LIST_HEAD_INIT(init_mm.mmlist), + .user_ns = &init_user_ns, INIT_MM_CONTEXT(init_mm) };
mm/memory.c +1 -1
@@ -3868,7 +3868,7 @@ EXPORT_SYMBOL_GPL(generic_access_phys);* Access another process' address space as given in mm. If non-NULL, use the * given task for page fault accounting. */ -static int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, +int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags) {struct vm_area_struct *vma;
mm/nommu.c +1 -1
@@ -1808,7 +1808,7 @@ void filemap_map_pages(struct fault_env *fe, }EXPORT_SYMBOL (filemap_map_pages); -static int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, +int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags) {struct vm_area_struct *vma;
mm/page_alloc.c +10 -2
@@ -2192,7 +2192,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order, unsigned long count, struct list_head *list, int migratetype, bool cold) { - int i; + int i, alloced = 0;spin_lock (&zone->lock);for (i =0 ; i < count; ++i) {
@@ -2217,13 +2217,21 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,else list_add_tail (&page->lru, list); list = &page->lru; + alloced++;if (is_migrate_cma (get_pcppage_migratetype (page)))__mod_zone_page_state (zone,NR_FREE_CMA_PAGES , -(1 << order)); } + +/* +* i pages were removed from the buddy list even if some leak due +* to check_pcp_refill failing so adjust NR_FREE_PAGES based +* on i. Do not confuse with 'alloced' which is the number of +* pages added to the pcp list. +*/ __mod_zone_page_state (zone,NR_FREE_PAGES , -(i << order));spin_unlock (&zone->lock); -return i; +return alloced; }#ifdef CONFIG_NUMA
mm/vmscan.c +11 -3
@@ -291,6 +291,7 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,int nid = shrinkctl->nid;long batch_size = shrinker->batch ? shrinker->batch :SHRINK_BATCH ; +long scanned =0 , next_deferred; freeable = shrinker->count_objects (shrinker, shrinkctl);if (freeable ==0 )
@@ -312,7 +313,9 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,pr_err ("shrink_slab: %pF negative objects to delete nr=%ld\n" , shrinker->scan_objects, total_scan); total_scan = freeable; - } + next_deferred = nr; + }else + next_deferred = total_scan;/* * We need to avoid excessive windup on filesystem shrinkers
@@ -369,17 +372,22 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,count_vm_events (SLABS_SCANNED , nr_to_scan); total_scan -= nr_to_scan; + scanned += nr_to_scan;cond_resched (); } +if (next_deferred >= scanned) + next_deferred -= scanned; +else + next_deferred =0 ;/* * move the unused scan count back into the shrinker in a * manner that handles concurrent updates. If we exhausted the * scan, there is no need to do an update. */ -if (total_scan >0 ) - new_nr =atomic_long_add_return (total_scan, +if (next_deferred >0 ) + new_nr =atomic_long_add_return (next_deferred, &shrinker->nr_deferred[nid]);else new_nr =atomic_long_read (&shrinker->nr_deferred[nid]);
scripts/package/builddeb +1 -1
@@ -51,7 +51,7 @@ set_debarch() { debarch=hppa ;; mips*) debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; - arm64) + aarch64|arm64) debarch=arm64 ;; arm*) if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
sound/pci/hda/hda_auto_parser.c +3 -1
@@ -884,6 +884,8 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action) }EXPORT_SYMBOL_GPL (snd_hda_apply_fixup); +#define IGNORE_SEQ_ASSOC (~(AC_DEFCFG_SEQUENCE | AC_DEFCFG_DEF_ASSOC)) +static bool pin_config_match (struct hda_codec *codec,const struct hda_pintbl *pins) {
@@ -901,7 +903,7 @@ static bool pin_config_match(struct hda_codec *codec,for (; t_pins->nid; t_pins++) {if (t_pins->nid == nid) { found =1 ; -if (t_pins->val == cfg) +if ((t_pins->val &IGNORE_SEQ_ASSOC ) == (cfg &IGNORE_SEQ_ASSOC ))break ;else if ((cfg &0xf0000000 ) ==0x40000000 && (t_pins->val &0xf0000000 ) ==0x40000000 )break ;
sound/pci/hda/patch_ca0132.c +1 -0
@@ -780,6 +780,7 @@ static const struct hda_pintbl alienware_pincfgs[] = {static const struct snd_pci_quirk ca0132_quirks[] = {SND_PCI_QUIRK (0x1028 ,0x0685 ,"Alienware 15 2015" ,QUIRK_ALIENWARE ),SND_PCI_QUIRK (0x1028 ,0x0688 ,"Alienware 17 2015" ,QUIRK_ALIENWARE ), +SND_PCI_QUIRK (0x1028 ,0x0708 ,"Alienware 15 R2 2016" ,QUIRK_ALIENWARE ), {} };
sound/pci/hda/patch_conexant.c +17 -0
@@ -262,6 +262,7 @@ enum {CXT_FIXUP_CAP_MIX_AMP_5047 ,CXT_FIXUP_MUTE_LED_EAPD ,CXT_FIXUP_HP_SPECTRE , + CXT_FIXUP_HP_GATE_MIC, };/* for hda_fixup_thinkpad_acpi() */
@@ -633,6 +634,17 @@ static void cxt_fixup_cap_mix_amp_5047(struct hda_codec *codec, (1 << AC_AMPCAP_MUTE_SHIFT)); } +static void cxt_fixup_hp_gate_mic_jack (struct hda_codec *codec, +const struct hda_fixup *fix, +int action) +{ +/* the mic pin (0x19) doesn't give an unsolicited event; +* probe the mic pin together with the headphone pin (0x16) +*/ +if (action ==HDA_FIXUP_ACT_PROBE ) +snd_hda_jack_set_gating_jack (codec,0x19 ,0x16 ); +} +/* ThinkPad X200 & co with cxt5051 */ static const struct hda_pintbl cxt_pincfg_lenovo_x200[] = { {0x16 ,0x042140ff },/* HP (seq# overridden) */
@@ -774,6 +786,10 @@ static const struct hda_fixup cxt_fixups[] = { { } } }, + [CXT_FIXUP_HP_GATE_MIC] = { + .type = HDA_FIXUP_FUNC, + .v.func = cxt_fixup_hp_gate_mic_jack, + }, };static const struct snd_pci_quirk cxt5045_fixups[] = {
@@ -824,6 +840,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {SND_PCI_QUIRK (0x1025 ,0x054c ,"Acer Aspire 3830TG" ,CXT_FIXUP_ASPIRE_DMIC ),SND_PCI_QUIRK (0x1025 ,0x054f ,"Acer Aspire 4830T" ,CXT_FIXUP_ASPIRE_DMIC ),SND_PCI_QUIRK (0x103c ,0x8174 ,"HP Spectre x360" ,CXT_FIXUP_HP_SPECTRE ), +SND_PCI_QUIRK (0x103c ,0x8115 ,"HP Z1 Gen3" ,CXT_FIXUP_HP_GATE_MIC ),SND_PCI_QUIRK (0x1043 ,0x138d ,"Asus" ,CXT_FIXUP_HEADPHONE_MIC_PIN ),SND_PCI_QUIRK (0x152d ,0x0833 ,"OLPC XO-1.5" ,CXT_FIXUP_OLPC_XO ), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
sound/pci/hda/patch_realtek.c +3 -0
@@ -5917,6 +5917,9 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { {0x12, 0x90a60180}, {0x14, 0x90170120}, {0x21, 0x02211030}), + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x1b, 0x01011020}, + {0x21, 0x02211010}), SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, {0x12, 0x90a60160}, {0x14, 0x90170120},
sound/soc/intel/atom/sst-mfld-platform-pcm.c +6 -0
@@ -771,6 +771,9 @@ static int sst_soc_prepare(struct device *dev)struct sst_data *drv =dev_get_drvdata (dev);struct snd_soc_pcm_runtime *rtd; +if (!drv->soc_card) +return 0 ; +/* suspend all pcms first */ snd_soc_suspend (drv->soc_card->dev);snd_soc_poweroff (drv->soc_card->dev);
@@ -793,6 +796,9 @@ static void sst_soc_complete(struct device *dev)struct sst_data *drv =dev_get_drvdata (dev);struct snd_soc_pcm_runtime *rtd; +if (!drv->soc_card) +return ; +/* restart SSPs */ list_for_each_entry (rtd, &drv->soc_card->rtd_list, list) {struct snd_soc_dai *dai = rtd->cpu_dai;
sound/usb/hiface/pcm.c +2 -0
@@ -445,6 +445,8 @@ static int hiface_pcm_prepare(struct snd_pcm_substream *alsa_sub)mutex_lock (&rt->stream_mutex); +hiface_pcm_stream_stop (rt); + sub->dma_off =0 ; sub->period_off =0 ;
sound/usb/mixer.c +2 -1
@@ -932,9 +932,10 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,case USB_ID (0x046d ,0x0826 ):/* HD Webcam c525 */ case USB_ID (0x046d ,0x08ca ):/* Logitech Quickcam Fusion */ case USB_ID (0x046d ,0x0991 ): +case USB_ID (0x046d ,0x09a2 ):/* QuickCam Communicate Deluxe/S7500 */ /* Most audio usb devices lie about volume resolution. * Most Logitech webcams have res = 384. -* Proboly there is some logitech magic behind this number --fishor +* Probably there is some logitech magic behind this number --fishor */ if (!strcmp (kctl->id.name,"Mic Capture Volume" )) { usb_audio_info(chip,