Linux 3.18.95
Greg KH
maintainerI'm announcing the release of the 3.18.95 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
------------
Makefile | 2 arch/alpha/kernel/pci_impl.h | 3 arch/alpha/kernel/process.c | 3 arch/arm/configs/exynos_defconfig | 7 + arch/mn10300/mm/misalignment.c | 2 arch/openrisc/kernel/traps.c | 10 - arch/sh/kernel/traps_32.c | 3 arch/xtensa/include/asm/futex.h | 23 +--- crypto/ahash.c | 11 ++ crypto/cryptd.c | 3 drivers/acpi/sbshc.c | 4 drivers/block/pktcdvd.c | 4 drivers/crypto/caam/ctrl.c | 8 + drivers/edac/octeon_edac-lmc.c | 1 drivers/media/usb/dvb-usb-v2/lmedm04.c | 39 ++++--- drivers/media/usb/dvb-usb/cxusb.c | 2 drivers/media/usb/dvb-usb/dib0700_devices.c | 1 drivers/mtd/nand/nand_base.c | 5 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 18 +-- drivers/net/ethernet/realtek/r8169.c | 4 drivers/usb/usbip/stub_dev.c | 3 drivers/usb/usbip/stub_main.c | 5 drivers/usb/usbip/stub_rx.c | 53 +++++++--- drivers/usb/usbip/stub_tx.c | 4 drivers/usb/usbip/usbip_common.c | 15 -- drivers/usb/usbip/usbip_common.h | 1 drivers/usb/usbip/usbip_event.c | 5 drivers/usb/usbip/vhci_hcd.c | 102 ++++++++++---------- drivers/usb/usbip/vhci_rx.c | 53 +++++----- drivers/usb/usbip/vhci_sysfs.c | 45 +++++--- drivers/usb/usbip/vhci_tx.c | 17 +-- drivers/vhost/net.c | 1 fs/cifs/cifsencrypt.c | 3 fs/cifs/connect.c | 6 - fs/cifs/file.c | 26 ++--- fs/cifs/misc.c | 14 -- fs/cifs/smb2pdu.c | 3 fs/kernfs/file.c | 2 fs/nfs/direct.c | 4 fs/nfs/write.c | 2 include/crypto/internal/hash.h | 2 include/net/arp.h | 6 - kernel/async.c | 20 ++- kernel/time/posix-timers.c | 34 +++--- net/dccp/proto.c | 5 net/ipv4/igmp.c | 4 net/ipv4/tcp.c | 6 + net/ipv6/ip6mr.c | 1 security/keys/encrypted-keys/encrypted.c | 31 ++---- tools/usb/usbip/libsrc/usbip_common.c | 9 + tools/usb/usbip/libsrc/usbip_host_driver.c | 27 ++++- tools/usb/usbip/libsrc/vhci_driver.c | 8 - 52 files changed, 393 insertions(+), 277 deletions(-)
Andrew Goodbody (1):
usb: usbip: Fix possible deadlocks reported by lockdep
Aurelien Aptel (1):
CIFS: zero sensitive data when freeing
Bart Van Assche (1):
pktcdvd: Fix pkt_setup_dev() error path
Chunhao Lin (1):
r8169: fix RTL8168EP take too long to complete driver initialization.
Daniel N Pettersson (1):
cifs: Fix autonegotiate security settings mismatch
Eric Biggers (3):
KEYS: encrypted: fix buffer overread in valid_master_desc()
crypto: hash - introduce crypto_hash_alg_has_setkey()
crypto: cryptd - pass through absence of ->setkey()
Eric Dumazet (1):
net: igmp: add a missing rcu locking section
Eric W. Biederman (3):
signal/openrisc: Fix do_unaligned_access to send the proper signal signal/sh: Ensure si_signo is initialized in do_divide_error mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy
Greg Kroah-Hartman (2):
ACPI: sbshc: remove raw pointer from printk() message Linux 3.18.95
Horia Geantă (1):
crypto: caam - fix endless loop when DECO acquire fails
Ivan Vecera (1):
kernfs: fix regression in kernfs_fop_write caused by wrong type
J. Bruce Fields (1):
NFS: commit direct writes even if they fail partially
James Hogan (1):
EDAC, octeon: Fix an uninitialized variable warning
Jason Wang (1):
vhost_net: stop device during reset owner
Javier Martinez Canillas (1):
ARM: exynos_defconfig: Enable options to mount a rootfs via NFS
Jonathan Dieter (1):
usbip: Fix potential format overflow in userspace tools
Junxiao Bi (1):
qlcnic: fix deadlock bug
Krzysztof Kozlowski (1):
ARM: exynos_defconfig: Enable NFSv4 client
Li RongQing (1):
tcp: release sk_frag.page in tcp_disconnect
Malcolm Priestley (2):
media: dvb-usb-v2: lmedm04: Improve logic checking of warm start
media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner
Matthew Wilcox (1):
cifs: Fix missing put_xid in cifs_file_strict_mmap
Mauro Carvalho Chehab (1):
media: cxusb, dib0700: ignore XC2028_I2C_FLUSH
Max Filippov (1):
xtensa: fix futex_atomic_cmpxchg_inatomic
Mikulas Patocka (2):
alpha: fix crash if pthread_create races with signal delivery
alpha: fix reboot on Avanti platform
Miquel Raynal (1):
mtd: nand: Fix nand_do_read_oob() return value
Mohamed Ghannam (1):
dccp: CVE-2017-8824: use-after-free in DCCP code
Nikolay Aleksandrov (1):
ip6mr: fix stale iterator
Rasmus Villemoes (1):
kernel/async.c: revert "async: simplify lowest_in_progress()"
Shuah Khan (6):
usbip: fix stub_rx: get_pipe() to validate endpoint number
usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input
usbip: prevent vhci_hcd driver from leaking a socket pointer address
usbip: prevent leaking socket pointer address in messages
usbip: stub: stop printing kernel pointer addresses in messages
usbip: vhci: stop printing kernel pointer addresses in messages
Thomas Gleixner (1):
posix-timer: Properly check sigevent->sigev_notify
Trond Myklebust (1):
NFS: Add a cond_resched() to nfs_commit_release_pages()
Wang Han (1):
ipv4: Map neigh lookup keys in __ipv4_neigh_lookup_noref()
Yuyang Du (1):
usbip: vhci-hcd: Add USB3 SuperSpeed support
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 94 +SUBLEVEL = 95 EXTRAVERSION = NAME = Diseased Newt
arch/alpha/kernel/pci_impl.h +2 -1
@@ -143,7 +143,8 @@ struct pci_iommu_arena };#if defined(CONFIG_ALPHA_SRM ) && \ - (defined(CONFIG_ALPHA_CIA ) || defined(CONFIG_ALPHA_LCA )) + (defined(CONFIG_ALPHA_CIA ) || defined(CONFIG_ALPHA_LCA ) || \ + defined(CONFIG_ALPHA_AVANTI ))# define NEED_SRM_SAVE_RESTORE #else # undef NEED_SRM_SAVE_RESTORE
arch/alpha/kernel/process.c +2 -1
@@ -274,12 +274,13 @@ copy_thread(unsigned long clone_flags, unsigned long usp,application calling fork. */ if (clone_flags &CLONE_SETTLS ) childti->pcb.unique = regs->r20; +else + regs->r20 =0 ;/* OSF/1 has some strange fork() semantics. */ childti->pcb.usp = usp ?:rdusp (); *childregs = *regs; childregs->r0 =0 ; childregs->r19 =0 ; childregs->r20 =1 ;/* OSF/1 has some strange fork() semantics. */ - regs->r20 =0 ; stack = ((struct switch_stack *) regs) -1 ; *childstack = *stack; childstack->r26 = (unsigned long ) ret_from_fork;
arch/arm/configs/exynos_defconfig +7 -0
@@ -33,6 +33,10 @@ CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y CONFIG_RFKILL_REGULATOR=y CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y
@@ -170,6 +174,9 @@ CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_CRAMFS=y CONFIG_ROMFS_FS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V4=y +CONFIG_ROOT_NFS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y
arch/mn10300/mm/misalignment.c +1 -1
@@ -437,7 +437,7 @@ transfer_failed: info.si_signo =SIGSEGV ; info.si_errno =0 ; - info.si_code =0 ; + info.si_code =SEGV_MAPERR ; info.si_addr = (void *) regs->pc;force_sig_info (SIGSEGV , &info, current);return ;
arch/openrisc/kernel/traps.c +5 -5
@@ -302,12 +302,12 @@ asmlinkage void do_unaligned_access(struct pt_regs *regs, unsigned long address)siginfo_t info;if (user_mode (regs)) { -/* Send a SIGSEGV */ - info.si_signo =SIGSEGV ; +/* Send a SIGBUS */ + info.si_signo =SIGBUS ; info.si_errno =0 ; -/* info.si_code has been set above */ - info.si_addr = (void *)address; -force_sig_info (SIGSEGV , &info, current); + info.si_code =BUS_ADRALN ; + info.si_addr = (void __user *)address; +force_sig_info (SIGBUS , &info, current); }else {printk ("KERNEL: Unaligned Access 0x%.8lx\n" , address);show_registers (regs);
arch/sh/kernel/traps_32.c +2 -1
@@ -607,7 +607,8 @@ asmlinkage void do_divide_error(unsigned long r4) break; } -force_sig_info (SIGFPE , &info, current); + info.si_signo =SIGFPE ; +force_sig_info (info.si_signo, &info, current); }#endif
arch/xtensa/include/asm/futex.h +10 -13
@@ -109,7 +109,6 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newval) { int ret = 0; -u32 prev;if (!access_ok (VERIFY_WRITE , uaddr,sizeof (u32)))return -EFAULT ;
@@ -120,26 +119,24 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, __asm__ __volatile__ (" # futex_atomic_cmpxchg_inatomic\n" -"1: l32i %1, %3, 0\n" -" mov %0, %5\n" -" wsr %1, scompare1\n" -"2: s32c1i %0, %3, 0\n" -"3:\n" +" wsr %5, scompare1\n" +"1: s32c1i %1, %4, 0\n" +" s32i %1, %6, 0\n" +"2:\n" " .section .fixup,\"ax\"\n" " .align 4\n" -"4: .long 3b\n" -"5: l32r %1, 4b\n" -" movi %0, %6\n" +"3: .long 2b\n" +"4: l32r %1, 3b\n" +" movi %0, %7\n" " jx %1\n" " .previous\n" " .section __ex_table,\"a\"\n" -" .long 1b,5b,2b,5b\n" +" .long 1b,4b\n" " .previous\n" - :"+r" (ret),"=&r" (prev),"+m" (*uaddr) - :"r" (uaddr),"r" (oldval),"r" (newval),"I" (-EFAULT ) + :"+r" (ret),"+r" (newval),"+m" (*uaddr),"+m" (*uval) + :"r" (uaddr),"r" (oldval),"r" (uval),"I" (-EFAULT ) :"memory" ); - *uval = prev;return ret; }
crypto/ahash.c +11 -0
@@ -636,5 +636,16 @@ struct hash_alg_common *ahash_attr_alg(struct rtattr *rta, u32 type, u32 mask) }EXPORT_SYMBOL_GPL (ahash_attr_alg); +bool crypto_hash_alg_has_setkey (struct hash_alg_common *halg) +{ +struct crypto_alg *alg = &halg->base; + +if (alg->cra_type != &crypto_ahash_type) +return crypto_shash_alg_has_setkey (__crypto_shash_alg (alg)); + +return __crypto_ahash_alg (alg)->setkey !=NULL ; +} +EXPORT_SYMBOL_GPL (crypto_hash_alg_has_setkey); +MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Asynchronous cryptographic hash type" );
crypto/cryptd.c +2 -1
@@ -618,7 +618,8 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, inst->alg.finup = cryptd_hash_finup_enqueue; inst->alg.export = cryptd_hash_export; inst->alg.import = cryptd_hash_import; - inst->alg.setkey = cryptd_hash_setkey; +if (crypto_shash_alg_has_setkey (salg)) + inst->alg.setkey = cryptd_hash_setkey; inst->alg.digest = cryptd_hash_digest_enqueue; err =ahash_register_instance (tmpl, inst);
drivers/acpi/sbshc.c +2 -2
@@ -309,8 +309,8 @@ static int acpi_smbus_hc_add(struct acpi_device *device) device->driver_data = hc;acpi_ec_add_query_handler (hc->ec, hc->query_bit,NULL , smbus_alarm, hc); - printk(KERN_INFO PREFIX "SBS HC: EC = 0x%p, offset = 0x%0x, query_bit = 0x%0x\n", - hc->ec, hc->offset, hc->query_bit); +dev_info (&device->dev,"SBS HC: offset = 0x%0x, query_bit = 0x%0x\n" , + hc->offset, hc->query_bit);return 0 ; }
drivers/block/pktcdvd.c +1 -3
@@ -2798,7 +2798,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) pd->pkt_dev =MKDEV (pktdev_major, idx); ret =pkt_new_dev (pd, dev);if (ret) - goto out_new_dev; + goto out_mem2;/* inherit events of the host device */ disk->events = pd->bdev->bd_disk->events;
@@ -2816,8 +2816,6 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)mutex_unlock (&ctl_mutex);return 0 ; -out_new_dev: -blk_cleanup_queue (disk->queue); out_mem2:put_disk (disk); out_mem:
drivers/crypto/caam/ctrl.c +6 -2
@@ -209,12 +209,16 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask,* without any error (HW optimizations for later * CAAM eras), then try again. */ +if (ret) +break ; + rdsta_val =rd_reg32 (&ctrl->r4tst[0 ].rdsta) &RDSTA_IFMASK ; -if (status || !(rdsta_val & (1 << sh_idx))) +if (status || !(rdsta_val & (1 << sh_idx))) { ret = -EAGAIN ; -if (ret)break ; + } +dev_info (ctrldev,"Instantiated RNG4 SH%d\n" , sh_idx);/* Clear the contents before recreating the descriptor */ memset (desc,0x00 ,CAAM_CMD_SZ *7 );
drivers/edac/octeon_edac-lmc.c +1 -0
@@ -79,6 +79,7 @@ static void octeon_lmc_edac_poll_o2(struct mem_ctl_info *mci)if (!pvt->inject) int_reg.u64 =cvmx_read_csr (CVMX_LMCX_INT (mci->mc_idx));else { + int_reg.u64 =0 ;if (pvt->error_type ==1 ) int_reg.s.sec_err =1 ;if (pvt->error_type ==2 )
drivers/media/usb/dvb-usb-v2/lmedm04.c +24 -15
@@ -438,18 +438,23 @@ static int lme2510_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid,static int lme2510_return_status (struct dvb_usb_device *d) { -int ret =0 ; +int ret;u8 *data; - data =kzalloc (10 ,GFP_KERNEL ); + data =kzalloc (6 ,GFP_KERNEL );if (!data)return -ENOMEM ; - ret |=usb_control_msg (d->udev,usb_rcvctrlpipe (d->udev,0 ), -0x06 ,0x80 ,0x0302 ,0x00 , data,0x0006 ,200 ); -info ("Firmware Status: %x (%x)" , ret , data[2 ]); + ret =usb_control_msg (d->udev,usb_rcvctrlpipe (d->udev,0 ), +0x06 ,0x80 ,0x0302 ,0x00 , + data,0x6 ,200 ); +if (ret !=6 ) + ret = -EINVAL ; +else + ret = data[2 ]; + +info ("Firmware Status: %6ph" , data); - ret = (ret <0 ) ? -ENODEV : data[2 ];kfree (data);return ret; }
@@ -1113,8 +1118,6 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)if (adap->fe[0 ]) {info ("FE Found M88RS2000" ); -dvb_attach (ts2020_attach, adap->fe[0 ], &ts2020_config, - &d->i2c_adap); st->i2c_tuner_gate_w =5 ; st->i2c_tuner_gate_r =5 ; st->i2c_tuner_addr =0x60 ;
@@ -1177,17 +1180,18 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap) ret = st->tuner_config;break ;case TUNER_RS2000 : - ret = st->tuner_config; +if (dvb_attach (ts2020_attach, adap->fe[0 ], + &ts2020_config, &d->i2c_adap)) + ret = st->tuner_config;break ;default :break ; } -if (ret) +if (ret) {info ("TUN Found %s tuner" , tun_msg[ret]); -else { -info ("TUN No tuner found --- resetting device" ); -lme_coldreset (d); + }else { +info ("TUN No tuner found" );return -ENODEV ; }
@@ -1231,6 +1235,7 @@ static int lme2510_get_adapter_count(struct dvb_usb_device *d)static int lme2510_identify_state (struct dvb_usb_device *d,const char **name) {struct lme2510_state *st = d->priv; +int status;usb_reset_configuration (d->udev);
@@ -1239,12 +1244,16 @@ static int lme2510_identify_state(struct dvb_usb_device *d, const char **name) st->dvb_usb_lme2510_firmware = dvb_usb_lme2510_firmware; -if (lme2510_return_status (d) ==0x44 ) { + status =lme2510_return_status (d); +if (status ==0x44 ) { *name =lme_firmware_switch (d,0 );return COLD ; } -return 0 ; +if (status !=0x47 ) +return -EINVAL ; + +return WARM ; } static int lme2510_get_stream_config(struct dvb_frontend *fe, u8 *ts_type,
drivers/media/usb/dvb-usb/cxusb.c +2 -0
@@ -923,6 +923,8 @@ static int dvico_bluebird_xc2028_callback(void *ptr, int component,case XC2028_RESET_CLK :deb_info ("%s: XC2028_RESET_CLK %d\n" , __func__, arg);break ; +case XC2028_I2C_FLUSH : +break ;default :deb_info ("%s: unknown command %d, arg %d\n" , __func__, command, arg);
drivers/media/usb/dvb-usb/dib0700_devices.c +1 -0
@@ -431,6 +431,7 @@ static int stk7700ph_xc3028_callback(void *ptr, int component, state->dib7000p_ops.set_gpio (adap->fe_adap[0 ].fe,8 ,0 ,1 );break ;case XC2028_RESET_CLK : +case XC2028_I2C_FLUSH :break ;default : err("%s: unknown command %d, arg %d\n", __func__,
drivers/mtd/nand/nand_base.c +4 -1
@@ -1872,6 +1872,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd,static int nand_do_read_oob (struct mtd_info *mtd,loff_t from,struct mtd_oob_ops *ops) { +unsigned int max_bitflips =0 ;int page, realpage, chipnr;struct nand_chip *chip = mtd->priv;struct mtd_ecc_stats stats;
@@ -1932,6 +1933,8 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,nand_wait_ready (mtd); } + max_bitflips = max_t(unsigned int, max_bitflips, ret); + readlen -= len;if (!readlen)break ;
@@ -1957,7 +1960,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,if (mtd->ecc_stats.failed - stats.failed)return -EBADMSG ; -return mtd->ecc_stats.corrected - stats.corrected ? -EUCLEAN :0 ; +return max_bitflips; }/**
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +9 -9
@@ -3825,7 +3825,7 @@ static void qlcnic_83xx_flush_mbx_queue(struct qlcnic_adapter *adapter)struct list_head *head = &mbx->cmd_q;struct qlcnic_cmd_args *cmd =NULL ; -spin_lock (&mbx->queue_lock); +spin_lock_bh (&mbx->queue_lock);while (!list_empty (head)) { cmd = list_entry(head->next, struct qlcnic_cmd_args, list);
@@ -3836,7 +3836,7 @@ static void qlcnic_83xx_flush_mbx_queue(struct qlcnic_adapter *adapter)qlcnic_83xx_notify_cmd_completion (adapter, cmd); } -spin_unlock (&mbx->queue_lock); +spin_unlock_bh (&mbx->queue_lock); }static int qlcnic_83xx_check_mbx_status (struct qlcnic_adapter *adapter)
@@ -3872,12 +3872,12 @@ static void qlcnic_83xx_dequeue_mbx_cmd(struct qlcnic_adapter *adapter, {struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; -spin_lock (&mbx->queue_lock); +spin_lock_bh (&mbx->queue_lock);list_del (&cmd->list); mbx->num_cmds--; -spin_unlock (&mbx->queue_lock); +spin_unlock_bh (&mbx->queue_lock);qlcnic_83xx_notify_cmd_completion (adapter, cmd); }
@@ -3942,7 +3942,7 @@ static int qlcnic_83xx_enqueue_mbx_cmd(struct qlcnic_adapter *adapter,init_completion (&cmd->completion); cmd->rsp_opcode =QLC_83XX_MBX_RESPONSE_UNKNOWN ; -spin_lock (&mbx->queue_lock); +spin_lock_bh (&mbx->queue_lock);list_add_tail (&cmd->list, &mbx->cmd_q); mbx->num_cmds++;
@@ -3950,7 +3950,7 @@ static int qlcnic_83xx_enqueue_mbx_cmd(struct qlcnic_adapter *adapter, *timeout = cmd->total_cmds *QLC_83XX_MBX_TIMEOUT ;queue_work (mbx->work_q, &mbx->work); -spin_unlock (&mbx->queue_lock); +spin_unlock_bh (&mbx->queue_lock);return 0 ; }
@@ -4046,15 +4046,15 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work) mbx->rsp_status =QLC_83XX_MBX_RESPONSE_WAIT ;spin_unlock_irqrestore (&mbx->aen_lock, flags); -spin_lock (&mbx->queue_lock); +spin_lock_bh (&mbx->queue_lock);if (list_empty (head)) { -spin_unlock (&mbx->queue_lock); +spin_unlock_bh (&mbx->queue_lock);return ; } cmd = list_entry(head->next, struct qlcnic_cmd_args, list); -spin_unlock (&mbx->queue_lock); +spin_unlock_bh (&mbx->queue_lock); mbx_ops->encode_cmd (adapter, cmd); mbx_ops->nofity_fw (adapter,QLC_83XX_MBX_REQUEST );
drivers/net/ethernet/realtek/r8169.c +2 -2
@@ -1375,7 +1375,7 @@ DECLARE_RTL_COND(rtl_ocp_tx_cond) {void __iomem *ioaddr = tp->mmio_addr; -return RTL_R8 (IBISR0 ) &0x02 ; +return RTL_R8 (IBISR0 ) &0x20 ; }static void rtl8168dp_driver_start (struct rtl8169_private *tp)
@@ -1421,7 +1421,7 @@ static void rtl8168ep_driver_stop(struct rtl8169_private *tp)void __iomem *ioaddr = tp->mmio_addr;RTL_W8 (IBCR2 ,RTL_R8 (IBCR2 ) & ~0x01 ); -rtl_msleep_loop_wait_low (tp, &rtl_ocp_tx_cond,50 ,2000 ); +rtl_msleep_loop_wait_high (tp, &rtl_ocp_tx_cond,50 ,2000 );RTL_W8 (IBISR0 ,RTL_R8 (IBISR0 ) |0x20 );RTL_W8 (IBCR0 ,RTL_R8 (IBCR0 ) & ~0x01 );ocp_write (tp,0x01 ,0x180 ,OOB_CMD_DRIVER_STOP );
drivers/usb/usbip/stub_dev.c +1 -2
@@ -163,8 +163,7 @@ static void stub_shutdown_connection(struct usbip_device *ud)* step 1? */ if (ud->tcp_socket) { -dev_dbg (&sdev->udev->dev,"shutdown tcp_socket %p\n" , - ud->tcp_socket); +dev_dbg (&sdev->udev->dev,"shutdown sockfd %d\n" , ud->sockfd);kernel_sock_shutdown (ud->tcp_socket,SHUT_RDWR ); }
drivers/usb/usbip/stub_main.c +3 -2
@@ -252,11 +252,12 @@ void stub_device_cleanup_urbs(struct stub_device *sdev)struct stub_priv *priv;struct urb *urb; -dev_dbg (&sdev->udev->dev,"free sdev %p\n" , sdev); +dev_dbg (&sdev->udev->dev,"Stub device cleaning up urbs\n" );while ((priv =stub_priv_pop (sdev))) { urb = priv->urb; -dev_dbg (&sdev->udev->dev,"free urb %p\n" , urb); +dev_dbg (&sdev->udev->dev,"free urb seqnum %lu\n" , + priv->seqnum);usb_kill_urb (urb);kmem_cache_free (stub_priv_cache, priv);
drivers/usb/usbip/stub_rx.c +39 -14
101 lines not on this page · raw message
drivers/usb/usbip/stub_tx.c +2 -2
@@ -201,8 +201,8 @@ static int stub_send_ret_submit(struct stub_device *sdev)/* 1. setup usbip_header */ setup_ret_submit_pdu (&pdu_header, urb); -usbip_dbg_stub_tx ("setup txdata seqnum: %d urb: %p\n" , - pdu_header.base.seqnum, urb); +usbip_dbg_stub_tx ("setup txdata seqnum: %d\n" , + pdu_header.base.seqnum);usbip_header_correct_endian (&pdu_header,1 ); iov[iovnum].iov_base = &pdu_header;
drivers/usb/usbip/usbip_common.c +4 -11
@@ -317,18 +317,14 @@ int usbip_recv(struct socket *sock, void *buf, int size)struct msghdr msg;struct kvec iov;int total =0 ; -/* for blocks of if (usbip_dbg_flag_xmit) */ char *bp = buf;int osize = size; -usbip_dbg_xmit ("enter\n" ); - -if (!sock || !buf || !size) { -pr_err ("invalid arg, sock %p buff %p size %d\n" , sock, buf, - size); +if (!sock || !buf || !size)return -EINVAL ; - } + +usbip_dbg_xmit ("enter\n" ); do { sock->sk->sk_allocation = GFP_NOIO;
@@ -341,11 +337,8 @@ int usbip_recv(struct socket *sock, void *buf, int size) msg.msg_flags =MSG_NOSIGNAL ; result =kernel_recvmsg (sock, &msg, &iov,1 , size,MSG_WAITALL ); -if (result <=0 ) { -pr_debug ("receive sock %p buf %p size %u ret %d total %d\n" , - sock, buf, size, result, total); +if (result <=0 ) goto err; - } size -= result; buf += result;
drivers/usb/usbip/usbip_common.h +1 -0
@@ -261,6 +261,7 @@ struct usbip_device {/* lock for status */ spinlock_t lock; +int sockfd;struct socket *tcp_socket;struct task_struct *tcp_rx;
drivers/usb/usbip/usbip_event.c +3 -2
@@ -117,11 +117,12 @@ EXPORT_SYMBOL_GPL(usbip_event_add);int usbip_event_happened (struct usbip_device *ud) {int happened =0 ; +unsigned long flags; -spin_lock (&ud->lock); +spin_lock_irqsave (&ud->lock, flags);if (ud->event !=0 ) happened =1 ; -spin_unlock (&ud->lock); +spin_unlock_irqrestore (&ud->lock, flags);return happened; }
drivers/usb/usbip/vhci_hcd.c +54 -48
357 lines not on this page · raw message
drivers/usb/usbip/vhci_rx.c +28 -25
137 lines not on this page · raw message
drivers/usb/usbip/vhci_sysfs.c +26 -19
123 lines not on this page · raw message
drivers/usb/usbip/vhci_tx.c +10 -7
@@ -47,16 +47,17 @@ static void setup_cmd_submit_pdu(struct usbip_header *pdup, struct urb *urb)static struct vhci_priv *dequeue_from_priv_tx (struct vhci_device *vdev) {struct vhci_priv *priv, *tmp; +unsigned long flags; -spin_lock (&vdev->priv_lock); +spin_lock_irqsave (&vdev->priv_lock, flags);list_for_each_entry_safe (priv, tmp, &vdev->priv_tx, list) {list_move_tail (&priv->list, &vdev->priv_rx); -spin_unlock (&vdev->priv_lock); +spin_unlock_irqrestore (&vdev->priv_lock, flags);return priv; } -spin_unlock (&vdev->priv_lock); +spin_unlock_irqrestore (&vdev->priv_lock, flags);return NULL ; }
@@ -82,7 +83,8 @@ static int vhci_send_cmd_submit(struct vhci_device *vdev)memset (&msg,0 ,sizeof (msg));memset (&iov,0 ,sizeof (iov)); -usbip_dbg_vhci_tx ("setup txdata urb %p\n" , urb); +usbip_dbg_vhci_tx ("setup txdata urb seqnum %lu\n" , + priv->seqnum);/* 1. setup usbip_header */ setup_cmd_submit_pdu (&pdu_header, urb);
@@ -136,16 +138,17 @@ static int vhci_send_cmd_submit(struct vhci_device *vdev)static struct vhci_unlink *dequeue_from_unlink_tx (struct vhci_device *vdev) {struct vhci_unlink *unlink, *tmp; +unsigned long flags; -spin_lock (&vdev->priv_lock); +spin_lock_irqsave (&vdev->priv_lock, flags);list_for_each_entry_safe (unlink, tmp, &vdev->unlink_tx, list) {list_move_tail (&unlink->list, &vdev->unlink_rx); -spin_unlock (&vdev->priv_lock); +spin_unlock_irqrestore (&vdev->priv_lock, flags);return unlink; } -spin_unlock (&vdev->priv_lock); +spin_unlock_irqrestore (&vdev->priv_lock, flags);return NULL ; }
drivers/vhost/net.c +1 -0
@@ -1009,6 +1009,7 @@ static long vhost_net_reset_owner(struct vhost_net *n) }vhost_net_stop (n, &tx_sock, &rx_sock);vhost_net_flush (n); +vhost_dev_stop (&n->dev);vhost_dev_reset_owner (&n->dev, memory);vhost_net_vq_reset (n); done:
fs/cifs/cifsencrypt.c +1 -2
@@ -303,9 +303,8 @@ int calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt, {int i;int rc; -char password_with_pad[CIFS_ENCPWD_SIZE ]; +char password_with_pad[CIFS_ENCPWD_SIZE ] = {0 }; -memset (password_with_pad,0 ,CIFS_ENCPWD_SIZE );if (password)strncpy (password_with_pad, password,CIFS_ENCPWD_SIZE );
fs/cifs/connect.c +3 -3
@@ -1650,7 +1650,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, tmp_end++;if (!(tmp_end < end && tmp_end[1 ] == delim)) {/* No it is not. Set the password to NULL */ -kfree (vol->password); +kzfree (vol->password); vol->password =NULL ;break ; }
@@ -1688,7 +1688,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, options = end; } -kfree (vol->password); +kzfree (vol->password);/* Now build new password string */ temp_len =strlen (value); vol->password =kzalloc (temp_len+1 ,GFP_KERNEL );
@@ -4046,7 +4046,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)reset_cifs_unix_caps (0 , tcon,NULL , vol_info); out:kfree (vol_info->username); -kfree (vol_info->password); +kzfree (vol_info->password);kfree (vol_info);return tcon;
fs/cifs/file.c +12 -14
@@ -3261,20 +3261,18 @@ static struct vm_operations_struct cifs_file_vm_ops = {int cifs_file_strict_mmap (struct file *file,struct vm_area_struct *vma) { -int rc, xid; +int xid, rc =0 ;struct inode *inode =file_inode (file); xid =get_xid (); -if (!CIFS_CACHE_READ (CIFS_I (inode))) { +if (!CIFS_CACHE_READ (CIFS_I (inode))) rc =cifs_zap_mapping (inode); -if (rc) -return rc; - } - - rc =generic_file_mmap (file, vma); -if (rc ==0 ) +if (!rc) + rc =generic_file_mmap (file, vma); +if (!rc) vma->vm_ops = &cifs_file_vm_ops; +free_xid (xid);return rc; }
@@ -3284,16 +3282,16 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)int rc, xid; xid =get_xid (); + rc =cifs_revalidate_file (file); -if (rc) { +if (rc)cifs_dbg (FYI ,"Validation prior to mmap failed, error=%d\n" , rc); -free_xid (xid); -return rc; - } - rc =generic_file_mmap (file, vma); -if (rc ==0 ) +if (!rc) + rc =generic_file_mmap (file, vma); +if (!rc) vma->vm_ops = &cifs_file_vm_ops; +free_xid (xid);return rc; }
fs/cifs/misc.c +4 -10
@@ -99,14 +99,11 @@ sesInfoFree(struct cifs_ses *buf_to_free)kfree (buf_to_free->serverOS);kfree (buf_to_free->serverDomain);kfree (buf_to_free->serverNOS); -if (buf_to_free->password) { -memset (buf_to_free->password,0 ,strlen (buf_to_free->password)); -kfree (buf_to_free->password); - } +kzfree (buf_to_free->password);kfree (buf_to_free->user_name);kfree (buf_to_free->domainName); -kfree (buf_to_free->auth_key.response); -kfree (buf_to_free); +kzfree (buf_to_free->auth_key.response); +kzfree (buf_to_free); } struct cifs_tcon *
@@ -136,10 +133,7 @@ tconInfoFree(struct cifs_tcon *buf_to_free) }atomic_dec (&tconInfoAllocCount);kfree (buf_to_free->nativeFileSystem); -if (buf_to_free->password) { -memset (buf_to_free->password,0 ,strlen (buf_to_free->password)); -kfree (buf_to_free->password); - } +kzfree (buf_to_free->password);kfree (buf_to_free); }
fs/cifs/smb2pdu.c +1 -2
@@ -507,8 +507,7 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) }/* check validate negotiate info response matches what we got earlier */ -if (pneg_rsp->Dialect != -cpu_to_le16 (tcon->ses->server->vals->protocol_id)) +if (pneg_rsp->Dialect !=cpu_to_le16 (tcon->ses->server->dialect)) goto vneg_out;if (pneg_rsp->SecurityMode !=cpu_to_le16 (tcon->ses->server->sec_mode))
fs/kernfs/file.c +1 -1
@@ -267,7 +267,7 @@ static ssize_t kernfs_fop_write(struct file *file, const char __user *user_buf, {struct kernfs_open_file *of =kernfs_of (file);const struct kernfs_ops *ops; -size_t len; +ssize_t len;char *buf;if (of->atomic_write_len) {
fs/nfs/direct.c +1 -3
@@ -716,10 +716,8 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)spin_lock (&dreq->lock); -if (test_bit (NFS_IOHDR_ERROR , &hdr->flags)) { - dreq->flags =0 ; +if (test_bit (NFS_IOHDR_ERROR , &hdr->flags)) dreq->error = hdr->error; - }if (dreq->error ==0 ) { dreq->count += hdr->good_bytes;if (nfs_write_need_commit (hdr)) {
fs/nfs/write.c +2 -0
@@ -1646,6 +1646,8 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)set_bit (NFS_CONTEXT_RESEND_WRITES , &req->wb_context->flags); next:nfs_unlock_and_release_request (req); +/* Latency breaker */ +cond_resched (); } nfss =NFS_SERVER (data->inode);if (atomic_long_read (&nfss->writeback) <NFS_CONGESTION_OFF_THRESH )
include/crypto/internal/hash.h +2 -0
@@ -91,6 +91,8 @@ static inline bool crypto_shash_alg_has_setkey(struct shash_alg *alg)return alg->setkey != shash_no_setkey; } +bool crypto_hash_alg_has_setkey (struct hash_alg_common *halg); +int crypto_init_ahash_spawn (struct crypto_ahash_spawn *spawn,struct hash_alg_common *alg,struct crypto_instance *inst);
include/net/arp.h +3 -3
@@ -22,6 +22,9 @@ static inline struct neighbour *__ipv4_neigh_lookup_noref(struct net_device *devstruct neighbour *n;u32 hash_val; +if (dev->flags & (IFF_LOOPBACK |IFF_POINTOPOINT )) + key =INADDR_ANY ; + hash_val =arp_hashfn (key, dev, nht->hash_rnd[0 ]) >> (32 - nht->hash_shift); for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); n != NULL;
@@ -37,9 +40,6 @@ static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32 {struct neighbour *n; -if (dev->flags & (IFF_LOOPBACK |IFF_POINTOPOINT )) - key =INADDR_ANY ; -rcu_read_lock_bh (); n =__ipv4_neigh_lookup_noref (dev, key);if (n && !atomic_inc_not_zero (&n->refcnt))
kernel/async.c +12 -8
@@ -84,20 +84,24 @@ static atomic_t entry_count;static async_cookie_t lowest_in_progress (struct async_domain *domain) { -struct list_head *pending; +struct async_entry *first =NULL ;async_cookie_t ret =ASYNC_COOKIE_MAX ;unsigned long flags;spin_lock_irqsave (&async_lock, flags); -if (domain) - pending = &domain->pending; -else - pending = &async_global_pending; +if (domain) { +if (!list_empty (&domain->pending)) + first =list_first_entry (&domain->pending, + struct async_entry, domain_list); + }else { +if (!list_empty (&async_global_pending)) + first =list_first_entry (&async_global_pending, + struct async_entry, global_list); + } -if (!list_empty (pending)) - ret = list_first_entry(pending, struct async_entry, - domain_list)->cookie; +if (first) + ret = first->cookie;spin_unlock_irqrestore (&async_lock, flags);return ret;
kernel/time/posix-timers.c +19 -15
@@ -500,17 +500,22 @@ static struct pid *good_sigevent(sigevent_t * event) {struct task_struct *rtn = current->group_leader; -if ((event->sigev_notify &SIGEV_THREAD_ID ) && - (!(rtn =find_task_by_vpid (event->sigev_notify_thread_id)) || - !same_thread_group (rtn, current) || - (event->sigev_notify & ~SIGEV_THREAD_ID ) !=SIGEV_SIGNAL )) +switch (event->sigev_notify) { +case SIGEV_SIGNAL |SIGEV_THREAD_ID : + rtn =find_task_by_vpid (event->sigev_notify_thread_id); +if (!rtn || !same_thread_group (rtn, current)) +return NULL ; +/* FALLTHRU */ +case SIGEV_SIGNAL : +case SIGEV_THREAD : +if (event->sigev_signo <=0 || event->sigev_signo >SIGRTMAX ) +return NULL ; +/* FALLTHRU */ +case SIGEV_NONE : +return task_pid (rtn); +default :return NULL ; - -if (((event->sigev_notify & ~SIGEV_THREAD_ID ) !=SIGEV_NONE ) && - ((event->sigev_signo <=0 ) || (event->sigev_signo >SIGRTMAX ))) -return NULL ; - -return task_pid (rtn); + } } void posix_timers_register_clock(const clockid_t clock_id,
@@ -738,8 +743,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)/* interval timer ? */ if (iv.tv64) cur_setting->it_interval =ktime_to_timespec (iv); -else if (!hrtimer_active (timer) && - (timr->it_sigev_notify & ~SIGEV_THREAD_ID ) !=SIGEV_NONE ) +else if (!hrtimer_active (timer) && timr->it_sigev_notify !=SIGEV_NONE )return ; now = timer->base->get_time ();
@@ -750,7 +754,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)* expiry is > now. */ if (iv.tv64 && (timr->it_requeue_pending &REQUEUE_PENDING || - (timr->it_sigev_notify & ~SIGEV_THREAD_ID ) ==SIGEV_NONE )) + timr->it_sigev_notify ==SIGEV_NONE )) timr->it_overrun += (unsigned int )hrtimer_forward (timer, now, iv); remaining =ktime_sub (hrtimer_get_expires (timer), now);
@@ -760,7 +764,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)* A single shot SIGEV_NONE timer must return 0, when * it is expired ! */ -if ((timr->it_sigev_notify & ~SIGEV_THREAD_ID ) !=SIGEV_NONE ) +if (timr->it_sigev_notify !=SIGEV_NONE ) cur_setting->it_value.tv_nsec =1 ; }else cur_setting->it_value =ktime_to_timespec (remaining);
@@ -858,7 +862,7 @@ common_timer_set(struct k_itimer *timr, int flags, timr->it.real.interval =timespec_to_ktime (new_setting->it_interval);/* SIGEV_NONE timers are not queued ! See common_timer_get */ -if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID ) ==SIGEV_NONE )) { +if (timr->it_sigev_notify ==SIGEV_NONE ) {/* Setup correct expiry time for relative timers */ if (mode ==HRTIMER_MODE_REL ) {hrtimer_add_expires (timer, timer->base->get_time ());
net/dccp/proto.c +5 -0
@@ -259,6 +259,7 @@ int dccp_disconnect(struct sock *sk, int flags) {struct inet_connection_sock *icsk =inet_csk (sk);struct inet_sock *inet =inet_sk (sk); +struct dccp_sock *dp =dccp_sk (sk);int err =0 ;const int old_state = sk->sk_state;
@@ -278,6 +279,10 @@ int dccp_disconnect(struct sock *sk, int flags) sk->sk_err =ECONNRESET ;dccp_clear_xmit_timers (sk); +ccid_hc_rx_delete (dp->dccps_hc_rx_ccid, sk); +ccid_hc_tx_delete (dp->dccps_hc_tx_ccid, sk); + dp->dccps_hc_rx_ccid =NULL ; + dp->dccps_hc_tx_ccid =NULL ;__skb_queue_purge (&sk->sk_receive_queue);__skb_queue_purge (&sk->sk_write_queue);
net/ipv4/igmp.c +4 -0
@@ -384,7 +384,11 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, unsigned int mtu) pip->frag_off =htons (IP_DF ); pip->ttl =1 ; pip->daddr = fl4.daddr; + +rcu_read_lock (); pip->saddr =igmpv3_get_srcaddr (dev, &fl4); +rcu_read_unlock (); + pip->protocol =IPPROTO_IGMP ; pip->tot_len =0 ;/* filled in later */ ip_select_ident (skb,NULL );
net/ipv4/tcp.c +6 -0
@@ -2280,6 +2280,12 @@ int tcp_disconnect(struct sock *sk, int flags)WARN_ON (inet->inet_num && !icsk->icsk_bind_hash); +if (sk->sk_frag.page) { +put_page (sk->sk_frag.page); + sk->sk_frag.page =NULL ; + sk->sk_frag.offset =0 ; + } + sk->sk_error_report (sk);return err; }
net/ipv6/ip6mr.c +1 -0
@@ -498,6 +498,7 @@ static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos)return ERR_PTR (-ENOENT ); it->mrt = mrt; + it->cache =NULL ;return *pos ?ipmr_mfc_seq_idx (net, seq->private, *pos -1 ) :SEQ_START_TOKEN ; }
security/keys/encrypted-keys/encrypted.c +15 -16
@@ -141,23 +141,22 @@ static int valid_ecryptfs_desc(const char *ecryptfs_desc)*/ static int valid_master_desc (const char *new_desc,const char *orig_desc) { -if (!memcmp (new_desc,KEY_TRUSTED_PREFIX ,KEY_TRUSTED_PREFIX_LEN )) { -if (strlen (new_desc) ==KEY_TRUSTED_PREFIX_LEN ) - goto out; -if (orig_desc) -if (memcmp (new_desc, orig_desc,KEY_TRUSTED_PREFIX_LEN )) - goto out; - }else if (!memcmp (new_desc,KEY_USER_PREFIX ,KEY_USER_PREFIX_LEN )) { -if (strlen (new_desc) ==KEY_USER_PREFIX_LEN ) - goto out; -if (orig_desc) -if (memcmp (new_desc, orig_desc,KEY_USER_PREFIX_LEN )) - goto out; - }else - goto out; +int prefix_len; + +if (!strncmp (new_desc,KEY_TRUSTED_PREFIX ,KEY_TRUSTED_PREFIX_LEN )) + prefix_len =KEY_TRUSTED_PREFIX_LEN ; +else if (!strncmp (new_desc,KEY_USER_PREFIX ,KEY_USER_PREFIX_LEN )) + prefix_len =KEY_USER_PREFIX_LEN ; +else +return -EINVAL ; + +if (!new_desc[prefix_len]) +return -EINVAL ; + +if (orig_desc &&strncmp (new_desc, orig_desc, prefix_len)) +return -EINVAL ; +return 0 ; -out: -return -EINVAL ; }/*
tools/usb/usbip/libsrc/usbip_common.c +8 -1
@@ -215,9 +215,16 @@ int read_usb_interface(struct usbip_usb_device *udev, int i, struct usbip_usb_interface *uinf) {char busid[SYSFS_BUS_ID_SIZE ]; +int size;struct udev_device *sif; -sprintf (busid,"%s:%d.%d" , udev->busid, udev->bConfigurationValue, i); + size =snprintf (busid,sizeof (busid),"%s:%d.%d" , + udev->busid, udev->bConfigurationValue, i); +if (size <0 || (unsigned int )size >=sizeof (busid)) { +err ("busid length %i >= %lu or < 0" , size, + (unsigned long )sizeof (busid)); +return -1 ; + } sif =udev_device_new_from_subsystem_sysname (udev_context,"usb" , busid);if (!sif) {
tools/usb/usbip/libsrc/usbip_host_driver.c +22 -5
@@ -39,13 +39,19 @@ struct udev *udev_context;static int32_t read_attr_usbip_status (struct usbip_usb_device *udev) {char status_attr_path[SYSFS_PATH_MAX ]; +int size;int fd;int length;char status;int value =0 ; -snprintf (status_attr_path,SYSFS_PATH_MAX ,"%s/usbip_status" , - udev->path); + size =snprintf (status_attr_path,SYSFS_PATH_MAX ,"%s/usbip_status" , + udev->path); +if (size <0 || (unsigned int )size >=sizeof (status_attr_path)) { +err ("usbip_status path length %i >= %lu or < 0" , size, + (unsigned long )sizeof (status_attr_path)); +return -1 ; + } fd =open (status_attr_path,O_RDONLY );if (fd <0 ) {
@@ -225,6 +231,7 @@ int usbip_host_export_device(struct usbip_exported_device *edev, int sockfd) {char attr_name[] ="usbip_sockfd" ;char sockfd_attr_path[SYSFS_PATH_MAX ]; +int size;char sockfd_buff[30 ];int ret;
@@ -244,10 +251,20 @@ int usbip_host_export_device(struct usbip_exported_device *edev, int sockfd) }/* only the first interface is true */ -snprintf (sockfd_attr_path,sizeof (sockfd_attr_path),"%s/%s" , - edev->udev.path, attr_name); + size =snprintf (sockfd_attr_path,sizeof (sockfd_attr_path),"%s/%s" , + edev->udev.path, attr_name); +if (size <0 || (unsigned int )size >=sizeof (sockfd_attr_path)) { +err ("exported device path length %i >= %lu or < 0" , size, + (unsigned long )sizeof (sockfd_attr_path)); +return -1 ; + } -snprintf (sockfd_buff,sizeof (sockfd_buff),"%d\n" , sockfd); + size =snprintf (sockfd_buff,sizeof (sockfd_buff),"%d\n" , sockfd); +if (size <0 || (unsigned int )size >=sizeof (sockfd_buff)) { +err ("socket length %i >= %lu or < 0" , size, + (unsigned long )sizeof (sockfd_buff)); +return -1 ; + } ret =write_sysfs_attribute (sockfd_attr_path, sockfd_buff,strlen (sockfd_buff));
tools/usb/usbip/libsrc/vhci_driver.c +4 -4
@@ -55,12 +55,12 @@ static int parse_status(const char *value)while (*c !='\0' ) {int port, status, speed, devid; -unsigned long socket; +int sockfd;char lbusid[SYSFS_BUS_ID_SIZE ]; - ret =sscanf (c,"%d %d %d %x %lx %31s\n" , + ret =sscanf (c,"%d %d %d %x %u %31s\n" , &port, &status, &speed, - &devid, &socket, lbusid); + &devid, &sockfd, lbusid);if (ret <5 ) {dbg ("sscanf failed: %d" , ret);
@@ -69,7 +69,7 @@ static int parse_status(const char *value)dbg ("port %d status %d speed %d devid %x" , port, status, speed, devid); -dbg ("socket %lx lbusid %s" , socket, lbusid); +dbg ("sockfd %u lbusid %s" , sockfd, lbusid);/* if a device is connected, look at it */
Quoted 10 lines · Greg KH,
I'm announcing the release of the 3.18.95 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:
Quoted 6 lines
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
No issues on the oneplus3 over the course of the past couple of hours. Clean merge into Codeaurora's tree, should be the same for AOSP kernel-common.
Thanks,
Harsh Shandilya