Linux 3.18.55
Greg KH
maintainerI'm announcing the release of the 3.18.55 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/arm64/tagged-pointers.txt | 62 +++++++++++++---- Makefile | 2 arch/alpha/kernel/osf_sys.c | 6 + arch/arm/boot/dts/at91-sama5d3_xplained.dts | 5 - arch/arm64/include/asm/uaccess.h | 3 arch/metag/include/asm/uaccess.h | 49 ++++++++----- arch/powerpc/platforms/pseries/dlpar.c | 1 drivers/char/lp.c | 6 + drivers/char/mem.c | 5 + drivers/iio/dac/ad7303.c | 6 - drivers/iio/proximity/as3935.c | 3 drivers/md/dm-bufio.c | 9 +- drivers/md/dm-thin-metadata.c | 4 - drivers/md/persistent-data/dm-btree.c | 8 +- drivers/md/persistent-data/dm-space-map-disk.c | 15 +++- drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 drivers/media/rc/mceusb.c | 4 - drivers/media/tuners/tuner-xc2028.c | 37 ++++------ drivers/media/usb/cx231xx/cx231xx-audio.c | 15 +++- drivers/media/usb/cx231xx/cx231xx-cards.c | 45 +++++++++++- drivers/media/usb/dvb-usb/dib0700_core.c | 3 drivers/media/usb/dvb-usb/ttusb2.c | 19 +++++ drivers/media/usb/gspca/konica.c | 3 drivers/media/usb/usbvision/usbvision-video.c | 9 ++ drivers/media/usb/zr364xx/zr364xx.c | 8 ++ drivers/net/irda/irda-usb.c | 2 drivers/net/wireless/ath/ath9k/hif_usb.c | 3 drivers/net/wireless/mwifiex/pcie.c | 7 + drivers/of/address.c | 2 drivers/of/fdt.c | 3 drivers/pci/pci-sysfs.c | 10 +- drivers/pci/pci.c | 9 +- drivers/regulator/tps65023-regulator.c | 3 drivers/tty/tty_ldisc.c | 7 + drivers/usb/class/cdc-acm.c | 13 ++- drivers/usb/core/devio.c | 4 - drivers/usb/core/hcd.c | 4 - drivers/usb/core/hub.c | 19 +++-- drivers/usb/core/urb.c | 2 drivers/usb/host/xhci-mem.c | 2 drivers/usb/host/xhci-plat.c | 2 drivers/usb/misc/iowarrior.c | 2 drivers/usb/misc/legousbtower.c | 1 drivers/usb/musb/tusb6010_omap.c | 13 ++- drivers/usb/serial/ftdi_sio.c | 10 +- drivers/usb/serial/ftdi_sio_ids.h | 2 drivers/usb/serial/io_ti.c | 5 + drivers/usb/serial/mct_u232.c | 2 drivers/usb/serial/option.c | 8 ++ drivers/usb/serial/qcserial.c | 2 drivers/usb/storage/ene_ub6250.c | 90 +++++++++++++++---------- drivers/uwb/i1480/dfu/usb.c | 5 - drivers/watchdog/pcwd_usb.c | 3 include/linux/kprobes.h | 4 - kernel/fork.c | 2 kernel/kprobes.c | 2 kernel/pid_namespace.c | 2 kernel/trace/trace_kprobe.c | 5 + mm/huge_memory.c | 12 +++ net/ipx/af_ipx.c | 5 - security/integrity/ima/ima_appraise.c | 5 - 61 files changed, 427 insertions(+), 173 deletions(-)
Al Viro (1):
osf_wait4(): fix infoleak
Alan Stern (1):
USB: ene_usb6250: fix DMA to the stack
Alyssa Milburn (2):
ttusb2: limit messages to buffer size
zr364xx: enforce minimum size when reading header
Andrey Korolyov (1):
USB: serial: ftdi_sio: add Olimex ARM-USB-TINY(H) PIDs
Anthony Mallet (1):
USB: serial: ftdi_sio: fix setting latency for unprivileged users
Bjørn Mork (1):
USB: serial: qcserial: add more Lenovo EM74xx device IDs
Brian Norris (1):
mwifiex: pcie: fix cmd_buf use-after-free in remove/reset
Dan Carpenter (1):
ipx: call ipxitf_put() in ioctl error path
Daniel Glöckner (1):
ima: accept previously set IMA_NEW_FILE
Daniel Micay (1):
stackprotector: Increase the per-task stack canary's random range from 32 bits to 64 bits on 64-bit platforms
Daniele Palmas (1):
usb: serial: option: add Telit ME910 support
David Woodhouse (1):
PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
Eric W. Biederman (1):
pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes
Greg Kroah-Hartman (1):
Linux 3.18.55
James Hogan (2):
metag/uaccess: Fix access_ok() metag/uaccess: Check access_ok in strncpy_from_user
Joe Thornber (2):
dm thin metadata: call precommit before saving the roots dm space map disk: fix some book keeping in the disk space map
Johan Hovold (16):
watchdog: pcwd_usb: fix NULL-deref at probe
ath9k_htc: fix NULL-deref at probe
of: fdt: add missing allocation-failure check
net: irda: irda-usb: fix firmware name on big-endian hosts
usbvision: fix NULL-deref at probe
mceusb: fix NULL-deref at probe
USB: iowarrior: fix info ioctl on big-endian hosts
USB: serial: mct_u232: fix big-endian baud-rate handling
USB: serial: io_ti: fix div-by-zero in set_termios
USB: hub: fix SS hub-descriptor handling
USB: hub: fix non-SS hub-descriptor handling
gspca: konica: add missing endpoint sanity check
dib0700: fix NULL-deref at probe
cx231xx-cards: fix NULL-deref at probe
cx231xx-audio: fix NULL-deref at probe
uwb: fix device quirk on big-endian hosts
Julius Werner (1):
drivers: char: mem: Check for address space wraparound with mmap()
Keno Fischer (1):
mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for thp
Kristina Martsenko (1):
arm64: documentation: document tagged pointer stack constraints
Ludovic Desroches (2):
ARM: dts: at91: sama5d3_xplained: fix ADC vref
ARM: dts: at91: sama5d3_xplained: not all ADC channels are available
Lukas Wunner (1):
PCI: Freeze PME scan before suspending devices
Maksim Salau (1):
usb: misc: legousbtower: Fix memory leak
Marek Szyprowski (1):
s5p-mfc: Fix unbalanced call to clock management
Mark Rutland (1):
arm64: uaccess: ensure extension of access_ok() addr
Matt Ranostay (1):
iio: proximity: as3935: fix as3935_write
Mikulas Patocka (1):
dm bufio: avoid a possible ABBA deadlock
Pavel Roskin (1):
iio: dac: ad7303: fix channel description
Peter Chen (1):
usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
Peter Hurley (1):
tty: Prevent ldisc drivers from re-using stale tty fields
Peter Ujfalusi (1):
usb: musb: tusb6010_omap: Do not reset the other direction's packet size
Richard Cochran (1):
regulator: tps65023: Fix inverted core enable logic.
Rob Herring (1):
of: fix sparse warning in of_pci_range_parser_one
Takashi Iwai (1):
xc2028: Fix use-after-free bug properly
Thomas Gleixner (1):
tracing/kprobes: Enforce kprobes teardown after testing
Thomas Petazzoni (1):
usb: host: xhci-plat: propagate return value of platform_get_irq()
Tobias Herzog (1):
cdc-acm: fix possible invalid access when processing notification
Tyrel Datwyler (1):
powerpc/pseries: Fix of_node_put() underflow during DLPAR remove
Vamsi Krishna Samavedam (1):
USB: core: replace %p with %pK
Vinothkumar Raja (1):
dm btree: fix for dm_btree_find_lowest_key()
Willy Tarreau (1):
char: lp: fix possible integer overflow in lp_setup()
Greg KH
maintainerDocumentation/arm64/tagged-pointers.txt +47 -15
@@ -11,24 +11,56 @@ in AArch64 Linux. The kernel configures the translation tables so that translations made via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of the virtual address ignored by the translation hardware. This frees up -this byte for application use, with the following caveats: +this byte for application use. - (1) The kernel requires that all user addresses passed to EL1 - are tagged with tag 0x00. This means that any syscall - parameters containing user virtual addresses *must* have - their top byte cleared before trapping to the kernel. - (2) Non-zero tags are not preserved when delivering signals. - This means that signal handlers in applications making use - of tags cannot rely on the tag information for user virtual - addresses being maintained for fields inside siginfo_t. - One exception to this rule is for signals raised in response - to watchpoint debug exceptions, where the tag information - will be preserved. +Passing tagged addresses to the kernel +-------------------------------------- - (3) Special care should be taken when using tagged pointers, - since it is likely that C compilers will not hazard two - virtual addresses differing only in the upper byte. +All interpretation of userspace memory addresses by the kernel assumes +an address tag of 0x00. + +This includes, but is not limited to, addresses found in: + + - pointer arguments to system calls, including pointers in structures + passed to system calls, + + - the stack pointer (sp), e.g. when interpreting it to deliver a + signal, + + - the frame pointer (x29) and frame records, e.g. when interpreting + them to generate a backtrace or call graph. + +Using non-zero address tags in any of these locations may result in an +error code being returned, a (fatal) signal being raised, or other modes +of failure. + +For these reasons, passing non-zero address tags to the kernel via +system calls is forbidden, and using a non-zero address tag for sp is +strongly discouraged. + +Programs maintaining a frame pointer and frame records that use non-zero +address tags may suffer impaired or inaccurate debug and profiling +visibility. + + +Preserving tags +--------------- + +Non-zero tags are not preserved when delivering signals. This means that +signal handlers in applications making use of tags cannot rely on the +tag information for user virtual addresses being maintained for fields +inside siginfo_t. One exception to this rule is for signals raised in +response to watchpoint debug exceptions, where the tag information will +be preserved. The architecture prevents the use of a tagged PC, so the upper byte will be set to a sign-extension of bit 55 on exception return. + + +Other considerations +-------------------- + +Special care should be taken when using tagged pointers, since it is +likely that C compilers will not hazard two virtual addresses differing +only in the upper byte.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 54 +SUBLEVEL = 55 EXTRAVERSION = NAME = Diseased Newt
arch/alpha/kernel/osf_sys.c +4 -2
@@ -1183,8 +1183,10 @@ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,if (!access_ok (VERIFY_WRITE , ur,sizeof (*ur)))return -EFAULT ; - err =0 ; - err |=put_user (status, ustatus); + err =put_user (status, ustatus); +if (ret <0 ) +return err ? err : ret; + err |=__put_user (r.ru_utime.tv_sec, &ur->ru_utime.tv_sec); err |=__put_user (r.ru_utime.tv_usec, &ur->ru_utime.tv_usec); err |=__put_user (r.ru_stime.tv_sec, &ur->ru_stime.tv_sec);
arch/arm/boot/dts/at91-sama5d3_xplained.dts +2 -3
@@ -143,9 +143,10 @@ }; adc0: adc@f8018000 { + atmel,adc-vref = <3300>; + atmel,adc-channels-used = <0xfe>; pinctrl-0 = < &pinctrl_adc0_adtrg - &pinctrl_adc0_ad0 &pinctrl_adc0_ad1 &pinctrl_adc0_ad2 &pinctrl_adc0_ad3
@@ -153,8 +154,6 @@ &pinctrl_adc0_ad5 &pinctrl_adc0_ad6 &pinctrl_adc0_ad7 - &pinctrl_adc0_ad8 - &pinctrl_adc0_ad9 >; status = "okay"; };
arch/arm64/include/asm/uaccess.h +2 -1
@@ -89,11 +89,12 @@ static inline void set_fs(mm_segment_t fs)*/ #define __range_ok (addr, size) \ ({ \ + unsigned long __addr = (unsigned long __force)(addr); \ unsigned long flag, roksum; \ __chk_user_ptr(addr); \ asm("adds %1, %1, %3; ccmp %1, %4, #2, cc; cset %0, ls" \ : "=&r" (flag), "=&r" (roksum) \ - : "1" (addr), "Ir" (size), \ + : "1" (__addr), "Ir" (size), \ "r" (current_thread_info()->addr_limit) \ : "cc"); \ flag; \
arch/metag/include/asm/uaccess.h +31 -18
63 lines not on this page · raw message
arch/powerpc/platforms/pseries/dlpar.c +0 -1
@@ -299,7 +299,6 @@ int dlpar_detach_node(struct device_node *dn)if (rc)return rc; -of_node_put (dn);/* Must decrement the refcount */ return 0 ; }
drivers/char/lp.c +5 -1
@@ -859,7 +859,11 @@ static int __init lp_setup (char *str) }else if (!strcmp (str,"auto" )) { parport_nr[0 ] =LP_PARPORT_AUTO ; }else if (!strcmp (str,"none" )) { - parport_nr[parport_ptr++] =LP_PARPORT_NONE ; +if (parport_ptr <LP_NO ) + parport_nr[parport_ptr++] =LP_PARPORT_NONE ; +else +printk (KERN_INFO "lp: too many ports, %s ignored.\n" , + str); }else if (!strcmp (str,"reset" )) { reset =1 ; }
drivers/char/mem.c +5 -0
@@ -329,6 +329,11 @@ static const struct vm_operations_struct mmap_mem_ops = {static int mmap_mem (struct file *file,struct vm_area_struct *vma) {size_t size = vma->vm_end - vma->vm_start; +phys_addr_t offset = (phys_addr_t )vma->vm_pgoff <<PAGE_SHIFT ; + +/* It's illegal to wrap around the end of the physical address space. */ +if (offset + (phys_addr_t )size < offset) +return -EINVAL ;if (!valid_mmap_phys_addr_range (vma->vm_pgoff, size))return -EINVAL ;
drivers/iio/dac/ad7303.c +3 -3
@@ -184,9 +184,9 @@ static const struct iio_chan_spec_ext_info ad7303_ext_info[] = { .address = (chan), \ .scan_type = { \ .sign = 'u', \ - .realbits = '8', \ - .storagebits = '8', \ - .shift = '0', \ + .realbits = 8, \ + .storagebits = 8, \ + .shift = 0, \ }, \ .ext_info = ad7303_ext_info, \ }
drivers/iio/proximity/as3935.c +1 -2
@@ -50,7 +50,6 @@#define AS3935_TUNE_CAP 0x08#define AS3935_CALIBRATE 0x3D -#define AS3935_WRITE_DATA BIT(15)#define AS3935_READ_DATA BIT(14)#define AS3935_ADDRESS (x) ((x) << 8)
@@ -103,7 +102,7 @@ static int as3935_write(struct as3935_state *st, {u8 *buf = st->buf; - buf[0 ] = (AS3935_WRITE_DATA |AS3935_ADDRESS (reg)) >>8 ; + buf[0 ] =AS3935_ADDRESS (reg) >>8 ; buf[1 ] = val;return spi_write (st->spi, buf,2 );
drivers/md/dm-bufio.c +5 -4
@@ -862,10 +862,11 @@ static void __get_memory_limit(struct dm_bufio_client *c, {unsigned long buffers; -if (ACCESS_ONCE (dm_bufio_cache_size) != dm_bufio_cache_size_latch) { -mutex_lock (&dm_bufio_clients_lock); -__cache_size_refresh (); -mutex_unlock (&dm_bufio_clients_lock); +if (unlikely (ACCESS_ONCE (dm_bufio_cache_size) != dm_bufio_cache_size_latch)) { +if (mutex_trylock (&dm_bufio_clients_lock)) { +__cache_size_refresh (); +mutex_unlock (&dm_bufio_clients_lock); + } } buffers = dm_bufio_cache_size_per_client >>
drivers/md/dm-thin-metadata.c +2 -2
@@ -484,11 +484,11 @@ static int __write_initial_superblock(struct dm_pool_metadata *pmd)if (r <0 )return r; - r =save_sm_roots (pmd); + r =dm_tm_pre_commit (pmd->tm);if (r <0 )return r; - r =dm_tm_pre_commit (pmd->tm); + r =save_sm_roots (pmd);if (r <0 )return r;
drivers/md/persistent-data/dm-btree.c +6 -2
@@ -788,8 +788,12 @@ static int find_key(struct ro_spine *s, dm_block_t block, bool find_highest,else *result_key =le64_to_cpu (ro_node (s)->keys[0 ]); -if (next_block || flags &INTERNAL_NODE ) - block =value64 (ro_node (s), i); +if (next_block || flags &INTERNAL_NODE ) { +if (find_highest) + block =value64 (ro_node (s), i); +else + block =value64 (ro_node (s),0 ); + } }while (flags &INTERNAL_NODE );
drivers/md/persistent-data/dm-space-map-disk.c +14 -1
@@ -140,10 +140,23 @@ static int sm_disk_inc_block(struct dm_space_map *sm, dm_block_t b)static int sm_disk_dec_block (struct dm_space_map *sm,dm_block_t b) { +int r; +uint32_t old_count;enum allocation_event ev; struct sm_disk *smd = container_of(sm, struct sm_disk, sm); -return sm_ll_dec (&smd->ll, b, &ev); + r =sm_ll_dec (&smd->ll, b, &ev); +if (!r && (ev ==SM_FREE )) { +/* +* It's only free if it's also free in the last +* transaction. +*/ + r =sm_ll_lookup (&smd->old_ll, b, &old_count); +if (!r && !old_count) + smd->nr_allocated_this_transaction--; + } + +return r; }static int sm_disk_new_block (struct dm_space_map *sm,dm_block_t *b)
drivers/media/platform/s5p-mfc/s5p_mfc.c +1 -0
@@ -169,6 +169,7 @@ static void s5p_mfc_watchdog_worker(struct work_struct *work) }s5p_mfc_clock_on (); ret =s5p_mfc_init_hw (dev); +s5p_mfc_clock_off ();if (ret)mfc_err ("Failed to reinit FW\n" ); }
drivers/media/rc/mceusb.c +2 -2
@@ -1321,8 +1321,8 @@ static int mceusb_dev_probe(struct usb_interface *intf, } } } -if (ep_in ==NULL ) { -dev_dbg (&intf->dev,"inbound and/or endpoint not found" ); +if (!ep_in || !ep_out) { +dev_dbg (&intf->dev,"required endpoints not found\n" );return -ENODEV ; }
drivers/media/tuners/tuner-xc2028.c +16 -21
@@ -281,6 +281,14 @@ static void free_firmware(struct xc2028_data *priv)int i;tuner_dbg ("%s called\n" , __func__); +/* free allocated f/w string */ +if (priv->fname != firmware_name) +kfree (priv->fname); + priv->fname =NULL ; + + priv->state =XC2028_NO_FIRMWARE ; +memset (&priv->cur_fw,0 ,sizeof (priv->cur_fw)); +if (!priv->firm)return ;
@@ -291,9 +299,6 @@ static void free_firmware(struct xc2028_data *priv) priv->firm =NULL ; priv->firm_size =0 ; - priv->state =XC2028_NO_FIRMWARE ; - -memset (&priv->cur_fw,0 ,sizeof (priv->cur_fw)); } static int load_all_firmwares(struct dvb_frontend *fe,
@@ -884,9 +889,8 @@ read_not_reliable:return 0 ; fail: - priv->state =XC2028_NO_FIRMWARE ; +free_firmware (priv); -memset (&priv->cur_fw,0 ,sizeof (priv->cur_fw));if (retry_count <8 ) {msleep (50 ); retry_count++;
@@ -1332,11 +1336,8 @@ static int xc2028_dvb_release(struct dvb_frontend *fe)mutex_lock (&xc2028_list_mutex);/* only perform final cleanup if this is the last instance */ -if (hybrid_tuner_report_instance_count (priv) ==1 ) { +if (hybrid_tuner_report_instance_count (priv) ==1 )free_firmware (priv); -kfree (priv->ctrl.fname); - priv->ctrl.fname =NULL ; - }if (priv)hybrid_tuner_release_state (priv);
@@ -1399,19 +1400,8 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg)/* * Copy the config data. -* For the firmware name, keep a local copy of the string, -* in order to avoid troubles during device release. */ -kfree (priv->ctrl.fname); - priv->ctrl.fname =NULL ;memcpy (&priv->ctrl, p,sizeof (priv->ctrl)); -if (p->fname) { - priv->ctrl.fname =kstrdup (p->fname,GFP_KERNEL ); -if (priv->ctrl.fname ==NULL ) { - rc = -ENOMEM ; - goto unlock; - } - }/* * If firmware name changed, frees firmware. As free_firmware will
@@ -1426,10 +1416,15 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg)if (priv->state ==XC2028_NO_FIRMWARE ) {if (!firmware_name[0 ]) - priv->fname = priv->ctrl.fname; + priv->fname =kstrdup (p->fname,GFP_KERNEL );else priv->fname = firmware_name; +if (!priv->fname) { + rc = -ENOMEM ; + goto unlock; + } + rc = request_firmware_nowait(THIS_MODULE, 1, priv->fname, priv->i2c_props.adap->dev.parent,
drivers/media/usb/cx231xx/cx231xx-audio.c +13 -2
@@ -702,6 +702,11 @@ static int cx231xx_audio_init(struct cx231xx *dev) hs_config_info[0 ].interface_info. audio_index + 1]; +if (uif->altsetting[0 ].desc.bNumEndpoints < isoc_pipe +1 ) { +snd_card_free (card); +return -ENODEV ; + } + adev->end_point_addr = uif->altsetting[0 ].endpoint[isoc_pipe].desc. bEndpointAddress;
@@ -717,8 +722,14 @@ static int cx231xx_audio_init(struct cx231xx *dev) }for (i =0 ; i < adev->num_alt; i++) { -u16 tmp = -le16_to_cpu (uif->altsetting[i].endpoint[isoc_pipe].desc. +u16 tmp; + +if (uif->altsetting[i].desc.bNumEndpoints < isoc_pipe +1 ) { +snd_card_free (card); +return -ENODEV ; + } + + tmp =le16_to_cpu (uif->altsetting[i].endpoint[isoc_pipe].desc. wMaxPacketSize); adev->alt_max_pkt_size[i] = (tmp &0x07ff ) * (((tmp &0x1800 ) >>11 ) +1 );
drivers/media/usb/cx231xx/cx231xx-cards.c +40 -5
93 lines not on this page · raw message
drivers/media/usb/dvb-usb/dib0700_core.c +3 -0
@@ -786,6 +786,9 @@ int dib0700_rc_setup(struct dvb_usb_device *d, struct usb_interface *intf)/* Starting in firmware 1.20, the RC info is provided on a bulk pipe */ +if (intf->altsetting[0 ].desc.bNumEndpoints < rc_ep +1 ) +return -ENODEV ; + purb =usb_alloc_urb (0 ,GFP_KERNEL );if (purb ==NULL ) {err ("rc usb alloc urb failed" );
drivers/media/usb/dvb-usb/ttusb2.c +19 -0
@@ -78,6 +78,9 @@ static int ttusb2_msg(struct dvb_usb_device *d, u8 cmd,u8 *s, *r =NULL ;int ret =0 ; +if (4 + rlen >64 ) +return -EIO ; + s =kzalloc (wlen+4 ,GFP_KERNEL );if (!s)return -ENOMEM ;
@@ -381,6 +384,22 @@ static int ttusb2_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num write_read = i+1 < num && (msg[i+1 ].flags &I2C_M_RD ); read = msg[i].flags &I2C_M_RD ; +if (3 + msg[i].len >sizeof (obuf)) { +err ("i2c wr len=%d too high" , msg[i].len); +break ; + } +if (write_read) { +if (3 + msg[i+1 ].len >sizeof (ibuf)) { +err ("i2c rd len=%d too high" , msg[i+1 ].len); +break ; + } + }else if (read) { +if (3 + msg[i].len >sizeof (ibuf)) { +err ("i2c rd len=%d too high" , msg[i].len); +break ; + } + } + obuf[0 ] = (msg[i].addr <<1 ) | (write_read | read);if (read) obuf[1 ] =0 ;
drivers/media/usb/gspca/konica.c +3 -0
@@ -188,6 +188,9 @@ static int sd_start(struct gspca_dev *gspca_dev)return -EIO ; } +if (alt->desc.bNumEndpoints <2 ) +return -ENODEV ; + packet_size =le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize); n = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv;
drivers/media/usb/usbvision/usbvision-video.c +8 -1
@@ -1583,7 +1583,14 @@ static int usbvision_probe(struct usb_interface *intf, }for (i =0 ; i < usbvision->num_alt; i++) { -u16 tmp =le16_to_cpu (uif->altsetting[i].endpoint[1 ].desc. +u16 tmp; + +if (uif->altsetting[i].desc.bNumEndpoints <2 ) { +usbvision_release (usbvision); +return -ENODEV ; + } + + tmp =le16_to_cpu (uif->altsetting[i].endpoint[1 ].desc. wMaxPacketSize); usbvision->alt_max_pkt_size[i] = (tmp &0x07ff ) * (((tmp &0x1800 ) >>11 ) +1 );
drivers/media/usb/zr364xx/zr364xx.c +8 -0
@@ -605,6 +605,14 @@ static int zr364xx_read_video_callback(struct zr364xx_camera *cam, ptr = pdest = frm->lpvbits;if (frm->ulState ==ZR364XX_READ_IDLE ) { +if (purb->actual_length <128 ) { +/* header incomplete */ +dev_info (&cam->udev->dev, +"%s: buffer (%d bytes) too small to hold jpeg header. Discarding.\n" , + __func__, purb->actual_length); +return -EINVAL ; + } + frm->ulState =ZR364XX_READ_FRAME ; frm->cur_size =0 ;
drivers/net/irda/irda-usb.c +1 -1
@@ -1082,7 +1082,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)* are "42101001.sb" or "42101002.sb" */ sprintf (stir421x_fw_name,"4210%4X.sb" , - self->usbdev->descriptor.bcdDevice); +le16_to_cpu (self->usbdev->descriptor.bcdDevice)); ret =request_firmware (&fw, stir421x_fw_name, &self->usbdev->dev);if (ret <0 )return ret;
drivers/net/wireless/ath/ath9k/hif_usb.c +3 -0
@@ -1143,6 +1143,9 @@ static int send_eject_command(struct usb_interface *interface)u8 bulk_out_ep;int r; +if (iface_desc->desc.bNumEndpoints <2 ) +return -ENODEV ; +/* Find bulk out endpoint */ for (r =1 ; r >=0 ; r--) { endpoint = &iface_desc->endpoint[r].desc;
drivers/net/wireless/mwifiex/pcie.c +7 -0
@@ -930,6 +930,7 @@ static int mwifiex_pcie_delete_cmdrsp_buf(struct mwifiex_adapter *adapter)if (card && card->cmd_buf) {mwifiex_unmap_pci_memory (adapter, card->cmd_buf,PCI_DMA_TODEVICE ); +dev_kfree_skb_any (card->cmd_buf); }return 0 ; }
@@ -1485,6 +1486,11 @@ mwifiex_pcie_send_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb)return -1 ; card->cmd_buf = skb; +/* +* Need to keep a reference, since core driver might free up this +* buffer before we've unmapped it. +*/ +skb_get (skb);/* To send a command, the driver will: 1. Write the 64bit physical address of the data buffer to
@@ -1581,6 +1587,7 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)if (card->cmd_buf) {mwifiex_unmap_pci_memory (adapter, card->cmd_buf,PCI_DMA_TODEVICE ); +dev_kfree_skb_any (card->cmd_buf); card->cmd_buf =NULL ; }
drivers/of/address.c +1 -1
@@ -260,7 +260,7 @@ struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser,if (!parser->range || parser->range + parser->np > parser->end)return NULL ; - range->pci_space = parser->range[0 ]; + range->pci_space =be32_to_cpup (parser->range); range->flags =of_bus_pci_get_flags (parser->range); range->pci_addr =of_read_number (parser->range +1 , ns); range->cpu_addr = of_translate_address(parser->node,
drivers/of/fdt.c +3 -0
@@ -380,6 +380,9 @@ static void __unflatten_device_tree(void *blob,/* Allocate memory for the expanded device tree */ mem =dt_alloc (size +4 , __alignof__(struct device_node )); +if (!mem) +return ; +memset (mem,0 , size); *(__be32 *)(mem + size) =cpu_to_be32 (0xdeadbeef );
drivers/pci/pci-sysfs.c +7 -3
@@ -964,15 +964,19 @@ void pci_remove_legacy_files(struct pci_bus *b)int pci_mmap_fits (struct pci_dev *pdev,int resno,struct vm_area_struct *vma,enum pci_mmap_api mmap_api) { -unsigned long nr, start, size, pci_start; +unsigned long nr, start, size; +resource_size_t pci_start =0 , pci_end;if (pci_resource_len (pdev, resno) ==0 )return 0 ; nr =vma_pages (vma); start = vma->vm_pgoff; size = ((pci_resource_len (pdev, resno) -1 ) >>PAGE_SHIFT ) +1 ; - pci_start = (mmap_api ==PCI_MMAP_PROCFS ) ? -pci_resource_start (pdev, resno) >>PAGE_SHIFT :0 ; +if (mmap_api ==PCI_MMAP_PROCFS ) { +pci_resource_to_user (pdev, resno, &pdev->resource[resno], + &pci_start, &pci_end); + pci_start >>=PAGE_SHIFT ; + }if (start >= pci_start && start < pci_start + size && start + nr <= pci_start + size)return 1 ;
drivers/pci/pci.c +5 -4
@@ -1685,8 +1685,8 @@ static void pci_pme_list_scan(struct work_struct *work) } }if (!list_empty (&pci_pme_list)) -schedule_delayed_work (&pci_pme_work, -msecs_to_jiffies (PME_TIMEOUT )); +queue_delayed_work (system_freezable_wq, &pci_pme_work, +msecs_to_jiffies (PME_TIMEOUT ));mutex_unlock (&pci_pme_list_mutex); }
@@ -1746,8 +1746,9 @@ void pci_pme_active(struct pci_dev *dev, bool enable)mutex_lock (&pci_pme_list_mutex);list_add (&pme_dev->list, &pci_pme_list);if (list_is_singular (&pci_pme_list)) -schedule_delayed_work (&pci_pme_work, -msecs_to_jiffies (PME_TIMEOUT )); +queue_delayed_work (system_freezable_wq, + &pci_pme_work, +msecs_to_jiffies (PME_TIMEOUT ));mutex_unlock (&pci_pme_list_mutex); }else {mutex_lock (&pci_pme_list_mutex);
drivers/regulator/tps65023-regulator.c +1 -2
@@ -290,8 +290,7 @@ static int tps_65023_probe(struct i2c_client *client,/* Enable setting output voltage by I2C */ regmap_update_bits (tps->regmap,TPS65023_REG_CON_CTRL2 , -TPS65023_REG_CTRL2_CORE_ADJ , -TPS65023_REG_CTRL2_CORE_ADJ ); +TPS65023_REG_CTRL2_CORE_ADJ ,0 );return 0 ; }
drivers/tty/tty_ldisc.c +7 -0
@@ -414,6 +414,10 @@ EXPORT_SYMBOL_GPL(tty_ldisc_flush);* they are not on hot paths so a little discipline won't do * any harm. * +* The line discipline-related tty_struct fields are reset to +* prevent the ldisc driver from re-using stale information for +* the new ldisc instance. +* * Locking: takes termios_rwsem */
@@ -422,6 +426,9 @@ static void tty_set_termios_ldisc(struct tty_struct *tty, int num)down_write (&tty->termios_rwsem); tty->termios.c_line = num;up_write (&tty->termios_rwsem); + + tty->disc_data =NULL ; + tty->receive_room =0 ; }/**
drivers/usb/class/cdc-acm.c +9 -4
@@ -315,6 +315,12 @@ static void acm_ctrl_irq(struct urb *urb)break ;case USB_CDC_NOTIFY_SERIAL_STATE : +if (le16_to_cpu (dr->wLength) !=2 ) { +dev_dbg (&acm->control->dev, +"%s - malformed serial state\n" , __func__); +break ; + } + newctrl =get_unaligned_le16 (data);if (!acm->clocal && (acm->ctrlin & ~newctrl &ACM_CTRL_DCD )) {
@@ -351,11 +357,10 @@ static void acm_ctrl_irq(struct urb *urb)default :dev_dbg (&acm->control->dev, -"%s - unknown notification %d received: index %d " -"len %d data0 %d data1 %d\n" , +"%s - unknown notification %d received: index %d len %d\n" , __func__, - dr->bNotificationType, dr->wIndex, - dr->wLength, data[0 ], data[1 ]); + dr->bNotificationType, dr->wIndex, dr->wLength); +break ; } exit:
drivers/usb/core/devio.c +2 -2
@@ -373,11 +373,11 @@ static void snoop_urb(struct usb_device *udev,if (userurb) {/* Async */ if (when ==SUBMIT ) -dev_info (&udev->dev,"userurb %p, ep%d %s-%s, " +dev_info (&udev->dev,"userurb %pK, ep%d %s-%s, " "length %u\n" , userurb, ep, t, d, length);else -dev_info (&udev->dev,"userurb %p, ep%d %s-%s, " +dev_info (&udev->dev,"userurb %pK, ep%d %s-%s, " "actual_length %u status %d\n" , userurb, ep, t, d, length, timeout_or_status);
drivers/usb/core/hcd.c +2 -2
@@ -1642,7 +1642,7 @@ int usb_hcd_unlink_urb (struct urb *urb, int status)if (retval ==0 ) retval = -EINPROGRESS ;else if (retval != -EIDRM && retval != -EBUSY ) -dev_dbg (&udev->dev,"hcd_unlink_urb %p fail %d\n" , +dev_dbg (&udev->dev,"hcd_unlink_urb %pK fail %d\n" , urb, retval);usb_put_dev (udev); }
@@ -1809,7 +1809,7 @@ rescan:/* kick hcd */ unlink1 (hcd, urb, -ESHUTDOWN ); dev_dbg (hcd->self.controller, - "shutdown urb %p ep%d%s%s\n", + "shutdown urb %pK ep%d%s%s\n", urb, usb_endpoint_num(&ep->desc), is_in ? "in" : "out", ({ char *s;
drivers/usb/core/hub.c +14 -5
@@ -359,7 +359,8 @@ static void usb_set_lpm_parameters(struct usb_device *udev) }/* USB 2.0 spec Section 11.24.4.5 */ -static int get_hub_descriptor (struct usb_device *hdev,void *data) +static int get_hub_descriptor (struct usb_device *hdev, +struct usb_hub_descriptor *desc) {int i, ret, size;unsigned dtype;
@@ -375,10 +376,18 @@ static int get_hub_descriptor(struct usb_device *hdev, void *data)for (i =0 ; i <3 ; i++) { ret =usb_control_msg (hdev,usb_rcvctrlpipe (hdev,0 ),USB_REQ_GET_DESCRIPTOR ,USB_DIR_IN |USB_RT_HUB , - dtype <<8 ,0 , data, size, + dtype <<8 ,0 , desc, size,USB_CTRL_GET_TIMEOUT ); -if (ret >= (USB_DT_HUB_NONVAR_SIZE +2 )) +if (hub_is_superspeed (hdev)) { +if (ret == size) +return ret; + }else if (ret >=USB_DT_HUB_NONVAR_SIZE +2 ) { +/* Make sure we have the DeviceRemovable field. */ + size =USB_DT_HUB_NONVAR_SIZE + desc->bNbrPorts /8 +1 ; +if (ret < size) +return -EMSGSIZE ;return ret; + } }return -EINVAL ; }
@@ -1323,7 +1332,7 @@ static int hub_configure(struct usb_hub *hub, }mutex_init (&hub->status_mutex); - hub->descriptor =kmalloc (sizeof (*hub->descriptor),GFP_KERNEL ); + hub->descriptor =kzalloc (sizeof (*hub->descriptor),GFP_KERNEL );if (!hub->descriptor) { ret = -ENOMEM ; goto fail;
@@ -1331,7 +1340,7 @@ static int hub_configure(struct usb_hub *hub,/* Request the entire hub descriptor. * hub->descriptor can handle USB_MAXCHILDREN ports, -* but the hub can/will return fewer bytes here. +* but a (non-SS) hub can/will return fewer bytes here. */ ret =get_hub_descriptor (hdev, hub->descriptor);if (ret <0 ) {
drivers/usb/core/urb.c +1 -1
@@ -336,7 +336,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)if (!urb || !urb->complete)return -EINVAL ;if (urb->hcpriv) { -WARN_ONCE (1 ,"URB %p submitted while active\n" , urb); +WARN_ONCE (1 ,"URB %pK submitted while active\n" , urb);return -EBUSY ; }
drivers/usb/host/xhci-mem.c +1 -1
@@ -1676,7 +1676,7 @@ static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) xhci->dcbaa->dev_context_ptrs[0 ] =cpu_to_le64 (xhci->scratchpad->sp_dma);for (i =0 ; i < num_sp; i++) {dma_addr_t dma; -void *buf =dma_alloc_coherent (dev, xhci->page_size, &dma, +void *buf =dma_zalloc_coherent (dev, xhci->page_size, &dma, flags);if (!buf) goto fail_sp5;
drivers/usb/host/xhci-plat.c +1 -1
@@ -81,7 +81,7 @@ static int xhci_plat_probe(struct platform_device *pdev) irq =platform_get_irq (pdev,0 );if (irq <0 ) -return -ENODEV ; +return irq; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );if (!res)
drivers/usb/misc/iowarrior.c +1 -1
@@ -557,7 +557,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd, info.revision =le16_to_cpu (dev->udev->descriptor.bcdDevice);/* 0==UNKNOWN, 1==LOW(usb1.1) ,2=FULL(usb1.1), 3=HIGH(usb2.0) */ - info.speed =le16_to_cpu (dev->udev->speed); + info.speed = dev->udev->speed; info.if_num = dev->interface->cur_altsetting->desc.bInterfaceNumber; info.report_size = dev->report_size;
drivers/usb/misc/legousbtower.c +1 -0
@@ -954,6 +954,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device exit: +kfree (get_version_reply);return retval; error:
drivers/usb/musb/tusb6010_omap.c +9 -4
@@ -220,6 +220,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,u32 dma_remaining;int src_burst, dst_burst;u16 csr; +u32 psize;int ch;s8 dmareq;s8 sync_dev;
@@ -391,15 +392,19 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,if (chdat->tx) {/* Send transfer_packet_sz packets at a time */ -musb_writel (ep_conf,TUSB_EP_MAX_PACKET_SIZE_OFFSET , - chdat->transfer_packet_sz); + psize =musb_readl (ep_conf,TUSB_EP_MAX_PACKET_SIZE_OFFSET ); + psize &= ~0x7ff ; + psize |= chdat->transfer_packet_sz; +musb_writel (ep_conf,TUSB_EP_MAX_PACKET_SIZE_OFFSET , psize);musb_writel (ep_conf,TUSB_EP_TX_OFFSET ,TUSB_EP_CONFIG_XFR_SIZE (chdat->transfer_len)); }else {/* Receive transfer_packet_sz packets at a time */ -musb_writel (ep_conf,TUSB_EP_MAX_PACKET_SIZE_OFFSET , - chdat->transfer_packet_sz <<16 ); + psize =musb_readl (ep_conf,TUSB_EP_MAX_PACKET_SIZE_OFFSET ); + psize &= ~(0x7ff <<16 ); + psize |= (chdat->transfer_packet_sz <<16 ); +musb_writel (ep_conf,TUSB_EP_MAX_PACKET_SIZE_OFFSET , psize);musb_writel (ep_conf,TUSB_EP_RX_OFFSET ,TUSB_EP_CONFIG_XFR_SIZE (chdat->transfer_len));
drivers/usb/serial/ftdi_sio.c +5 -5
@@ -809,10 +809,10 @@ static const struct usb_device_id id_table_combined[] = { { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, - { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), - .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, - { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), - .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) }, + { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) }, + { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) }, + { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) }, { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID),
@@ -1506,9 +1506,9 @@ static int set_serial_info(struct tty_struct *tty, (new_serial.flags & ASYNC_FLAGS)); priv->custom_divisor = new_serial.custom_divisor; +check_and_exit:write_latency_timer (port); -check_and_exit:if ((old_priv.flags &ASYNC_SPD_MASK ) != (priv->flags &ASYNC_SPD_MASK )) {if ((priv->flags &ASYNC_SPD_MASK ) ==ASYNC_SPD_HI )
drivers/usb/serial/ftdi_sio_ids.h +2 -0
@@ -876,6 +876,8 @@/* Olimex */ #define OLIMEX_VID 0x15BA#define OLIMEX_ARM_USB_OCD_PID 0x0003 +#define OLIMEX_ARM_USB_TINY_PID 0x0004 +#define OLIMEX_ARM_USB_TINY_H_PID 0x002a#define OLIMEX_ARM_USB_OCD_H_PID 0x002b/*
drivers/usb/serial/io_ti.c +4 -1
@@ -2210,8 +2210,11 @@ static void change_port_settings(struct tty_struct *tty,if (!baud) {/* pick a default, any default... */ baud =9600 ; - }else + }else { +/* Avoid a zero divisor. */ + baud =min (baud,461550 );tty_encode_baud_rate (tty, baud, baud); + } edge_port->baud_rate = baud; config->wBaudRate = (__u16)((461550L + baud/2 ) / baud);
drivers/usb/serial/mct_u232.c +1 -1
@@ -189,7 +189,7 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,return -ENOMEM ; divisor =mct_u232_calculate_baud_rate (serial, value, &speed); -put_unaligned_le32 (cpu_to_le32 (divisor), buf); +put_unaligned_le32 (divisor, buf); rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), MCT_U232_SET_BAUD_RATE_REQUEST, MCT_U232_SET_REQUEST_TYPE,
drivers/usb/serial/option.c +8 -0
@@ -275,6 +275,7 @@ static void option_instat_callback(struct urb *urb);#define TELIT_PRODUCT_LE922_USBCFG0 0x1042#define TELIT_PRODUCT_LE922_USBCFG3 0x1043#define TELIT_PRODUCT_LE922_USBCFG5 0x1045 +#define TELIT_PRODUCT_ME910 0x1100#define TELIT_PRODUCT_LE920 0x1200#define TELIT_PRODUCT_LE910 0x1201#define TELIT_PRODUCT_LE910_USBCFG4 0x1206
@@ -637,6 +638,11 @@ static const struct option_blacklist_info simcom_sim7100e_blacklist = { .reserved = BIT(5) | BIT(6), }; +static const struct option_blacklist_info telit_me910_blacklist = { + .sendsetup =BIT (0 ), + .reserved =BIT (1 ) |BIT (3 ), +}; +static const struct option_blacklist_info telit_le910_blacklist = { .sendsetup =BIT (0 ), .reserved =BIT (1 ) |BIT (2 ),
@@ -1233,6 +1239,8 @@ static const struct usb_device_id option_ids[] = { .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff), .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), + .driver_info = (kernel_ulong_t)&telit_me910_blacklist }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
drivers/usb/serial/qcserial.c +2 -0
@@ -156,6 +156,8 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI(0x1199, 0x9071)}, /* Sierra Wireless MC74xx */ {DEVICE_SWI(0x1199, 0x9078)}, /* Sierra Wireless EM74xx */ {DEVICE_SWI(0x1199, 0x9079)}, /* Sierra Wireless EM74xx */ + {DEVICE_SWI(0x1199, 0x907a)}, /* Sierra Wireless EM74xx QDL */ + {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */ {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
drivers/usb/storage/ene_ub6250.c +55 -35
254 lines not on this page · raw message
drivers/uwb/i1480/dfu/usb.c +3 -2
@@ -341,6 +341,7 @@ error_submit_ep1:static int i1480_usb_probe (struct usb_interface *iface,const struct usb_device_id *id) { +struct usb_device *udev =interface_to_usbdev (iface);struct i1480_usb *i1480_usb;struct i1480 *i1480;struct device *dev = &iface->dev;
@@ -352,8 +353,8 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) iface->cur_altsetting->desc.bInterfaceNumber); goto error; } -if (iface->num_altsetting >1 - &&interface_to_usbdev (iface)->descriptor.idProduct ==0xbabe ) { +if (iface->num_altsetting >1 && +le16_to_cpu (udev->descriptor.idProduct) ==0xbabe ) {/* Need altsetting #1 [HW QUIRK] or EP1 won't work */ result =usb_set_interface (interface_to_usbdev (iface),0 ,1 );if (result <0 )
drivers/watchdog/pcwd_usb.c +3 -0
@@ -630,6 +630,9 @@ static int usb_pcwd_probe(struct usb_interface *interface,return -ENODEV ; } +if (iface_desc->desc.bNumEndpoints <1 ) +return -ENODEV ; +/* check out the endpoint: it has to be Interrupt & IN */ endpoint = &iface_desc->endpoint[0 ].desc;
include/linux/kprobes.h +3 -1
@@ -327,7 +327,9 @@ extern int proc_kprobes_optimization_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos);#endif - +extern void wait_for_kprobe_optimizer (void ); +#else +static inline void wait_for_kprobe_optimizer (void ) { }#endif /* CONFIG_OPTPROBES */ #ifdef CONFIG_KPROBES_ON_FTRACE extern void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
kernel/fork.c +1 -1
@@ -338,7 +338,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)set_task_stack_end_magic (tsk);#ifdef CONFIG_CC_STACKPROTECTOR - tsk->stack_canary =get_random_int (); + tsk->stack_canary =get_random_long ();#endif /*
kernel/kprobes.c +1 -1
@@ -563,7 +563,7 @@ static void kprobe_optimizer(struct work_struct *work) }/* Wait for completing optimization and unoptimization */ -static void wait_for_kprobe_optimizer (void ) +void wait_for_kprobe_optimizer (void ) {mutex_lock (&kprobe_mutex);
kernel/pid_namespace.c +1 -1
@@ -234,7 +234,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)* Make sure they all go away, see free_pid(). */ for (;;) { -set_current_state (TASK_UNINTERRUPTIBLE ); +set_current_state (TASK_INTERRUPTIBLE );if (pid_ns->nr_hashed == init_pids)break ;schedule ();
kernel/trace/trace_kprobe.c +5 -0
@@ -1484,6 +1484,11 @@ static __init int kprobe_trace_self_tests_init(void) end:release_all_trace_kprobes (); +/* +* Wait for the optimizer work to finish. Otherwise it might fiddle +* with probes in already freed __init text. +*/ +wait_for_kprobe_optimizer ();if (warn)pr_cont ("NG: Some tests are failed. Please check them.\n" );else
mm/huge_memory.c +11 -1
@@ -1205,6 +1205,16 @@ out_unlock:return ret; } +/* +* FOLL_FORCE can write to even unwritable pmd's, but only +* after we've gone through a COW cycle and they are dirty. +*/ +static inline bool can_follow_write_pmd (pmd_t pmd,unsigned int flags) +{ +return pmd_write (pmd) || + ((flags &FOLL_FORCE ) && (flags &FOLL_COW ) &&pmd_dirty (pmd)); +} + struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd,
@@ -1215,7 +1225,7 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,assert_spin_locked (pmd_lockptr (mm, pmd)); -if (flags &FOLL_WRITE && !pmd_write (*pmd)) +if (flags &FOLL_WRITE && !can_follow_write_pmd (*pmd, flags)) goto out;/* Avoid dumping huge zero page */
net/ipx/af_ipx.c +2 -3
@@ -1168,11 +1168,10 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg) sipx->sipx_network = ipxif->if_netnum;memcpy (sipx->sipx_node, ipxif->if_node,sizeof (sipx->sipx_node)); - rc = -EFAULT ; + rc =0 ;if (copy_to_user (arg, &ifr,sizeof (ifr))) -break ; + rc = -EFAULT ;ipxitf_put (ipxif); - rc =0 ;break ; }case SIOCAIPXITFCRT :
security/integrity/ima/ima_appraise.c +3 -2
@@ -203,10 +203,11 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, cause ="missing-hash" ; status =INTEGRITY_NOLABEL ; -if (opened &FILE_CREATED ) { +if (opened &FILE_CREATED ) iint->flags |=IMA_NEW_FILE ; +if ((iint->flags &IMA_NEW_FILE ) && + !(iint->flags &IMA_DIGSIG_REQUIRED )) status =INTEGRITY_PASS ; - } goto out; }