Linux 3.18.133
Greg KH
maintainerI'm announcing the release of the 3.18.133 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.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
------------
Documentation/filesystems/proc.txt | 4 + Makefile | 2 arch/arm/mach-imx/clk-imx6q.c | 6 ++ arch/mips/Kconfig | 3 + arch/mips/pci/msi-octeon.c | 4 + arch/mips/sibyte/common/Makefile | 1 arch/mips/sibyte/common/dma.c | 14 ++++++ arch/sparc/kernel/signal_32.c | 4 - crypto/authenc.c | 14 +++++- crypto/cts.c | 8 +-- drivers/acpi/power.c | 22 ++++++++++ drivers/base/bus.c | 7 ++- drivers/block/loop.c | 47 +++++++++++------------ drivers/block/loop.h | 1 drivers/cpuidle/cpuidle-pseries.c | 8 +++ drivers/gpu/drm/drm_fb_helper.c | 7 ++- drivers/i2c/i2c-dev.c | 6 ++ drivers/md/dm-kcopyd.c | 19 ++++++--- drivers/md/dm-snap.c | 22 ++++++++++ drivers/media/firewire/firedtv-avc.c | 6 +- drivers/media/firewire/firedtv.h | 6 +- drivers/media/platform/vivid/vivid-kthread-cap.c | 5 +- drivers/media/platform/vivid/vivid-kthread-out.c | 5 +- drivers/media/platform/vivid/vivid-vid-common.c | 2 drivers/media/usb/em28xx/em28xx-video.c | 4 - drivers/media/v4l2-core/videobuf2-core.c | 14 ++++-- drivers/mfd/tps6586x.c | 24 +++++++++++ drivers/mmc/host/atmel-mci.c | 3 - drivers/net/ethernet/realtek/r8169.c | 2 drivers/scsi/sd.c | 6 ++ drivers/target/target_core_spc.c | 17 +++++--- drivers/tty/tty_ldsem.c | 10 ++++ drivers/usb/class/cdc-acm.c | 7 +++ drivers/usb/storage/scsiglue.c | 8 ++- drivers/usb/storage/unusual_devs.h | 12 +++++ drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | 2 fs/btrfs/disk-io.c | 8 +++ fs/cifs/file.c | 8 +-- fs/cifs/smb2file.c | 4 - fs/cifs/transport.c | 2 fs/jffs2/super.c | 3 - fs/ocfs2/localalloc.c | 9 +++- fs/pstore/ram_core.c | 5 ++ include/linux/sunrpc/svc.h | 5 +- mm/slab.c | 6 +- net/bridge/br_netfilter.c | 2 net/can/gw.c | 30 +++++++++++++- net/core/sock.c | 1 net/ipv6/datagram.c | 1 net/packet/af_packet.c | 4 - net/sctp/ipv6.c | 5 -- net/sctp/protocol.c | 4 - net/sunrpc/rpcb_clnt.c | 8 +++ net/sunrpc/svc.c | 10 +++- net/sunrpc/svc_xprt.c | 5 +- net/sunrpc/svcsock.c | 2 scripts/kconfig/zconf.l | 2 security/selinux/ss/policydb.c | 3 - security/yama/yama_lsm.c | 4 + sound/firewire/bebob/bebob.c | 2 tools/perf/util/parse-events.c | 2 tools/perf/util/svghelper.c | 2 62 files changed, 365 insertions(+), 104 deletions(-)
Andreas Larsson (1):
sparc32: Fix inverted invalid_frame_pointer checks on sigreturns
Arnaldo Carvalho de Melo (2):
perf svghelper: Fix unchecked usage of strncpy() perf parse-events: Fix unchecked usage of strncpy()
Ben Hutchings (1):
media: em28xx: Fix misplaced reset of dev->v4l::field_count
Breno Leitao (1):
powerpc/pseries/cpuidle: Fix preempt warning
Christoph Lameter (1):
slab: alien caches must not be initialized if the allocation of the alien cache failed
Daniel Santos (1):
jffs2: Fix use of uninitialized delayed_work, lockdep breakage
Daniel Vetter (1):
sysfs: Disable lockdep for driver bind/unbind files
Daniele Palmas (1):
usb: cdc-acm: send ZLP for Telit 3G Intel based modems
David Disseldorp (1):
scsi: target: use consistent left-aligned ASCII INQUIRY data
Dmitry Safonov (1):
tty/ldsem: Wake up readers after timed out down_write()
Eric Biggers (2):
crypto: cts - fix crash on short inputs
crypto: authenc - fix parsing key with misaligned rta_len
Eric Dumazet (1):
ipv6: fix kernel-infoleak in ipv6_local_error()
Greg Kroah-Hartman (1):
Linux 3.18.133
Hans Verkuil (3):
media: vivid: fix error handling of kthread_run
media: vivid: set min width/height to a value > 0
media: vb2: vb2_mmap: move lock up
Hans de Goede (1):
ACPI: power: Skip duplicate power resource references in _PRx
Icenowy Zheng (2):
USB: storage: don't insert sane sense for SPC3+ when bad sense specified
USB: storage: add quirk for SMI SM3350
Ivan Mironov (2):
scsi: sd: Fix cache_type_store()
drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock
J. Bruce Fields (1):
sunrpc: handle ENOMEM in rpcb_getport_async
Jason Gunthorpe (1):
packet: Do not leak dev refcounts on error exit
JianJhen Chen (1):
net: bridge: fix a bug on using a neighbour cache entry without checking its state
Joel Fernandes (Google) (1):
pstore/ram: Do not treat empty buffers as valid
Jonas Danielsson (1):
mmc: atmel-mci: do not assume idle after atmci_request_end
Jonathan Hunter (1):
mfd: tps6586x: Handle interrupts on suspend
Josef Bacik (1):
btrfs: wait on ordered extents on abort cleanup
Junxiao Bi (1):
ocfs2: fix panic due to unrecovered local alloc
Kai-Heng Feng (1):
r8169: Add support for new Realtek Ethernet
Kees Cook (1):
Yama: Check for pid death before checking ancestry
Lucas Stach (1):
clk: imx6q: reset exclusive gates on init
Maciej W. Rozycki (1):
MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur
Masahiro Yamada (1):
kconfig: fix memory leak when EOF is encountered in quotation
Mauro Carvalho Chehab (1):
media: vb2: be sure to unlock mutex on errors
Michal Hocko (1):
mm, proc: be more verbose about unstable VMA flags in /proc/<pid>/smaps
Nathan Chancellor (1):
media: firewire: Fix app_info parameter type in avc_ca{,_app}_info
Nikos Tsironis (2):
dm kcopyd: Fix bug causing workqueue stalls
dm snapshot: Fix excessive memory usage and workqueue stalls
Oliver Hartkopp (1):
can: gw: ensure DLC boundaries after CAN frame modification
Pavel Shilovsky (1):
CIFS: Do not hide EINTR after sending network packets
Ross Lagerwall (1):
cifs: Fix potential OOB access of lock element array
Stephen Smalley (1):
selinux: fix GPF on invalid policy
Takashi Sakamoto (1):
ALSA: bebob: fix model-id of unit for Apogee Ensemble
Tetsuo Handa (1):
block/loop: Use global lock for ioctl() operation.
Vasily Averin (1):
sunrpc: use-after-free in svc_process_common()
Vlad Tsyrklevich (1):
omap2fb: Fix stack memory disclosure
Xin Long (1):
sctp: allocate sctp_sockaddr_entry with kzalloc
Yi Zeng (1):
i2c: dev: prevent adapter retries and timeout being set as minus value
YunQiang Su (1):
Disable MSI also when pcie-octeon.pcie_disable on
yupeng (1):
net: call sk_dst_reset when set SO_DONTROUTE
Greg KH
maintainerDocumentation/filesystems/proc.txt +3 -1
@@ -439,7 +439,9 @@ manner. The codes are the following: Note that there is no guarantee that every flag and associated mnemonic will be present in all further kernel releases. Things get changed, the flags may -be vanished or the reverse -- new added. +be vanished or the reverse -- new added. Interpretation of their meaning +might change in future as well. So each consumer of these flags has to +follow each specific kernel version for the exact semantic. This file is only present if the CONFIG_MMU kernel configuration option is enabled.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 132 +SUBLEVEL = 133 EXTRAVERSION = NAME = Diseased Newt
arch/arm/mach-imx/clk-imx6q.c +5 -1
@@ -222,8 +222,12 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)* lvds1_gate and lvds2_gate are pseudo-gates. Both can be * independently configured as clock inputs or outputs. We treat * the "output_enable" bit as a gate, even though it's really just -* enabling clock output. +* enabling clock output. Initially the gate bits are cleared, as +* otherwise the exclusive configuration gets locked in the setup done +* by software running before the clock driver, with no way to change +* it. */ +writel (readl (base +0x160 ) & ~0x3c00 , base +0x160 ); clk[IMX6QDL_CLK_LVDS1_GATE ] =imx_clk_gate_exclusive ("lvds1_gate" ,"lvds1_sel" , base +0x160 ,10 ,BIT (12 )); clk[IMX6QDL_CLK_LVDS2_GATE ] =imx_clk_gate_exclusive ("lvds2_gate" ,"lvds2_sel" , base +0x160 ,11 ,BIT (13 ));
arch/mips/Kconfig +3 -0
@@ -627,6 +627,7 @@ config SIBYTE_SWARM select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_LITTLE_ENDIAN select ZONE_DMA32 if 64BIT + select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI config SIBYTE_LITTLESUR bool "Sibyte BCM91250C2-LittleSur"
@@ -649,6 +650,7 @@ config SIBYTE_SENTOSA select SYS_HAS_CPU_SB1 select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_LITTLE_ENDIAN + select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI config SIBYTE_BIGSUR bool "Sibyte BCM91480B-BigSur"
@@ -662,6 +664,7 @@ config SIBYTE_BIGSUR select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_LITTLE_ENDIAN select ZONE_DMA32 if 64BIT + select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI config SNI_RM bool "SNI RM200/300/400"
arch/mips/pci/msi-octeon.c +3 -1
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void)int irq;struct irq_chip *msi; -if (octeon_dma_bar_type ==OCTEON_DMA_BAR_TYPE_PCIE ) { +if (octeon_dma_bar_type ==OCTEON_DMA_BAR_TYPE_INVALID ) { +return 0 ; + }else if (octeon_dma_bar_type ==OCTEON_DMA_BAR_TYPE_PCIE ) { msi_rcv_reg[0 ] =CVMX_PEXP_NPEI_MSI_RCV0 ; msi_rcv_reg[1 ] =CVMX_PEXP_NPEI_MSI_RCV1 ; msi_rcv_reg[2 ] =CVMX_PEXP_NPEI_MSI_RCV2 ;
arch/mips/sibyte/common/Makefile +1 -0
@@ -1,4 +1,5 @@ obj-y := cfe.o +obj-$(CONFIG_SWIOTLB) += dma.o obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o obj-$(CONFIG_SIBYTE_CFE_CONSOLE) += cfe_console.o obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o
arch/mips/sibyte/common/dma.c new file +14 -0
@@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* DMA support for Broadcom SiByte platforms. +* +* Copyright (c) 2018 Maciej W. Rozycki +*/ + +#include <linux/swiotlb.h> +#include <asm/bootinfo.h> + +void __init plat_swiotlb_setup (void ) +{ +swiotlb_init (1 ); +}
arch/sparc/kernel/signal_32.c +2 -2
@@ -89,7 +89,7 @@ asmlinkage void do_sigreturn(struct pt_regs *regs) sf = (struct signal_frame __user *) regs->u_regs[UREG_FP ];/* 1. Make sure we are not getting garbage from the user */ -if (!invalid_frame_pointer (sf,sizeof (*sf))) +if (invalid_frame_pointer (sf,sizeof (*sf))) goto segv_and_exit;if (get_user (ufp, &sf->info.si_regs.u_regs[UREG_FP ]))
@@ -150,7 +150,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)synchronize_user_stack (); sf = (struct rt_signal_frame __user *) regs->u_regs[UREG_FP ]; -if (!invalid_frame_pointer (sf,sizeof (*sf))) +if (invalid_frame_pointer (sf,sizeof (*sf))) goto segv;if (get_user (ufp, &sf->regs.u_regs[UREG_FP ]))
crypto/authenc.c +11 -3
@@ -62,14 +62,22 @@ int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key,return -EINVAL ;if (rta->rta_type !=CRYPTO_AUTHENC_KEYA_PARAM )return -EINVAL ; -if (RTA_PAYLOAD (rta) <sizeof (*param)) + +/* +* RTA_OK() didn't align the rtattr's payload when validating that it +* fits in the buffer. Yet, the keys should start on the next 4-byte +* aligned boundary. To avoid confusion, require that the rtattr +* payload be exactly the param struct, which has a 4-byte aligned size. +*/ +if (RTA_PAYLOAD (rta) !=sizeof (*param))return -EINVAL ; +BUILD_BUG_ON (sizeof (*param) %RTA_ALIGNTO ); param =RTA_DATA (rta); keys->enckeylen =be32_to_cpu (param->enckeylen); - key +=RTA_ALIGN (rta->rta_len); - keylen -=RTA_ALIGN (rta->rta_len); + key += rta->rta_len; + keylen -= rta->rta_len;if (keylen < keys->enckeylen)return -EINVAL ;
crypto/cts.c +4 -4
@@ -137,8 +137,8 @@ static int crypto_cts_encrypt(struct blkcipher_desc *desc, lcldesc.info = desc->info; lcldesc.flags = desc->flags; -if (tot_blocks ==1 ) { - err =crypto_blkcipher_encrypt_iv (&lcldesc, dst, src, bsize); +if (tot_blocks <=1 ) { + err =crypto_blkcipher_encrypt_iv (&lcldesc, dst, src, nbytes); }else if (nbytes <= bsize *2 ) { err =cts_cbc_encrypt (ctx, desc, dst, src,0 , nbytes); }else {
@@ -232,8 +232,8 @@ static int crypto_cts_decrypt(struct blkcipher_desc *desc, lcldesc.info = desc->info; lcldesc.flags = desc->flags; -if (tot_blocks ==1 ) { - err =crypto_blkcipher_decrypt_iv (&lcldesc, dst, src, bsize); +if (tot_blocks <=1 ) { + err =crypto_blkcipher_decrypt_iv (&lcldesc, dst, src, nbytes); }else if (nbytes <= bsize *2 ) { err =cts_cbc_decrypt (ctx, desc, dst, src,0 , nbytes); }else {
drivers/acpi/power.c +22 -0
@@ -132,6 +132,23 @@ void acpi_power_resources_list_free(struct list_head *list) } } +static bool acpi_power_resource_is_dup (union acpi_object *package, +unsigned int start,unsigned int i) +{ +acpi_handle rhandle, dup; +unsigned int j; + +/* The caller is expected to check the package element types */ + rhandle = package->package.elements[i].reference.handle; +for (j = start; j < i; j++) { + dup = package->package.elements[j].reference.handle; +if (dup == rhandle) +return true; + } + +return false; +} +int acpi_extract_power_resources (union acpi_object *package,unsigned int start,struct list_head *list) {
@@ -151,6 +168,11 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start, err = -ENODEV ;break ; } + +/* Some ACPI tables contain duplicate power resource references */ +if (acpi_power_resource_is_dup (package, start, i)) +continue ; + err =acpi_add_power_resource (rhandle);if (err)break ;
drivers/base/bus.c +5 -2
@@ -32,6 +32,9 @@ static struct kset *system_kset;#define to_drv_attr (_attr) container_of(_attr, struct driver_attribute, attr) +#define DRIVER_ATTR_IGNORE_LOCKDEP (_name, _mode, _show, _store) \ + struct driver_attribute driver_attr_##_name = \ + __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)static int __must_check bus_rescan_devices_helper (struct device *dev,void *data);
@@ -197,7 +200,7 @@ static ssize_t unbind_store(struct device_driver *drv, const char *buf,bus_put (bus);return err; } -static DRIVER_ATTR_WO (unbind); +static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, S_IWUSR, NULL, unbind_store);/* * Manually attach a device to a driver.
@@ -233,7 +236,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf,bus_put (bus);return err; } -static DRIVER_ATTR_WO (bind); +static DRIVER_ATTR_IGNORE_LOCKDEP(bind, S_IWUSR, NULL, bind_store);static ssize_t show_drivers_autoprobe (struct bus_type *bus,char *buf) {
drivers/block/loop.c +24 -23
145 lines not on this page · raw message
drivers/block/loop.h +0 -1
@@ -55,7 +55,6 @@ struct loop_device {struct bio_list lo_bio_list;unsigned int lo_bio_count;int lo_state; -struct mutex lo_ctl_mutex;struct task_struct *lo_thread;wait_queue_head_t lo_event;/* wait queue for incoming requests */
drivers/cpuidle/cpuidle-pseries.c +7 -1
@@ -237,7 +237,13 @@ static int pseries_idle_probe(void)return -ENODEV ;if (firmware_has_feature (FW_FEATURE_SPLPAR )) { -if (lppaca_shared_proc (get_lppaca ())) { +/* +* Use local_paca instead of get_lppaca() since +* preemption is not disabled, and it is not required in +* fact, since lppaca_ptr does not need to be the value +* associated to the current CPU, it can be from any CPU. +*/ +if (lppaca_shared_proc (local_paca->lppaca_ptr)) { cpuidle_state_table = shared_states; max_idle_state =ARRAY_SIZE (shared_states); }else {
drivers/gpu/drm/drm_fb_helper.c +6 -1
@@ -822,9 +822,14 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,struct drm_framebuffer *fb = fb_helper->fb;int depth; -if (var->pixclock !=0 ||in_dbg_master ()) +if (in_dbg_master ())return -EINVAL ; +if (var->pixclock !=0 ) { +DRM_DEBUG ("fbdev emulation doesn't support changing the pixel clock, value of pixclock is ignored\n" ); + var->pixclock =0 ; + } +/* Need to resize the fb object !!! */ if (var->bits_per_pixel > fb->bits_per_pixel || var->xres > fb->width || var->yres > fb->height ||
drivers/i2c/i2c-dev.c +6 -0
@@ -462,9 +462,15 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)return i2cdev_ioctl_smbus (client, arg);case I2C_RETRIES : +if (arg >INT_MAX ) +return -EINVAL ; + client->adapter->retries = arg;break ;case I2C_TIMEOUT : +if (arg >INT_MAX ) +return -EINVAL ; +/* For historical reasons, user-space sets the timeout * value in units of 10 ms. */
drivers/md/dm-kcopyd.c +14 -5
@@ -55,15 +55,17 @@ struct dm_kcopyd_client {struct dm_kcopyd_throttle *throttle;/* -* We maintain three lists of jobs: +* We maintain four lists of jobs: * * i) jobs waiting for pages * ii) jobs that have pages, and are waiting for the io to be issued. -* iii) jobs that have completed. +* iii) jobs that don't need to do any IO and just run a callback +* iv) jobs that have completed. * -* All three of these are protected by job_lock. +* All four of these are protected by job_lock. */ spinlock_t job_lock; +struct list_head callback_jobs;struct list_head complete_jobs;struct list_head io_jobs;struct list_head pages_jobs;
@@ -583,6 +585,7 @@ static void do_work(struct work_struct *work)struct dm_kcopyd_client *kc =container_of (work, struct dm_kcopyd_client, kcopyd_work);struct blk_plug plug; +unsigned long flags;/* * The order that these are called is *very* important.
@@ -591,6 +594,10 @@ static void do_work(struct work_struct *work)* list. io jobs call wake when they complete and it all * starts again. */ +spin_lock_irqsave (&kc->job_lock, flags); +list_splice_tail_init (&kc->callback_jobs, &kc->complete_jobs); +spin_unlock_irqrestore (&kc->job_lock, flags); +blk_start_plug (&plug);process_jobs (&kc->complete_jobs, kc, run_complete_job);process_jobs (&kc->pages_jobs, kc, run_pages_job);
@@ -608,7 +615,7 @@ static void dispatch_job(struct kcopyd_job *job)struct dm_kcopyd_client *kc = job->kc;atomic_inc (&kc->nr_jobs);if (unlikely (!job->source.count)) -push (&kc->complete_jobs, job); +push (&kc->callback_jobs, job);else if (job->pages == &zero_page_list)push (&kc->io_jobs, job);else
@@ -795,7 +802,7 @@ void dm_kcopyd_do_callback(void *j, int read_err, unsigned long write_err) job->read_err = read_err; job->write_err = write_err; -push (&kc->complete_jobs, job); +push (&kc->callback_jobs, job);wake (kc); }EXPORT_SYMBOL (dm_kcopyd_do_callback);
@@ -825,6 +832,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *throreturn ERR_PTR (-ENOMEM );spin_lock_init (&kc->job_lock); +INIT_LIST_HEAD (&kc->callback_jobs);INIT_LIST_HEAD (&kc->complete_jobs);INIT_LIST_HEAD (&kc->io_jobs);INIT_LIST_HEAD (&kc->pages_jobs);
@@ -874,6 +882,7 @@ void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc)/* Wait for completion of all jobs submitted by this client. */ wait_event (kc->destroyq, !atomic_read (&kc->nr_jobs)); +BUG_ON (!list_empty (&kc->callback_jobs));BUG_ON (!list_empty (&kc->complete_jobs));BUG_ON (!list_empty (&kc->io_jobs));BUG_ON (!list_empty (&kc->pages_jobs));
drivers/md/dm-snap.c +22 -0
@@ -19,6 +19,7 @@#include <linux/vmalloc.h> #include <linux/log2.h> #include <linux/dm-kcopyd.h> +#include <linux/semaphore.h> #include "dm.h"
@@ -98,6 +99,9 @@ struct dm_snapshot {/* The on disk metadata handler */ struct dm_exception_store *store; +/* Maximum number of in-flight COW jobs. */ +struct semaphore cow_count; +struct dm_kcopyd_client *kcopyd_client;/* Wait for events based on state_bits */
@@ -138,6 +142,19 @@ struct dm_snapshot {#define RUNNING_MERGE 0#define SHUTDOWN_MERGE 1 +/* +* Maximum number of chunks being copied on write. +* +* The value was decided experimentally as a trade-off between memory +* consumption, stalling the kernel's workqueues and maintaining a high enough +* throughput. +*/ +#define DEFAULT_COW_THRESHOLD 2048 + +static int cow_threshold =DEFAULT_COW_THRESHOLD ; +module_param_named (snapshot_cow_threshold, cow_threshold, int,0644 ); +MODULE_PARM_DESC (snapshot_cow_threshold,"Maximum number of chunks being copied on write" ); +DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM (snapshot_copy_throttle,"A percentage of time allocated for copy on write" );
@@ -1173,6 +1190,8 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto bad_hash_tables; } +sema_init (&s->cow_count, (cow_threshold >0 ) ? cow_threshold :INT_MAX ); + s->kcopyd_client =dm_kcopyd_client_create (&dm_kcopyd_throttle);if (IS_ERR (s->kcopyd_client)) { r =PTR_ERR (s->kcopyd_client);
@@ -1545,6 +1564,7 @@ static void copy_callback(int read_err, unsigned long write_err, void *context) }list_add (&pe->out_of_order_entry, lh); } +up (&s->cow_count); }/*
@@ -1568,6 +1588,7 @@ static void start_copy(struct dm_snap_pending_exception *pe) dest.count = src.count;/* Hand over to kcopyd */ +down (&s->cow_count);dm_kcopyd_copy (s->kcopyd_client, &src,1 , &dest,0 , copy_callback, pe); }
@@ -1588,6 +1609,7 @@ static void start_full_bio(struct dm_snap_pending_exception *pe, pe->full_bio_end_io = bio->bi_end_io; pe->full_bio_private = bio->bi_private; +down (&s->cow_count); callback_data =dm_kcopyd_prepare_callback (s->kcopyd_client, copy_callback, pe);
drivers/media/firewire/firedtv-avc.c +4 -2
@@ -968,7 +968,8 @@ static int get_ca_object_length(struct avc_response_frame *r)return r->operand[7 ]; } -int avc_ca_app_info (struct firedtv *fdtv,char *app_info,unsigned int *len) +int avc_ca_app_info (struct firedtv *fdtv,unsigned char *app_info, +unsigned int *len) {struct avc_command_frame *c = (void *)fdtv->avc_data;struct avc_response_frame *r = (void *)fdtv->avc_data;
@@ -1009,7 +1010,8 @@ out:return ret; } -int avc_ca_info (struct firedtv *fdtv,char *app_info,unsigned int *len) +int avc_ca_info (struct firedtv *fdtv,unsigned char *app_info, +unsigned int *len) {struct avc_command_frame *c = (void *)fdtv->avc_data;struct avc_response_frame *r = (void *)fdtv->avc_data;
drivers/media/firewire/firedtv.h +4 -2
@@ -124,8 +124,10 @@ int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst, struct dvb_diseqc_master_cmd *diseqcmd);void avc_remote_ctrl_work (struct work_struct *work);int avc_register_remote_control (struct firedtv *fdtv); -int avc_ca_app_info (struct firedtv *fdtv,char *app_info,unsigned int *len); -int avc_ca_info (struct firedtv *fdtv,char *app_info,unsigned int *len); +int avc_ca_app_info (struct firedtv *fdtv,unsigned char *app_info, +unsigned int *len); +int avc_ca_info (struct firedtv *fdtv,unsigned char *app_info, +unsigned int *len);int avc_ca_reset (struct firedtv *fdtv);int avc_ca_pmt (struct firedtv *fdtv,char *app_info,int length);int avc_ca_get_time_date (struct firedtv *fdtv,int *interval);
drivers/media/platform/vivid/vivid-kthread-cap.c +4 -1
@@ -829,8 +829,11 @@ int vivid_start_generating_vid_cap(struct vivid_dev *dev, bool *pstreaming) "%s-vid-cap", dev->v4l2_dev.name);if (IS_ERR (dev->kthread_vid_cap)) { +int err =PTR_ERR (dev->kthread_vid_cap); + + dev->kthread_vid_cap =NULL ;v4l2_err (&dev->v4l2_dev,"kernel_thread() failed\n" ); -return PTR_ERR (dev->kthread_vid_cap); +return err; } *pstreaming = true;vivid_grab_controls (dev, true);
drivers/media/platform/vivid/vivid-kthread-out.c +4 -1
@@ -248,8 +248,11 @@ int vivid_start_generating_vid_out(struct vivid_dev *dev, bool *pstreaming) "%s-vid-out", dev->v4l2_dev.name);if (IS_ERR (dev->kthread_vid_out)) { +int err =PTR_ERR (dev->kthread_vid_out); + + dev->kthread_vid_out =NULL ;v4l2_err (&dev->v4l2_dev,"kernel_thread() failed\n" ); -return PTR_ERR (dev->kthread_vid_out); +return err; } *pstreaming = true;vivid_grab_controls (dev, true);
drivers/media/platform/vivid/vivid-vid-common.c +1 -1
@@ -33,7 +33,7 @@ const struct v4l2_dv_timings_cap vivid_dv_timings_cap = { .type = V4L2_DV_BT_656_1120, /* keep this initialization for compatibility with GCC < 4.4.6 */ .reserved = { 0 }, -V4L2_INIT_BT_TIMINGS (0 ,MAX_WIDTH ,0 ,MAX_HEIGHT ,25000000 ,600000000 , +V4L2_INIT_BT_TIMINGS (16 ,MAX_WIDTH ,16 ,MAX_HEIGHT ,25000000 ,600000000 ,V4L2_DV_BT_STD_CEA861 |V4L2_DV_BT_STD_DMT , V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_INTERLACED) };
drivers/media/usb/em28xx/em28xx-video.c +2 -2
@@ -931,6 +931,8 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)em28xx_videodbg ("%s\n" , __func__); + dev->v4l2->field_count =0 ; +/* Make sure streaming is not already in progress for this type of filehandle (e.g. video, vbi) */ rc =res_get (dev, vq->type);
@@ -1141,8 +1143,6 @@ static void em28xx_ctrl_notify(struct v4l2_ctrl *ctrl, void *priv) {struct em28xx *dev = priv; - dev->v4l2->field_count =0 ; -/* * In the case of non-AC97 volume controls, we still need * to do some setups at em28xx, in order to mute/unmute
drivers/media/v4l2-core/videobuf2-core.c +10 -4
@@ -2474,9 +2474,13 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)return -EINVAL ; } } + +mutex_lock (&q->mmap_lock); +if (vb2_fileio_is_active (q)) {dprintk (1 ,"mmap: file io in progress\n" ); -return -EBUSY ; + ret = -EBUSY ; + goto unlock; }/*
@@ -2484,7 +2488,7 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)*/ ret =__find_plane_by_offset (q, off, &buffer, &plane);if (ret) -return ret; + goto unlock; vb = q->bufs[buffer];
@@ -2497,11 +2501,13 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)if (length < (vma->vm_end - vma->vm_start)) {dprintk (1 ,"MMAP invalid, as it would overflow buffer length\n" ); -return -EINVAL ; + ret = -EINVAL ; + goto unlock; } -mutex_lock (&q->mmap_lock); ret =call_memop (vb, mmap, vb->planes[plane].mem_priv, vma); + +unlock:mutex_unlock (&q->mmap_lock);if (ret)return ret;
drivers/mfd/tps6586x.c +24 -0
@@ -601,6 +601,29 @@ static int tps6586x_i2c_remove(struct i2c_client *client)return 0 ; } +static int __maybe_unused tps6586x_i2c_suspend (struct device *dev) +{ +struct tps6586x *tps6586x =dev_get_drvdata (dev); + +if (tps6586x->client->irq) +disable_irq (tps6586x->client->irq); + +return 0 ; +} + +static int __maybe_unused tps6586x_i2c_resume (struct device *dev) +{ +struct tps6586x *tps6586x =dev_get_drvdata (dev); + +if (tps6586x->client->irq) +enable_irq (tps6586x->client->irq); + +return 0 ; +} + +static SIMPLE_DEV_PM_OPS(tps6586x_pm_ops, tps6586x_i2c_suspend, + tps6586x_i2c_resume); +static const struct i2c_device_id tps6586x_id_table[] = { {"tps6586x" ,0 }, { },
@@ -612,6 +635,7 @@ static struct i2c_driver tps6586x_driver = { .name = "tps6586x", .owner = THIS_MODULE, .of_match_table = of_match_ptr(tps6586x_of_match), + .pm = &tps6586x_pm_ops, }, .probe = tps6586x_i2c_probe, .remove = tps6586x_i2c_remove,
drivers/mmc/host/atmel-mci.c +2 -1
@@ -1838,13 +1838,14 @@ static void atmci_tasklet_func(unsigned long priv) }atmci_request_end (host, host->mrq); - state =STATE_IDLE ; + goto unlock;/* atmci_request_end() sets host->state */ break ; } }while (state != prev_state); host->state = state; +unlock:spin_unlock (&host->lock); }
drivers/net/ethernet/realtek/r8169.c +2 -0
@@ -324,6 +324,8 @@ enum cfg_version { };static const struct pci_device_id rtl8169_pci_tbl[] = { + {PCI_VDEVICE (REALTEK ,0x2502 ),RTL_CFG_1 }, + {PCI_VDEVICE (REALTEK ,0x2600 ),RTL_CFG_1 }, {PCI_DEVICE (PCI_VENDOR_ID_REALTEK ,0x8129 ),0 ,0 ,RTL_CFG_0 }, {PCI_DEVICE (PCI_VENDOR_ID_REALTEK ,0x8136 ),0 ,0 ,RTL_CFG_2 }, {PCI_DEVICE (PCI_VENDOR_ID_REALTEK ,0x8161 ),0 ,0 ,RTL_CFG_1 },
drivers/scsi/sd.c +6 -0
@@ -205,6 +205,12 @@ cache_type_store(struct device *dev, struct device_attribute *attr, buffer_data[2 ] |= wce <<2 | rcd; sp = buffer_data[0 ] &0x80 ?1 :0 ; +/* +* Ensure WP, DPOFUA, and RESERVED fields are cleared in +* received mode parameter buffer before doing MODE SELECT. +*/ + data.device_specific =0 ; +if (scsi_mode_select (sdp,1 , sp,8 , buffer_data, len,SD_TIMEOUT ,SD_MAX_RETRIES , &data, &sshdr)) {if (scsi_sense_valid (&sshdr))
drivers/target/target_core_spc.c +12 -5
@@ -112,12 +112,17 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf) buf[7 ] =0x2 ;/* CmdQue=1 */ -memcpy (&buf[8 ],"LIO-ORG " ,8 ); -memset (&buf[16 ],0x20 ,16 ); +/* +* ASCII data fields described as being left-aligned shall have any +* unused bytes at the end of the field (i.e., highest offset) and the +* unused bytes shall be filled with ASCII space characters (20h). +*/ +memset (&buf[8 ],0x20 ,8 +16 +4 ); +memcpy (&buf[8 ],"LIO-ORG" ,sizeof ("LIO-ORG" ) -1 );memcpy (&buf[16 ], dev->t10_wwn.model, -min_t (size_t,strlen (dev->t10_wwn.model),16 )); +strnlen (dev->t10_wwn.model,16 ));memcpy (&buf[32 ], dev->t10_wwn.revision, -min_t (size_t,strlen (dev->t10_wwn.revision),4 )); +strnlen (dev->t10_wwn.revision,4 )); buf[4 ] =31 ;/* Set additional length to 31 */ return 0 ;
@@ -257,7 +262,9 @@ check_t10_vend_desc: buf[off] =0x2 ;/* ASCII */ buf[off+1 ] =0x1 ;/* T10 Vendor ID */ buf[off+2 ] =0x0 ; -memcpy (&buf[off+4 ],"LIO-ORG" ,8 ); +/* left align Vendor ID and pad with spaces */ +memset (&buf[off+4 ],0x20 ,8 ); +memcpy (&buf[off+4 ],"LIO-ORG" ,sizeof ("LIO-ORG" ) -1 );/* Extra Byte for NULL Terminator */ id_len++;/* Identifier Length */
drivers/tty/tty_ldsem.c +10 -0
@@ -306,6 +306,16 @@ down_write_failed(struct ld_semaphore *sem, long count, long timeout)if (!locked)ldsem_atomic_update (-LDSEM_WAIT_BIAS , sem);list_del (&waiter.list); + +/* +* In case of timeout, wake up every reader who gave the right of way +* to writer. Prevent separation readers into two groups: +* one that helds semaphore and another that sleeps. +* (in case of no contention with a writer) +*/ +if (!locked &&list_empty (&sem->write_wait)) +__ldsem_wake_readers (sem); +raw_spin_unlock_irq (&sem->wait_lock);__set_task_state (tsk,TASK_RUNNING );
drivers/usb/class/cdc-acm.c +7 -0
@@ -1904,6 +1904,13 @@ static const struct usb_device_id acm_ids[] = { .driver_info = IGNORE_DEVICE, }, + { USB_DEVICE(0x1bc7, 0x0021), /* Telit 3G ACM only composition */ + .driver_info =SEND_ZERO_PACKET , + }, + { USB_DEVICE(0x1bc7, 0x0023), /* Telit 3G ACM + ECM composition */ + .driver_info = SEND_ZERO_PACKET, + }, + /* control interfaces without any protocol set */ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, USB_CDC_PROTO_NONE) },
drivers/usb/storage/scsiglue.c +6 -2
@@ -223,8 +223,12 @@ static int slave_configure(struct scsi_device *sdev)if (!(us->fflags &US_FL_NEEDS_CAP16 )) sdev->try_rc_10_first =1 ; -/* assume SPC3 or latter devices support sense size > 18 */ -if (sdev->scsi_level >SCSI_SPC_2 ) +/* +* assume SPC3 or latter devices support sense size > 18 +* unless US_FL_BAD_SENSE quirk is specified. +*/ +if (sdev->scsi_level >SCSI_SPC_2 && + !(us->fflags &US_FL_BAD_SENSE )) us->fflags |=US_FL_SANE_SENSE ;/* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable
drivers/usb/storage/unusual_devs.h +12 -0
@@ -1392,6 +1392,18 @@ UNUSUAL_DEV( 0x0d49, 0x7310, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_SANE_SENSE), +/* +* Reported by Icenowy Zheng <[email protected]> +* The SMI SM3350 USB-UFS bridge controller will enter a wrong state +* that do not process read/write command if a long sense is requested, +* so force to use 18-byte sense. +*/ +UNUSUAL_DEV (0x090c ,0x3350 ,0x0000 ,0xffff , +"SMI" , +"SM3350 UFS-to-USB-Mass-Storage bridge" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , + US_FL_BAD_SENSE ), +/* * Pete Zaitcev <[email protected]>, bz#164688. * The device blatantly ignores LUN and returns 1 in GetMaxLUN.
drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +2 -0
@@ -606,6 +606,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)int r =0 ; +memset (&p,0 ,sizeof (p)); +switch (cmd) {case OMAPFB_SYNC_GFX :DBG ("ioctl SYNC_GFX\n" );
fs/btrfs/disk-io.c +8 -0
@@ -3942,6 +3942,14 @@ static void btrfs_destroy_all_ordered_extents(struct btrfs_fs_info *fs_info)spin_lock (&fs_info->ordered_root_lock); }spin_unlock (&fs_info->ordered_root_lock); + +/* +* We need this here because if we've been flipped read-only we won't +* get sync() from the umount, so we need to make sure any ordered +* extents that haven't had their dirty pages IO start writeout yet +* actually get run and error out properly. +*/ +btrfs_wait_ordered_roots (fs_info,-1 ); } static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
fs/cifs/file.c +4 -4
@@ -1067,10 +1067,10 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)/* * Accessing maxBuf is racy with cifs_reconnect - need to store value -* and check it for zero before using. +* and check it before using. */ max_buf = tcon->ses->server->maxBuf; -if (!max_buf) { +if (max_buf < (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE ))) {free_xid (xid);return -EINVAL ; }
@@ -1404,10 +1404,10 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,/* * Accessing maxBuf is racy with cifs_reconnect - need to store value -* and check it for zero before using. +* and check it before using. */ max_buf = tcon->ses->server->maxBuf; -if (!max_buf) +if (max_buf < (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE )))return -EINVAL ; max_num = (max_buf - sizeof(struct smb_hdr)) /
fs/cifs/smb2file.c +2 -2
@@ -104,10 +104,10 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,/* * Accessing maxBuf is racy with cifs_reconnect - need to store value -* and check it for zero before using. +* and check it before using. */ max_buf = tcon->ses->server->maxBuf; -if (!max_buf) +if (max_buf <sizeof (struct smb2_lock_element ))return -EINVAL ; max_num = max_buf /sizeof (struct smb2_lock_element );
fs/cifs/transport.c +1 -1
@@ -360,7 +360,7 @@ uncork:if (rc <0 && rc != -EINTR )cifs_dbg (VFS ,"Error %d sending data on socket to server\n" , rc); -else +else if (rc >0 ) rc =0 ;return rc;
fs/jffs2/super.c +2 -1
@@ -101,7 +101,8 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)struct jffs2_sb_info *c =JFFS2_SB_INFO (sb);#ifdef CONFIG_JFFS2_FS_WRITEBUFFER -cancel_delayed_work_sync (&c->wbuf_dwork); +if (jffs2_is_writebuffered (c)) +cancel_delayed_work_sync (&c->wbuf_dwork);#endif mutex_lock (&c->alloc_sem);
fs/ocfs2/localalloc.c +7 -2
@@ -345,13 +345,18 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)if (num_used || alloc->id1.bitmap1.i_used || alloc->id1.bitmap1.i_total - || la->la_bm_off) -mlog (ML_ERROR ,"Local alloc hasn't been recovered!\n" + || la->la_bm_off) { +mlog (ML_ERROR ,"inconsistent detected, clean journal with" +" unrecovered local alloc, please run fsck.ocfs2!\n" "found = %u, set = %u, taken = %u, off = %u\n" , num_used,le32_to_cpu (alloc->id1.bitmap1.i_used),le32_to_cpu (alloc->id1.bitmap1.i_total),OCFS2_LOCAL_ALLOC (alloc)->la_bm_off); + status = -EINVAL ; + goto bail; + } + osb->local_alloc_bh = alloc_bh; osb->local_alloc_state =OCFS2_LA_ENABLED ;
fs/pstore/ram_core.c +5 -0
@@ -484,6 +484,11 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig, sig ^=PERSISTENT_RAM_SIG ;if (prz->buffer->sig == sig) { +if (buffer_size (prz) ==0 ) { +pr_debug ("found existing empty buffer\n" ); +return 0 ; + } +if (buffer_size (prz) > prz->buffer_size ||buffer_start (prz) >buffer_size (prz)) pr_info("found existing invalid buffer, size %zu, start %zu\n",
include/linux/sunrpc/svc.h +4 -1
@@ -281,9 +281,12 @@ struct svc_rqst {* to prevent encrypting page * cache pages */ struct task_struct *rq_task;/* service thread */ +struct net *rq_bc_net;/* pointer to backchannel's +* net namespace +*/ }; -#define SVC_NET (svc_rqst) (svc_rqst->rq_xprt->xpt_net) +#define SVC_NET (rqst) (rqst->rq_xprt ? rqst->rq_xprt->xpt_net : rqst->rq_bc_net)/* * Rigorous type checking on sockaddr type conversions
mm/slab.c +4 -2
@@ -869,8 +869,10 @@ static struct alien_cache *__alloc_alien_cache(int node, int entries,struct alien_cache *alc =NULL ; alc =kmalloc_node (memsize, gfp, node); -init_arraycache (&alc->ac, entries, batch); -spin_lock_init (&alc->lock); +if (alc) { +init_arraycache (&alc->ac, entries, batch); +spin_lock_init (&alc->lock); + }return alc; }
net/bridge/br_netfilter.c +1 -1
@@ -287,7 +287,7 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)if (neigh) {int ret; -if (neigh->hh.hh_len) { +if ((neigh->nud_state &NUD_CONNECTED ) && neigh->hh.hh_len) {neigh_hh_bridge (&neigh->hh, skb); skb->dev = nf_bridge->physindev; ret =br_handle_frame_finish (skb);
net/can/gw.c +27 -3
@@ -417,13 +417,29 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)while (modidx <MAX_MODFUNCTIONS && gwj->mod.modfunc[modidx]) (*gwj->mod.modfunc[modidx++])(cf, &gwj->mod); -/* check for checksum updates when the CAN frame has been modified */ +/* Has the CAN frame been modified? */ if (modidx) { -if (gwj->mod.csumfunc.crc8) +/* get available space for the processed CAN frame type */ +int max_len = nskb->len - offsetof(struct can_frame , data); + +/* dlc may have changed, make sure it fits to the CAN frame */ +if (cf->can_dlc > max_len) + goto out_delete; + +/* check for checksum updates in classic CAN length only */ +if (gwj->mod.csumfunc.crc8) { +if (cf->can_dlc >8 ) + goto out_delete; + (*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8); + } + +if (gwj->mod.csumfunc.xor) { +if (cf->can_dlc >8 ) + goto out_delete; -if (gwj->mod.csumfunc.xor) (*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor); + } }/* clear the skb timestamp if not configured the other way */
@@ -435,6 +451,14 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data) gwj->dropped_frames++; else gwj->handled_frames++; + +return ; + + out_delete: +/* delete frame due to misconfiguration */ + gwj->deleted_frames++; +kfree_skb (nskb); +return ; }static inline int cgw_register_filter (struct cgw_job *gwj)
net/core/sock.c +1 -0
@@ -720,6 +720,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,break ;case SO_DONTROUTE :sock_valbool_flag (sk,SOCK_LOCALROUTE , valbool); +sk_dst_reset (sk);break ;case SO_BROADCAST :sock_valbool_flag (sk,SOCK_BROADCAST , valbool);
net/ipv6/datagram.c +1 -0
@@ -287,6 +287,7 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info)skb_reset_network_header (skb); iph =ipv6_hdr (skb); iph->daddr = fl6->daddr; +ip6_flow_hdr (iph,0 ,0 ); serr =SKB_EXT_ERR (skb); serr->ee.ee_errno = err;
net/packet/af_packet.c +2 -2
@@ -2276,7 +2276,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) addr = saddr->sll_halen ? saddr->sll_addr :NULL ; dev =dev_get_by_index (sock_net (&po->sk), saddr->sll_ifindex);if (addr && dev && saddr->sll_halen < dev->addr_len) - goto out; + goto out_put; } err = -ENXIO ;
@@ -2439,7 +2439,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) addr = saddr->sll_halen ? saddr->sll_addr :NULL ; dev =dev_get_by_index (sock_net (sk), saddr->sll_ifindex);if (addr && dev && saddr->sll_halen < dev->addr_len) - goto out; + goto out_unlock; } err = -ENXIO ;
net/sctp/ipv6.c +1 -4
@@ -97,11 +97,9 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,switch (ev) {case NETDEV_UP : - addr =kmalloc (sizeof (struct sctp_sockaddr_entry ),GFP_ATOMIC ); + addr =kzalloc (sizeof (*addr),GFP_ATOMIC );if (addr) { addr->a.v6.sin6_family =AF_INET6 ; - addr->a.v6.sin6_port =0 ; - addr->a.v6.sin6_flowinfo =0 ; addr->a.v6.sin6_addr = ifa->addr; addr->a.v6.sin6_scope_id = ifa->idev->dev->ifindex; addr->valid =1 ;
@@ -411,7 +409,6 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist, addr =kzalloc (sizeof (*addr),GFP_ATOMIC );if (addr) { addr->a.v6.sin6_family =AF_INET6 ; - addr->a.v6.sin6_port =0 ; addr->a.v6.sin6_addr = ifp->addr; addr->a.v6.sin6_scope_id = dev->ifindex; addr->valid =1 ;
net/sctp/protocol.c +1 -3
@@ -149,7 +149,6 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist, addr =kzalloc (sizeof (*addr),GFP_ATOMIC );if (addr) { addr->a.v4.sin_family =AF_INET ; - addr->a.v4.sin_port =0 ; addr->a.v4.sin_addr.s_addr = ifa->ifa_local; addr->valid =1 ;INIT_LIST_HEAD (&addr->list);
@@ -755,10 +754,9 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,switch (ev) {case NETDEV_UP : - addr =kmalloc (sizeof (struct sctp_sockaddr_entry ),GFP_ATOMIC ); + addr =kzalloc (sizeof (*addr),GFP_ATOMIC );if (addr) { addr->a.v4.sin_family =AF_INET ; - addr->a.v4.sin_port =0 ; addr->a.v4.sin_addr.s_addr = ifa->ifa_local; addr->valid =1 ;spin_lock_bh (&net->sctp.local_addr_lock);
net/sunrpc/rpcb_clnt.c +8 -0
@@ -772,6 +772,12 @@ void rpcb_getport_async(struct rpc_task *task)case RPCBVERS_3 : map->r_netid = xprt->address_strings[RPC_DISPLAY_NETID ]; map->r_addr =rpc_sockaddr2uaddr (sap,GFP_ATOMIC ); +if (!map->r_addr) { + status = -ENOMEM ; +dprintk ("RPC: %5u %s: no memory available\n" , + task->tk_pid, __func__); + goto bailout_free_args; + } map->r_owner ="" ;break ;case RPCBVERS_2 :
@@ -794,6 +800,8 @@ void rpcb_getport_async(struct rpc_task *task)rpc_put_task (child);return ; +bailout_free_args: +kfree (map); bailout_release_client:rpc_release_client (rpcb_clnt); bailout_nofree:
net/sunrpc/svc.c +7 -3
@@ -1061,6 +1061,8 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) static __printf(2,3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) {}#endif +extern void svc_tcp_prep_reply_hdr (struct svc_rqst *); +/* * Common routine for processing the RPC request. */
@@ -1090,7 +1092,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) rqstp->rq_dropme = false;/* Setup reply header */ - rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr (rqstp); +if (rqstp->rq_prot ==IPPROTO_TCP ) +svc_tcp_prep_reply_hdr (rqstp);svc_putu32 (resv, rqstp->rq_xid);
@@ -1137,7 +1140,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)case SVC_DENIED : goto err_bad_auth;case SVC_CLOSE : -if (test_bit (XPT_TEMP , &rqstp->rq_xprt->xpt_flags)) +if (rqstp->rq_xprt && +test_bit (XPT_TEMP , &rqstp->rq_xprt->xpt_flags))svc_close_xprt (rqstp->rq_xprt);case SVC_DROP : goto dropit;
@@ -1347,10 +1351,10 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,struct kvec *resv = &rqstp->rq_res.head[0 ];/* Build the svc_rqst used by the common processing routine */ - rqstp->rq_xprt = serv->sv_bc_xprt; rqstp->rq_xid = req->rq_xid; rqstp->rq_prot = req->rq_xprt->prot; rqstp->rq_server = serv; + rqstp->rq_bc_net = req->rq_xprt->xprt_net; rqstp->rq_addrlen =sizeof (req->rq_xprt->addr);memcpy (&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen);
net/sunrpc/svc_xprt.c +3 -2
@@ -438,10 +438,11 @@ static struct svc_xprt *svc_xprt_dequeue(struct svc_pool *pool)*/ void svc_reserve (struct svc_rqst *rqstp,int space) { +struct svc_xprt *xprt = rqstp->rq_xprt; + space += rqstp->rq_res.head[0 ].iov_len; -if (space < rqstp->rq_reserved) { -struct svc_xprt *xprt = rqstp->rq_xprt; +if (xprt && space < rqstp->rq_reserved) {atomic_sub ((rqstp->rq_reserved - space), &xprt->xpt_reserved); rqstp->rq_reserved = space;
net/sunrpc/svcsock.c +1 -1
@@ -1212,7 +1212,7 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp)/* * Setup response header. TCP has a 4B record length field. */ -static void svc_tcp_prep_reply_hdr (struct svc_rqst *rqstp) +void svc_tcp_prep_reply_hdr (struct svc_rqst *rqstp) {struct kvec *resv = &rqstp->rq_res.head[0 ];
scripts/kconfig/zconf.l +2 -0
@@ -180,6 +180,8 @@ n [A-Za-z0-9_] } <<EOF>> { BEGIN(INITIAL); + yylval.string = text; + return T_WORD_QUOTE; } }
security/selinux/ss/policydb.c +2 -1
@@ -717,7 +717,8 @@ static int sens_destroy(void *key, void *datum, void *p)kfree (key);if (datum) { levdatum = datum; -ebitmap_destroy (&levdatum->level->cat); +if (levdatum->level) +ebitmap_destroy (&levdatum->level->cat);kfree (levdatum->level); }kfree (datum);
security/yama/yama_lsm.c +3 -1
@@ -299,7 +299,9 @@ int yama_ptrace_access_check(struct task_struct *child,break ;case YAMA_SCOPE_RELATIONAL :rcu_read_lock (); -if (!task_is_descendant (current, child) && +if (!pid_alive (child)) + rc = -EPERM ; +if (!rc && !task_is_descendant (current, child) && !ptracer_exception_found (current, child) && !ns_capable (__task_cred (child)->user_ns,CAP_SYS_PTRACE )) rc = -EPERM ;
sound/firewire/bebob/bebob.c +1 -1
@@ -356,7 +356,7 @@ static const struct ieee1394_device_id bebob_id_table[] = {/* Apogee Electronics, DA/AD/DD-16X (X-FireWire card) */ SND_BEBOB_DEV_ENTRY (VEN_APOGEE ,0x00010048 , &spec_normal),/* Apogee Electronics, Ensemble */ -SND_BEBOB_DEV_ENTRY (VEN_APOGEE ,0x00001eee , &spec_normal), +SND_BEBOB_DEV_ENTRY (VEN_APOGEE ,0x01eeee , &spec_normal),/* ESI, Quatafire610 */ SND_BEBOB_DEV_ENTRY(VEN_ESI, 0x00010064, &spec_normal),/* AcousticReality, eARMasterOne */
tools/perf/util/parse-events.c +1 -1
@@ -1319,7 +1319,7 @@ static void print_symbol_events(const char *event_glob, unsigned type,if (strlen (syms->alias))snprintf (name,MAX_NAME_LEN ,"%s OR %s" , syms->symbol, syms->alias);else -strncpy (name, syms->symbol,MAX_NAME_LEN ); +strlcpy (name, syms->symbol,MAX_NAME_LEN );printf (" %-50s [%s]\n" , name, event_type_descriptors[type]);
tools/perf/util/svghelper.c +1 -1
@@ -333,7 +333,7 @@ static char *cpu_model(void)if (file) {while (fgets (buf,255 , file)) {if (strstr (buf,"model name" )) { -strncpy (cpu_m, &buf[13 ],255 ); +strlcpy (cpu_m, &buf[13 ],255 );break ; } }