Linux 4.4.93
Greg KH
maintainerI'm announcing the release of the 4.4.93 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 - arch/mips/math-emu/cp1emu.c | 2 - arch/x86/include/asm/alternative-asm.h | 4 ++- arch/x86/include/asm/alternative.h | 6 ++-- arch/x86/kvm/vmx.c | 2 - block/bio.c | 8 ++++++ crypto/shash.c | 8 +++--- drivers/dma/edma.c | 19 ++++++++++++-- drivers/hid/usbhid/hid-core.c | 12 ++++++++- drivers/iommu/amd_iommu.c | 1 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 18 +++++++++++--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 10 +++++++ drivers/usb/gadget/composite.c | 5 +++ drivers/usb/gadget/udc/dummy_hcd.c | 9 ++++--- drivers/usb/renesas_usbhs/fifo.c | 2 - drivers/usb/serial/console.c | 1 drivers/usb/serial/cp210x.c | 1 drivers/usb/serial/ftdi_sio.c | 2 + drivers/usb/serial/ftdi_sio_ids.h | 7 +++++ drivers/usb/serial/option.c | 2 + drivers/usb/serial/qcserial.c | 4 +++ fs/cifs/cifsglob.h | 2 + fs/cifs/cifssmb.c | 7 +++++ fs/cifs/connect.c | 7 +++++ fs/cifs/smb2ops.c | 16 ++++++++++++ fs/direct-io.c | 3 +- fs/ext4/file.c | 4 +-- include/sound/seq_virmidi.h | 1 kernel/rcu/tree.c | 12 +++++++++ net/wireless/nl80211.c | 12 +++++++-- sound/core/seq/seq_clientmgr.c | 6 +++- sound/core/seq/seq_ports.c | 7 +++-- sound/core/seq/seq_virmidi.c | 27 ++++++++++++++------- sound/usb/caiaq/device.c | 12 +++++++-- sound/usb/line6/driver.c | 7 +++-- sound/usb/mixer.c | 12 +++++++-- sound/usb/mixer.h | 2 + 37 files changed, 215 insertions(+), 47 deletions(-)
Alan Stern (1):
USB: dummy-hcd: Fix deadlock caused by disconnect detection
Andreas Engel (1):
USB: serial: cp210x: add support for ELV TFD500
Andreas Gruenbacher (1):
direct-io: Prevent NULL pointer access in submit_page_section
Andrew Gabbasov (1):
usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options
Arend Van Spriel (1):
brcmfmac: add length check in brcmf_cfg80211_escan_handler()
Darrick J. Wong (1):
ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets
Greg Kroah-Hartman (1):
Linux 4.4.93
Haozhong Zhang (1):
KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit
Henryk Heisig (1):
USB: serial: option: add support for TP-Link LTE module
Herbert Xu (1):
crypto: shash - Fix zero-length shash ahash digest crash
Jaejoong Kim (1):
HID: usbhid: fix out-of-bounds bug
Jeffrey Chu (1):
USB: serial: ftdi_sio: add id for Cypress WICED dev board
Joerg Roedel (1):
iommu/amd: Finish TLB flush in amd_iommu_unmap()
Johan Hovold (1):
USB: serial: console: fix use-after-free after failed setup
Kazuya Mizuguchi (1):
usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet
Luca Coelho (1):
iwlwifi: mvm: use IWL_HCMD_NOCOPY for MCAST_FILTER_CMD
Mathias Krause (1):
x86/alternatives: Fix alt_max_short macro to really be a max()
Paul Burton (1):
MIPS: math-emu: Remove pr_err() calls from fpu_emu()
Paul E. McKenney (1):
rcu: Allow for page faults in NMI handlers
Pavel Shilovsky (1):
CIFS: Reconnect expired SMB sessions
Peng Xu (1):
nl80211: Define policy for packet pattern attributes
Peter Ujfalusi (1):
dmaengine: edma: Align the memcpy acnt array size with the transfer
Shrirang Bagul (1):
USB: serial: qcserial: add Dell DW5818, DW5819
Takashi Iwai (5):
ALSA: usb-audio: Kill stray URB at exiting
ALSA: seq: Fix use-after-free at creating a port
ALSA: seq: Fix copy_from_user() call inside lock
ALSA: caiaq: Fix stray URB at probe error path
ALSA: line6: Fix leftover URB at error-path during probe
Vitaly Mayatskikh (1):
fix unbalanced page refcounting in bio_map_user_iov
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 92 +SUBLEVEL = 93 EXTRAVERSION = NAME = Blurry Fish Butt
arch/mips/math-emu/cp1emu.c +0 -2
@@ -2360,7 +2360,6 @@ dcopuop:break ;default :/* Reserved R6 ops */ -pr_err ("Reserved MIPS R6 CMP.condn.S operation\n" );return SIGILL ; } }
@@ -2434,7 +2433,6 @@ dcopuop:break ;default :/* Reserved R6 ops */ -pr_err ("Reserved MIPS R6 CMP.condn.D operation\n" );return SIGILL ; } }
arch/x86/include/asm/alternative-asm.h +3 -1
@@ -62,8 +62,10 @@#define new_len2 145f-144f/* -* max without conditionals. Idea adapted from: +* gas compatible max based on the idea from: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax +* +* The additional "-" is needed because gas uses a "true" value of -1. */ #define alt_max_short (a, b) ((a) ^ (((a) ^ (b)) & -(-((a) < (b)))))
arch/x86/include/asm/alternative.h +3 -3
@@ -102,12 +102,12 @@ static inline int alternatives_text_reserved(void *start, void *end) alt_end_marker":\n" /* -* max without conditionals. Idea adapted from: +* gas compatible max based on the idea from: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax * -* The additional "-" is needed because gas works with s32s. +* The additional "-" is needed because gas uses a "true" value of -1. */ -#define alt_max_short (a, b) "((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") - (" b ")))))" +#define alt_max_short (a, b) "((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") < (" b ")))))"/* * Pad the second replacement alternative with additional NOPs if it is
arch/x86/kvm/vmx.c +1 -1
@@ -10369,7 +10369,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,* (KVM doesn't change it)- no reason to call set_cr4_guest_host_mask(); */ vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl (CR4_GUEST_HOST_MASK ); -kvm_set_cr4 (vcpu, vmcs12->host_cr4); +vmx_set_cr4 (vcpu, vmcs12->host_cr4);nested_ept_uninit_mmu_context (vcpu);
block/bio.c +8 -0
@@ -1320,6 +1320,7 @@ struct bio *bio_map_user_iov(struct request_queue *q, offset = uaddr & ~PAGE_MASK ;for (j = cur_page; j < page_limit; j++) {unsigned int bytes =PAGE_SIZE - offset; +unsigned short prev_bi_vcnt = bio->bi_vcnt;if (len <=0 )break ;
@@ -1334,6 +1335,13 @@ struct bio *bio_map_user_iov(struct request_queue *q, bytes)break ; +/* +* check if vector was merged with previous +* drop page reference if needed +*/ +if (bio->bi_vcnt == prev_bi_vcnt) +put_page (pages[j]); + len -= bytes; offset =0 ; }
crypto/shash.c +5 -3
@@ -274,12 +274,14 @@ static int shash_async_finup(struct ahash_request *req)int shash_ahash_digest (struct ahash_request *req,struct shash_desc *desc) { -struct scatterlist *sg = req->src; -unsigned int offset = sg->offset;unsigned int nbytes = req->nbytes; +struct scatterlist *sg; +unsigned int offset;int err; -if (nbytes <min (sg->length, ((unsigned int )(PAGE_SIZE )) - offset)) { +if (nbytes && + (sg = req->src, offset = sg->offset, + nbytes <min (sg->length, ((unsigned int )(PAGE_SIZE )) - offset))) {void *data; data =kmap_atomic (sg_page (sg));
drivers/dma/edma.c +16 -3
@@ -1126,11 +1126,24 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy(struct edma_desc *edesc;struct device *dev = chan->device->dev;struct edma_chan *echan =to_edma_chan (chan); -unsigned int width, pset_len; +unsigned int width, pset_len, array_size;if (unlikely (!echan || !len))return NULL ; +/* Align the array size (acnt block) with the transfer properties */ +switch (__ffs ((src | dest | len))) { +case 0 : + array_size =SZ_32K -1 ; +break ; +case 1 : + array_size =SZ_32K -2 ; +break ; +default : + array_size =SZ_32K -4 ; +break ; + } +if (len <SZ_64K ) {/* * Transfer size less than 64K can be handled with one paRAM
@@ -1152,7 +1165,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy(* When the full_length is multibple of 32767 one slot can be * used to complete the transfer. */ - width =SZ_32K -1 ; + width = array_size; pset_len =rounddown (len, width);/* One slot is enough for lengths multiple of (SZ_32K -1) */ if (unlikely (pset_len == len))
@@ -1202,7 +1215,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy( } dest += pset_len; src += pset_len; - pset_len = width = len % (SZ_32K -1 ); + pset_len = width = len % array_size; ret =edma_config_pset (chan, &edesc->pset[1 ], src, dest,1 , width, pset_len,DMA_MEM_TO_MEM );
drivers/hid/usbhid/hid-core.c +11 -1
@@ -971,6 +971,8 @@ static int usbhid_parse(struct hid_device *hid)unsigned int rsize =0 ;char *rdesc;int ret, n; +int num_descriptors; +size_t offset = offsetof(struct hid_descriptor , desc); quirks =usbhid_lookup_quirk (le16_to_cpu (dev->descriptor.idVendor),le16_to_cpu (dev->descriptor.idProduct));
@@ -993,10 +995,18 @@ static int usbhid_parse(struct hid_device *hid)return -ENODEV ; } +if (hdesc->bLength <sizeof (struct hid_descriptor )) { +dbg_hid ("hid descriptor is too short\n" ); +return -EINVAL ; + } + hid->version =le16_to_cpu (hdesc->bcdHID); hid->country = hdesc->bCountryCode; -for (n =0 ; n < hdesc->bNumDescriptors; n++) + num_descriptors =min_t (int, hdesc->bNumDescriptors, + (hdesc->bLength - offset) /sizeof (struct hid_class_descriptor )); + +for (n =0 ; n < num_descriptors; n++)if (hdesc->desc[n].bDescriptorType ==HID_DT_REPORT ) rsize =le16_to_cpu (hdesc->desc[n].wDescriptorLength);
drivers/iommu/amd_iommu.c +1 -0
@@ -3096,6 +3096,7 @@ static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova,mutex_unlock (&domain->api_lock);domain_flush_tlb_pde (domain); +domain_flush_complete (domain);return unmap_size; }
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +15 -3
@@ -2903,6 +2903,7 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,struct brcmf_cfg80211_info *cfg = ifp->drvr->config;s32 status;struct brcmf_escan_result_le *escan_result_le; +u32 escan_buflen;struct brcmf_bss_info_le *bss_info_le;struct brcmf_bss_info_le *bss =NULL ;u32 bi_length;
@@ -2919,11 +2920,23 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,if (status ==BRCMF_E_STATUS_PARTIAL ) {brcmf_dbg (SCAN ,"ESCAN Partial result\n" ); +if (e->datalen <sizeof (*escan_result_le)) { +brcmf_err ("invalid event data length\n" ); + goto exit; + } escan_result_le = (struct brcmf_escan_result_le *) data;if (!escan_result_le) {brcmf_err ("Invalid escan result (NULL pointer)\n" ); goto exit; } + escan_buflen =le32_to_cpu (escan_result_le->buflen); +if (escan_buflen >WL_ESCAN_BUF_SIZE || + escan_buflen > e->datalen || + escan_buflen <sizeof (*escan_result_le)) { +brcmf_err ("Invalid escan buffer length: %d\n" , + escan_buflen); + goto exit; + }if (le16_to_cpu (escan_result_le->bss_count) !=1 ) {brcmf_err ("Invalid bss_count %d: ignoring\n" , escan_result_le->bss_count);
@@ -2940,9 +2953,8 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp, } bi_length =le32_to_cpu (bss_info_le->length); -if (bi_length != (le32_to_cpu (escan_result_le->buflen) - -WL_ESCAN_RESULTS_FIXED_SIZE )) { -brcmf_err ("Invalid bss_info length %d: ignoring\n" , +if (bi_length != escan_buflen -WL_ESCAN_RESULTS_FIXED_SIZE ) { +brcmf_err ("Ignoring invalid bss_info length: %d\n" , bi_length); goto exit; }
drivers/net/wireless/iwlwifi/mvm/mac80211.c +9 -1
@@ -1906,6 +1906,11 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,struct iwl_mvm_mc_iter_data *data = _data;struct iwl_mvm *mvm = data->mvm;struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; +struct iwl_host_cmd hcmd = { + .id =MCAST_FILTER_CMD , + .flags =CMD_ASYNC , + .dataflags[0 ] =IWL_HCMD_DFL_NOCOPY , + };int ret, len;/* if we don't have free ports, mcast frames will be dropped */
@@ -1920,7 +1925,10 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,memcpy (cmd->bssid, vif->bss_conf.bssid,ETH_ALEN ); len =roundup (sizeof (*cmd) + cmd->count *ETH_ALEN ,4 ); - ret =iwl_mvm_send_cmd_pdu (mvm,MCAST_FILTER_CMD ,CMD_ASYNC , len, cmd); + hcmd.len[0 ] = len; + hcmd.data[0 ] = cmd; + + ret =iwl_mvm_send_cmd (mvm, &hcmd);if (ret)IWL_ERR (mvm,"mcast filter cmd error. ret=%d\n" , ret); }
drivers/usb/gadget/composite.c +5 -0
@@ -1905,6 +1905,8 @@ static DEVICE_ATTR_RO(suspended);static void __composite_unbind (struct usb_gadget *gadget,bool unbind_driver) {struct usb_composite_dev *cdev =get_gadget_data (gadget); +struct usb_gadget_strings *gstr = cdev->driver->strings[0 ]; +struct usb_string *dev_str = gstr->strings;/* composite_disconnect() must already have been called * by the underlying peripheral controller driver!
@@ -1924,6 +1926,9 @@ static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver)composite_dev_cleanup (cdev); +if (dev_str[USB_GADGET_MANUFACTURER_IDX ].s == cdev->def_manufacturer) + dev_str[USB_GADGET_MANUFACTURER_IDX ].s ="" ; +kfree (cdev->def_manufacturer);kfree (cdev);set_gadget_data (gadget,NULL );
drivers/usb/gadget/udc/dummy_hcd.c +6 -3
@@ -420,6 +420,7 @@ static void set_link_state_by_speed(struct dummy_hcd *dum_hcd)static void set_link_state (struct dummy_hcd *dum_hcd) {struct dummy *dum = dum_hcd->dum; +unsigned int power_bit; dum_hcd->active =0 ;if (dum->pullup)
@@ -430,17 +431,19 @@ static void set_link_state(struct dummy_hcd *dum_hcd)return ;set_link_state_by_speed (dum_hcd); + power_bit = (dummy_hcd_to_hcd (dum_hcd)->speed ==HCD_USB3 ? +USB_SS_PORT_STAT_POWER :USB_PORT_STAT_POWER );if ((dum_hcd->port_status &USB_PORT_STAT_ENABLE ) ==0 || dum_hcd->active) dum_hcd->resuming =0 ;/* Currently !connected or in reset */ -if ((dum_hcd->port_status &USB_PORT_STAT_CONNECTION ) ==0 || +if ((dum_hcd->port_status & power_bit) ==0 || (dum_hcd->port_status &USB_PORT_STAT_RESET ) !=0 ) { -unsigned disconnect =USB_PORT_STAT_CONNECTION & +unsigned int disconnect = power_bit & dum_hcd->old_status & (~dum_hcd->port_status); -unsigned reset =USB_PORT_STAT_RESET & +unsigned int reset =USB_PORT_STAT_RESET & (~dum_hcd->old_status) & dum_hcd->port_status;/* Report reset and disconnect events to the driver */
drivers/usb/renesas_usbhs/fifo.c +1 -1
@@ -858,9 +858,9 @@ static void xfer_work(struct work_struct *work) fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero);usbhs_pipe_running (pipe,1 ); -usbhsf_dma_start (pipe, fifo);usbhs_pipe_set_trans_count_if_bulk (pipe, pkt->trans);dma_async_issue_pending (chan); +usbhsf_dma_start (pipe, fifo);usbhs_pipe_enable (pipe); xfer_work_end:
drivers/usb/serial/console.c +1 -0
@@ -189,6 +189,7 @@ static int usb_console_setup(struct console *co, char *options)tty_kref_put (tty); reset_open_count: port->port.count =0 ; + info->port =NULL ;usb_autopm_put_interface (serial->interface); error_get_interface:usb_serial_put (serial);
drivers/usb/serial/cp210x.c +1 -0
@@ -170,6 +170,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ + { USB_DEVICE(0x18EF, 0xE032) }, /* ELV TFD500 Data Logger */ { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -1015,6 +1015,8 @@ static const struct usb_device_id id_table_combined[] = { { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) }, + { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +7 -0
@@ -609,6 +609,13 @@#define ADI_GNICE_PID 0xF000#define ADI_GNICEPLUS_PID 0xF001 +/* +* Cypress WICED USB UART +*/ +#define CYPRESS_VID 0x04B4 +#define CYPRESS_WICED_BT_USB_PID 0x009B +#define CYPRESS_WICED_WL_USB_PID 0xF900 +/* * Microchip Technology, Inc. *
drivers/usb/serial/option.c +2 -0
@@ -522,6 +522,7 @@ static void option_instat_callback(struct urb *urb);/* TP-LINK Incorporated products */ #define TPLINK_VENDOR_ID 0x2357 +#define TPLINK_PRODUCT_LTE 0x000D#define TPLINK_PRODUCT_MA180 0x0201/* Changhong products */
@@ -2011,6 +2012,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) }, + { USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */ { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */
drivers/usb/serial/qcserial.c +4 -0
@@ -174,6 +174,10 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ + {DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */ + {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ + {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */ + {DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 *//* Huawei devices */ {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */
fs/cifs/cifsglob.h +2 -0
@@ -351,6 +351,8 @@ struct smb_version_operations {unsigned int (*calc_smb_size)(void *);/* check for STATUS_PENDING and process it in a positive case */ bool (*is_status_pending)(char *,struct TCP_Server_Info *,int ); +/* check for STATUS_NETWORK_SESSION_EXPIRED */ +bool (*is_session_expired)(char *);/* send oplock break response */ int (*oplock_response)(struct cifs_tcon *,struct cifs_fid *,struct cifsInodeInfo *);
fs/cifs/cifssmb.c +7 -0
@@ -1460,6 +1460,13 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)return length; server->total_read += length; +if (server->ops->is_session_expired && + server->ops->is_session_expired (buf)) { +cifs_reconnect (server); +wake_up (&server->response_q); +return -1 ; + } +if (server->ops->is_status_pending && server->ops->is_status_pending (buf, server,0 )) {discard_remaining_data (server);
fs/cifs/connect.c +7 -0
@@ -850,6 +850,13 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid)cifs_dump_mem ("Bad SMB: " , buf, min_t(unsigned int, server->total_read, 48)); +if (server->ops->is_session_expired && + server->ops->is_session_expired (buf)) { +cifs_reconnect (server); +wake_up (&server->response_q); +return -1 ; + } +if (server->ops->is_status_pending && server->ops->is_status_pending (buf, server, length))return -1 ;
fs/cifs/smb2ops.c +16 -0
@@ -963,6 +963,18 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length)return true; } +static bool +smb2_is_session_expired (char *buf) +{ +struct smb2_hdr *hdr = (struct smb2_hdr *)buf; + +if (hdr->Status !=STATUS_NETWORK_SESSION_EXPIRED ) +return false; + +cifs_dbg (FYI ,"Session expired\n" ); +return true; +} +static int smb2_oplock_response (struct cifs_tcon *tcon,struct cifs_fid *fid,struct cifsInodeInfo *cinode)
@@ -1552,6 +1564,7 @@ struct smb_version_operations smb20_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock,
@@ -1633,6 +1646,7 @@ struct smb_version_operations smb21_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock,
@@ -1715,6 +1729,7 @@ struct smb_version_operations smb30_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock,
@@ -1803,6 +1818,7 @@ struct smb_version_operations smb311_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock,
fs/direct-io.c +2 -1
@@ -823,7 +823,8 @@ out:*/ if (sdio->boundary) { ret =dio_send_cur_page (dio, sdio, map_bh); -dio_bio_submit (dio, sdio); +if (sdio->bio) +dio_bio_submit (dio, sdio);page_cache_release (sdio->cur_page); sdio->cur_page =NULL ; }
fs/ext4/file.c +2 -2
@@ -559,7 +559,7 @@ static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)mutex_lock (&inode->i_mutex); isize =i_size_read (inode); -if (offset >= isize) { +if (offset <0 || offset >= isize) {mutex_unlock (&inode->i_mutex);return -ENXIO ; }
@@ -632,7 +632,7 @@ static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize)mutex_lock (&inode->i_mutex); isize =i_size_read (inode); -if (offset >= isize) { +if (offset <0 || offset >= isize) {mutex_unlock (&inode->i_mutex);return -ENXIO ; }
include/sound/seq_virmidi.h +1 -0
@@ -60,6 +60,7 @@ struct snd_virmidi_dev {int port;/* created/attached port */ unsigned int flags;/* SNDRV_VIRMIDI_* */ rwlock_t filelist_lock; +struct rw_semaphore filelist_sem;struct list_head filelist; };
kernel/rcu/tree.c +12 -0
@@ -759,6 +759,12 @@ void rcu_irq_exit(void)local_irq_save (flags); rdtp =this_cpu_ptr (&rcu_dynticks); + +/* Page faults can happen in NMI handlers, so check... */ +if (READ_ONCE (rdtp->dynticks_nmi_nesting)) +return ; + +RCU_LOCKDEP_WARN (!irqs_disabled (),"rcu_irq_exit() invoked with irqs enabled!!!" ); oldval = rdtp->dynticks_nesting; rdtp->dynticks_nesting--; WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
@@ -887,6 +893,12 @@ void rcu_irq_enter(void)local_irq_save (flags); rdtp =this_cpu_ptr (&rcu_dynticks); + +/* Page faults can happen in NMI handlers, so check... */ +if (READ_ONCE (rdtp->dynticks_nmi_nesting)) +return ; + +RCU_LOCKDEP_WARN (!irqs_disabled (),"rcu_irq_enter() invoked with irqs enabled!!!" ); oldval = rdtp->dynticks_nesting; rdtp->dynticks_nesting++; WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
net/wireless/nl80211.c +10 -2
@@ -485,6 +485,14 @@ nl80211_plan_policy[NL80211_SCHED_SCAN_PLAN_MAX + 1] = { [NL80211_SCHED_SCAN_PLAN_ITERATIONS] = { .type = NLA_U32 }, }; +/* policy for packet pattern attributes */ +static const struct nla_policy +nl80211_packet_pattern_policy[MAX_NL80211_PKTPAT +1 ] = { + [NL80211_PKTPAT_MASK ] = { .type =NLA_BINARY , }, + [NL80211_PKTPAT_PATTERN ] = { .type =NLA_BINARY , }, + [NL80211_PKTPAT_OFFSET ] = { .type =NLA_U32 }, +}; + static int nl80211_prepare_wdev_dump(struct sk_buff *skb, struct netlink_callback *cb, struct cfg80211_registered_device **rdev,
@@ -9410,7 +9418,7 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)u8 *mask_pat;nla_parse (pat_tb,MAX_NL80211_PKTPAT ,nla_data (pat), -nla_len (pat),NULL ); +nla_len (pat), nl80211_packet_pattern_policy); err = -EINVAL ;if (!pat_tb[NL80211_PKTPAT_MASK ] || !pat_tb[NL80211_PKTPAT_PATTERN ])
@@ -9660,7 +9668,7 @@ static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev,u8 *mask_pat;nla_parse (pat_tb,MAX_NL80211_PKTPAT ,nla_data (pat), -nla_len (pat),NULL ); +nla_len (pat), nl80211_packet_pattern_policy);if (!pat_tb[NL80211_PKTPAT_MASK ] || !pat_tb[NL80211_PKTPAT_PATTERN ])return -EINVAL ;
sound/core/seq/seq_clientmgr.c +5 -1
@@ -1260,6 +1260,7 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client,struct snd_seq_client_port *port;struct snd_seq_port_info info;struct snd_seq_port_callback *callback; +int port_idx;if (copy_from_user (&info, arg,sizeof (info)))return -EFAULT ;
@@ -1273,7 +1274,9 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client,return -ENOMEM ;if (client->type ==USER_CLIENT && info.kernel) { -snd_seq_delete_port (client, port->addr.port); + port_idx = port->addr.port; +snd_seq_port_unlock (port); +snd_seq_delete_port (client, port_idx);return -EINVAL ; }if (client->type ==KERNEL_CLIENT ) {
@@ -1294,6 +1297,7 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client,snd_seq_set_port_info (port, &info);snd_seq_system_client_ev_port_start (port->addr.client, port->addr.port); +snd_seq_port_unlock (port);if (copy_to_user (arg, &info,sizeof (info)))return -EFAULT ;
sound/core/seq/seq_ports.c +5 -2
@@ -122,7 +122,9 @@ static void port_subs_info_init(struct snd_seq_port_subs_info *grp) } -/* create a port, port number is returned (-1 on failure) */ +/* create a port, port number is returned (-1 on failure); +* the caller needs to unref the port via snd_seq_port_unlock() appropriately +*/ struct snd_seq_client_port *snd_seq_create_port (struct snd_seq_client *client,int port) {
@@ -151,6 +153,7 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,snd_use_lock_init (&new_port->use_lock);port_subs_info_init (&new_port->c_src);port_subs_info_init (&new_port->c_dest); +snd_use_lock_use (&new_port->use_lock); num = port >=0 ? port :0 ;mutex_lock (&client->ports_mutex);
@@ -165,9 +168,9 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,list_add_tail (&new_port->list, &p->list); client->num_ports++; new_port->addr.port = num;/* store the port number in the port */ +sprintf (new_port->name,"port-%d" , num);write_unlock_irqrestore (&client->ports_lock, flags);mutex_unlock (&client->ports_mutex); -sprintf (new_port->name,"port-%d" , num);return new_port; }
sound/core/seq/seq_virmidi.c +19 -8
@@ -77,13 +77,17 @@ static void snd_virmidi_init_event(struct snd_virmidi *vmidi,* decode input event and put to read buffer of each opened file */ static int snd_virmidi_dev_receive_event (struct snd_virmidi_dev *rdev, -struct snd_seq_event *ev) +struct snd_seq_event *ev, +bool atomic) {struct snd_virmidi *vmidi;unsigned char msg[4 ];int len; -read_lock (&rdev->filelist_lock); +if (atomic) +read_lock (&rdev->filelist_lock); +else +down_read (&rdev->filelist_sem);list_for_each_entry (vmidi, &rdev->filelist, list) {if (!vmidi->trigger)continue ;
@@ -97,7 +101,10 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,snd_rawmidi_receive (vmidi->substream, msg, len); } } -read_unlock (&rdev->filelist_lock); +if (atomic) +read_unlock (&rdev->filelist_lock); +else +up_read (&rdev->filelist_sem);return 0 ; }
@@ -115,7 +122,7 @@ int snd_virmidi_receive(struct snd_rawmidi *rmidi, struct snd_seq_event *ev)struct snd_virmidi_dev *rdev; rdev = rmidi->private_data; - return snd_virmidi_dev_receive_event(rdev, ev); + return snd_virmidi_dev_receive_event(rdev, ev, true); }#endif /* 0 */
@@ -130,7 +137,7 @@ static int snd_virmidi_event_input(struct snd_seq_event *ev, int direct, rdev = private_data;if (!(rdev->flags &SNDRV_VIRMIDI_USE ))return 0 ;/* ignored */ -return snd_virmidi_dev_receive_event (rdev, ev); +return snd_virmidi_dev_receive_event (rdev, ev, atomic); }/*
@@ -209,7 +216,6 @@ static int snd_virmidi_input_open(struct snd_rawmidi_substream *substream)struct snd_virmidi_dev *rdev = substream->rmidi->private_data;struct snd_rawmidi_runtime *runtime = substream->runtime;struct snd_virmidi *vmidi; -unsigned long flags; vmidi =kzalloc (sizeof (*vmidi),GFP_KERNEL );if (vmidi ==NULL )
@@ -223,9 +229,11 @@ static int snd_virmidi_input_open(struct snd_rawmidi_substream *substream) vmidi->client = rdev->client; vmidi->port = rdev->port; runtime->private_data = vmidi; -write_lock_irqsave (&rdev->filelist_lock, flags); +down_write (&rdev->filelist_sem); +write_lock_irq (&rdev->filelist_lock);list_add_tail (&vmidi->list, &rdev->filelist); -write_unlock_irqrestore (&rdev->filelist_lock, flags); +write_unlock_irq (&rdev->filelist_lock); +up_write (&rdev->filelist_sem); vmidi->rdev = rdev;return 0 ; }
@@ -264,9 +272,11 @@ static int snd_virmidi_input_close(struct snd_rawmidi_substream *substream)struct snd_virmidi_dev *rdev = substream->rmidi->private_data;struct snd_virmidi *vmidi = substream->runtime->private_data; +down_write (&rdev->filelist_sem);write_lock_irq (&rdev->filelist_lock);list_del (&vmidi->list);write_unlock_irq (&rdev->filelist_lock); +up_write (&rdev->filelist_sem);snd_midi_event_free (vmidi->parser); substream->runtime->private_data =NULL ;kfree (vmidi);
@@ -520,6 +530,7 @@ int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmi rdev->rmidi = rmidi; rdev->device = device; rdev->client =-1 ; +init_rwsem (&rdev->filelist_sem);rwlock_init (&rdev->filelist_lock);INIT_LIST_HEAD (&rdev->filelist); rdev->seq_mode =SNDRV_VIRMIDI_SEQ_DISPATCH ;
sound/usb/caiaq/device.c +9 -3
@@ -469,10 +469,12 @@ static int init_card(struct snd_usb_caiaqdev *cdev) err =snd_usb_caiaq_send_command (cdev,EP1_CMD_GET_DEVICE_INFO ,NULL ,0 );if (err) -return err; + goto err_kill_urb; -if (!wait_event_timeout (cdev->ep1_wait_queue, cdev->spec_received,HZ )) -return -ENODEV ; +if (!wait_event_timeout (cdev->ep1_wait_queue, cdev->spec_received,HZ )) { + err = -ENODEV ; + goto err_kill_urb; + }usb_string (usb_dev, usb_dev->descriptor.iManufacturer, cdev->vendor_name,CAIAQ_USB_STR_LEN );
@@ -507,6 +509,10 @@ static int init_card(struct snd_usb_caiaqdev *cdev)setup_card (cdev);return 0 ; + + err_kill_urb: +usb_kill_urb (&cdev->ep1_in_urb); +return err; } static int snd_probe(struct usb_interface *intf,
sound/usb/line6/driver.c +4 -3
@@ -586,9 +586,10 @@ int line6_probe(struct usb_interface *interface,return 0 ; error: -if (line6->disconnect) - line6->disconnect (line6); -snd_card_free (card); +/* we can call disconnect callback here because no close-sync is +* needed yet at this point +*/ +line6_disconnect (interface);return ret; }EXPORT_SYMBOL_GPL (line6_probe);
sound/usb/mixer.c +10 -2
@@ -2161,6 +2161,9 @@ static int parse_audio_unit(struct mixer_build *state, int unitid)static void snd_usb_mixer_free (struct usb_mixer_interface *mixer) { +/* kill pending URBs */ +snd_usb_mixer_disconnect (mixer); +kfree (mixer->id_elems);if (mixer->urb) {kfree (mixer->urb->transfer_buffer);
@@ -2504,8 +2507,13 @@ _error:void snd_usb_mixer_disconnect (struct usb_mixer_interface *mixer) { -usb_kill_urb (mixer->urb); -usb_kill_urb (mixer->rc_urb); +if (mixer->disconnected) +return ; +if (mixer->urb) +usb_kill_urb (mixer->urb); +if (mixer->rc_urb) +usb_kill_urb (mixer->rc_urb); + mixer->disconnected = true; }#ifdef CONFIG_PM
sound/usb/mixer.h +2 -0
@@ -22,6 +22,8 @@ struct usb_mixer_interface {struct urb *rc_urb;struct usb_ctrlrequest *rc_setup_packet;u8 rc_buffer[6 ]; + +bool disconnected; };#define MAX_CHANNELS 16/* max logical channels */