Linux 3.0.71
Greg KH
maintainerI'm announcing the release of the 3.0.71 kernel.
All users of the 3.0 kernel series must upgrade.
The updated 3.0.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.0.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/x86/lib/usercopy_64.c | 4 +- drivers/gpu/drm/drm_edid.c | 2 - drivers/gpu/drm/i915/i915_debugfs.c | 2 - drivers/gpu/drm/i915/i915_gem_execbuffer.c | 11 ++++-- drivers/gpu/drm/i915/intel_opregion.c | 23 ++++++++++++ drivers/infiniband/ulp/ipoib/ipoib_cm.c | 8 +++- drivers/net/netconsole.c | 20 ++++------ drivers/net/sfc/efx.c | 53 ++++++++++++++++++----------- drivers/net/sfc/efx.h | 13 +++++++ drivers/net/sfc/falcon.c | 2 + drivers/net/sfc/filter.c | 41 +++++++++++++--------- drivers/net/sfc/mcdi.c | 29 +++++++++------ drivers/net/sfc/mcdi.h | 1 drivers/net/sfc/mcdi_mac.c | 4 +- drivers/net/sfc/net_driver.h | 10 ++++- drivers/net/sfc/nic.c | 24 ++++++++++--- drivers/net/sfc/nic.h | 2 + drivers/net/sfc/rx.c | 25 ++++++++----- drivers/net/sfc/selftest.c | 2 - drivers/net/sfc/siena.c | 29 +++++++++++---- drivers/net/wireless/mwifiex/join.c | 7 +-- drivers/net/wireless/rt2x00/rt2x00dev.c | 2 + drivers/platform/x86/asus-laptop.c | 17 ++------- drivers/tty/serial/sunsu.c | 21 ++++------- drivers/usb/host/ehci-q.c | 18 ++------- drivers/usb/host/xhci.h | 4 +- drivers/usb/serial/garmin_gps.c | 7 --- drivers/usb/serial/io_ti.c | 1 drivers/usb/serial/usb-serial.c | 3 + drivers/usb/storage/unusual_devs.h | 7 +++ fs/binfmt_em86.c | 1 fs/binfmt_misc.c | 6 --- fs/binfmt_script.c | 4 -- fs/cifs/asn1.c | 53 ++--------------------------- fs/compat.c | 15 +++----- fs/exec.c | 10 ++--- fs/ext4/extents.c | 6 ++- fs/isofs/export.c | 1 fs/udf/namei.c | 1 fs/udf/udf_sb.h | 2 - include/linux/binfmts.h | 2 - include/net/inet_frag.h | 9 ++++ include/net/ip_fib.h | 12 ++---- kernel/time/tick-broadcast.c | 3 + kernel/trace/ftrace.c | 4 +- kernel/trace/trace.c | 3 + mm/hugetlb.c | 8 +++- net/core/rtnetlink.c | 2 - net/ipv4/inet_fragment.c | 20 ++++++++++ net/ipv4/ip_fragment.c | 12 +++--- net/ipv4/ip_options.c | 5 -- net/ipv6/netfilter/nf_conntrack_reasm.c | 12 +++--- net/ipv6/reassembly.c | 8 +++- net/sctp/associola.c | 2 - security/keys/compat.c | 4 +- security/keys/keyctl.c | 4 +- sound/pci/hda/hda_codec.c | 2 - sound/usb/mixer.c | 16 ++++---- 59 files changed, 353 insertions(+), 268 deletions(-)
Alan Cox (1):
key: Fix resource leak
Ben Hutchings (10):
sfc: Fix loop condition for efx_filter_search() when !for_insert
sfc: Convert firmware subtypes to native byte order in efx_mcdi_get_board_cfg()
sfc: Fix two causes of flush failure
sfc: Fix timekeeping in efx_mcdi_poll()
sfc: Properly sync RX DMA buffer when it is not the last in the page
sfc: Fix efx_rx_buf_offset() in the presence of swiotlb
sfc: Detach net device when stopping queues for reconfiguration
sfc: Disable soft interrupt handling during efx_device_detach_sync()
sfc: Only use TX push if a single descriptor is to be written
asus-laptop: Do not call HWRS on init
Bing Zhao (1):
mwifiex: fix potential out-of-boundary access to ibss rate table
CQ Tang (1):
x86-64: Fix the failure case in copy_user_handle_tail()
Daniel Mack (2):
ALSA: snd-usb: mixer: propagate errors up the call chain
ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls()
Daniel Pieczko (1):
sfc: lock TX queues when calling netif_device_detach()
David Ward (1):
net/ipv4: Ensure that location of timestamp option is stored
Denis V. Lunev (1):
ipv4: fix definition of FIB_TABLE_HASHSZ
Dmitry Artamonow (1):
usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 player
Dmitry Torokhov (1):
USB: xhci - fix bit definitions for IMAN register
Felix Fietkau (1):
rt2x00: error in configurations with mesh support disabled
Greg Kroah-Hartman (2):
Revert "USB: EHCI: don't check DMA values in QH overlays" Linux 3.0.71
Hannes Frederic Sowa (1):
inet: limit length of fragment queue hash table bucket lists
Jan Kara (1):
udf: Fix bitmap overflow on large filesystems with small block size
Jeff Layton (1):
cifs: ignore everything in SPNEGO blob after mechTypes
Johan Hovold (3):
USB: serial: fix interface refcounting
USB: garmin_gps: fix memory leak on disconnect
USB: io_ti: fix get_icount for two port adapters
Kees Cook (3):
drm/i915: restrict kernel address leak in debugfs drm/i915: bounds check execbuffer relocation count
exec: use -ELOOP for max recursion depth
Lekensteyn (1):
i915: initialize CADL in opregion
Mark Rutland (1):
clockevents: Don't allow dummy broadcast timers
Mathias Krause (2):
isofs: avoid info leak on export
udf: avoid info leak on export
Mathieu Desnoyers (1):
Fix: compat_rw_copy_check_uvector() misuse in aio, readv, writev, and security keys
Mike Marciniszyn (1):
IPoIB: Fix send lockup due to missed TX completion
Steve Hodgson (1):
sfc: Fix Siena mac statistics on big endian platforms
Steven Rostedt (Red Hat) (2):
tracing: Fix race in snapshot swapping
tracing: Fix free of probe entry by calling call_rcu_sched()
Stuart Hodgson (1):
sfc: Do not attempt to flush queues if DMA is disabled
Takashi Iwai (1):
ALSA: hda - Fix typo in checking IEC958 emphasis bit
Tkhai Kirill (1):
sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option
Torsten Duwe (1):
KMS: fix EDID detailed timing vsync parsing
Veaceslav Falico (1):
netconsole: don't call __netpoll_cleanup() while atomic
Vlad Yasevich (1):
rtnetlink: Mask the rta_type when range checking
Wanpeng Li (1):
mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting
Xufeng Zhang (1):
sctp: don't break the loop while meeting the active_path so as to find the matched transport
Zheng Liu (1):
ext4: fix the wrong number of the allocated blocks in ext4_split_extent()
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 0 -SUBLEVEL = 70 +SUBLEVEL = 71 EXTRAVERSION = NAME = Sneaky Weasel
arch/x86/lib/usercopy_64.c +2 -2
@@ -169,10 +169,10 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)char c;unsigned zero_len; -for (; len; --len) { +for (; len; --len, to++) {if (__get_user_nocheck (c, from++,sizeof (char )))break ; -if (__put_user_nocheck (c, to++,sizeof (char ))) +if (__put_user_nocheck (c, to,sizeof (char )))break ; }
drivers/gpu/drm/drm_edid.c +1 -1
@@ -841,7 +841,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,unsigned vblank = (pt->vactive_vblank_hi &0xf ) <<8 | pt->vblank_lo;unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi &0xc0 ) <<2 | pt->hsync_offset_lo;unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi &0x30 ) <<4 | pt->hsync_pulse_width_lo; -unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi &0xc ) >>2 | pt->vsync_offset_pulse_width_lo >>4 ; +unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi &0xc ) <<2 | pt->vsync_offset_pulse_width_lo >>4 ;unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi &0x3 ) <<4 | (pt->vsync_offset_pulse_width_lo &0xf );/* ignore tiny modes */
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
@@ -119,7 +119,7 @@ static const char *cache_level_str(int type)static void describe_obj (struct seq_file *m,struct drm_i915_gem_object *obj) { - seq_printf(m, "%p: %s%s %8zd %04x %04x %d %d%s%s%s", + seq_printf(m, "%pK: %s%s %8zd %04x %04x %d %d%s%s%s", &obj->base, get_pin_flag(obj), get_tiling_flag(obj),
drivers/gpu/drm/i915/i915_gem_execbuffer.c +8 -3
@@ -888,15 +888,20 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec, int count) {int i; +int relocs_total =0 ; +int relocs_max =INT_MAX /sizeof (struct drm_i915_gem_relocation_entry );for (i =0 ; i < count; i++) {char __user *ptr = (char __user *)(uintptr_t )exec[i].relocs_ptr;int length;/* limited by fault_in_pages_readable() */ -/* First check for malicious input causing overflow */ -if (exec[i].relocation_count > -INT_MAX /sizeof (struct drm_i915_gem_relocation_entry )) +/* First check for malicious input causing overflow in +* the worst case where we need to allocate the entire +* relocation tree as a single array. +*/ +if (exec[i].relocation_count > relocs_max - relocs_total)return -EINVAL ; + relocs_total += exec[i].relocation_count; length = exec[i].relocation_count *sizeof (struct drm_i915_gem_relocation_entry );
drivers/gpu/drm/i915/intel_opregion.c +22 -1
@@ -413,6 +413,25 @@ blind_set: goto end; } +static void intel_setup_cadls (struct drm_device *dev) +{ +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_opregion *opregion = &dev_priv->opregion; +int i =0 ; +u32 disp_id; + +/* Initialize the CADL field by duplicating the DIDL values. +* Technically, this is not always correct as display outputs may exist, +* but not active. This initialization is necessary for some Clevo +* laptops that check this field before processing the brightness and +* display switching hotkeys. Just like DIDL, CADL is NULL-terminated if +* there are less than eight devices. */ +do { + disp_id =ioread32 (&opregion->acpi->didl[i]); +iowrite32 (disp_id, &opregion->acpi->cadl[i]); + }while (++i <8 && disp_id !=0 ); +} +void intel_opregion_init (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;
@@ -422,8 +441,10 @@ void intel_opregion_init(struct drm_device *dev)return ;if (opregion->acpi) { -if (drm_core_check_feature (dev,DRIVER_MODESET )) +if (drm_core_check_feature (dev,DRIVER_MODESET )) {intel_didl_outputs (dev); +intel_setup_cadls (dev); + }/* Notify BIOS we are ready to handle ACPI video ext notifs. * Right now, all the events are handled by the ACPI video module.
drivers/infiniband/ulp/ipoib/ipoib_cm.c +6 -2
@@ -753,9 +753,13 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_if (++priv->tx_outstanding == ipoib_sendq_size) {ipoib_dbg (priv,"TX ring 0x%x full, stopping kernel net queue\n" , tx->qp->qp_num); -if (ib_req_notify_cq (priv->send_cq,IB_CQ_NEXT_COMP )) -ipoib_warn (priv,"request notify on send CQ failed\n" );netif_stop_queue (dev); + rc =ib_req_notify_cq (priv->send_cq, +IB_CQ_NEXT_COMP |IB_CQ_REPORT_MISSED_EVENTS ); +if (rc <0 ) +ipoib_warn (priv,"request notify on send CQ failed\n" ); +else if (rc) +ipoib_send_comp_handler (priv->send_cq, dev); } } }
drivers/net/netconsole.c +9 -11
@@ -630,6 +630,7 @@ static int netconsole_netdev_event(struct notifier_block *this, goto done;spin_lock_irqsave (&target_list_lock, flags); +restart:list_for_each_entry (nt, &target_list, list) {netconsole_target_get (nt);if (nt->np.dev == dev) {
@@ -642,20 +643,17 @@ static int netconsole_netdev_event(struct notifier_block *this,case NETDEV_UNREGISTER :/* * rtnl_lock already held +* we might sleep in __netpoll_cleanup() */ -if (nt->np.dev) { -spin_unlock_irqrestore ( - &target_list_lock, - flags); -__netpoll_cleanup (&nt->np); -spin_lock_irqsave (&target_list_lock, - flags); -dev_put (nt->np.dev); - nt->np.dev =NULL ; - } +spin_unlock_irqrestore (&target_list_lock, flags); +__netpoll_cleanup (&nt->np); +spin_lock_irqsave (&target_list_lock, flags); +dev_put (nt->np.dev); + nt->np.dev =NULL ; nt->enabled =0 ; stopped = true; -break ; +netconsole_target_put (nt); + goto restart; } }netconsole_target_put (nt);
drivers/net/sfc/efx.c +33 -20
108 lines not on this page · raw message
drivers/net/sfc/efx.h +13 -0
@@ -150,4 +150,17 @@ extern void efx_link_status_changed(struct efx_nic *efx);extern void efx_link_set_advertising (struct efx_nic *efx,u32 );extern void efx_link_set_wanted_fc (struct efx_nic *efx,u8 ); +static inline void efx_device_detach_sync (struct efx_nic *efx) +{ +struct net_device *dev = efx->net_dev; + +/* Lock/freeze all TX queues so that we can be sure the +* TX scheduler is stopped when we're done and before +* netif_device_present() becomes false. +*/ +netif_tx_lock_bh (dev); +netif_device_detach (dev); +netif_tx_unlock_bh (dev); +} +#endif /* EFX_EFX_H */
drivers/net/sfc/falcon.c +2 -0
@@ -1714,6 +1714,7 @@ const struct efx_nic_type falcon_a1_nic_type = { .remove_port = falcon_remove_port, .handle_global_event = falcon_handle_global_event, .prepare_flush = falcon_prepare_flush, + .finish_flush = efx_port_dummy_op_void, .update_stats = falcon_update_nic_stats, .start_stats = falcon_start_nic_stats, .stop_stats = falcon_stop_nic_stats,
@@ -1755,6 +1756,7 @@ const struct efx_nic_type falcon_b0_nic_type = { .remove_port = falcon_remove_port, .handle_global_event = falcon_handle_global_event, .prepare_flush = falcon_prepare_flush, + .finish_flush = efx_port_dummy_op_void, .update_stats = falcon_update_nic_stats, .start_stats = falcon_start_nic_stats, .stop_stats = falcon_stop_nic_stats,
drivers/net/sfc/filter.c +24 -17
52 lines not on this page · raw message
drivers/net/sfc/mcdi.c +17 -12
@@ -30,7 +30,7 @@#define REBOOT_FLAG_PORT0 0x3f8#define REBOOT_FLAG_PORT1 0x3fc -#define MCDI_RPC_TIMEOUT 10/*seconds */ +#define MCDI_RPC_TIMEOUT (10 * HZ)#define MCDI_PDU (efx) \ (efx_port_num(efx) ? CMD_PDU_PORT1 : CMD_PDU_PORT0)
@@ -120,7 +120,7 @@ static void efx_mcdi_copyout(struct efx_nic *efx, u8 *outbuf, size_t outlen)static int efx_mcdi_poll (struct efx_nic *efx) {struct efx_mcdi_iface *mcdi =efx_mcdi (efx); -unsigned int time, finish; +unsigned long time, finish;unsigned int respseq, respcmd, error;unsigned int pdu =FR_CZ_MC_TREG_SMEM +MCDI_PDU (efx);unsigned int rc, spins;
@@ -136,7 +136,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)* and poll once a jiffy (approximately) */ spins =TICK_USEC ; - finish =get_seconds () +MCDI_RPC_TIMEOUT ; + finish = jiffies +MCDI_RPC_TIMEOUT ;while (1 ) {if (spins !=0 ) {
@@ -146,7 +146,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)schedule_timeout_uninterruptible (1 ); } - time =get_seconds (); + time = jiffies;rmb ();efx_readd (efx, ®, pdu);
@@ -158,7 +158,7 @@ static int efx_mcdi_poll(struct efx_nic *efx) EFX_DWORD_FIELD(reg, MCDI_HEADER_RESPONSE)) break; -if (time >= finish) +if (time_after (time, finish))return -ETIMEDOUT ; }
@@ -250,7 +250,7 @@ static int efx_mcdi_await_completion(struct efx_nic *efx)if (wait_event_timeout ( mcdi->wq,atomic_read (&mcdi->state) ==MCDI_STATE_COMPLETED , -msecs_to_jiffies (MCDI_RPC_TIMEOUT *1000 )) ==0 ) +MCDI_RPC_TIMEOUT ) ==0 )return -ETIMEDOUT ;/* Check if efx_mcdi_set_mode() switched us back to polled completions.
@@ -666,9 +666,8 @@ int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, u16 *fw_subtype_list) {uint8_t outbuf[MC_CMD_GET_BOARD_CFG_OUT_LEN ]; -size_t outlen; +size_t outlen, offset, i;int port_num =efx_port_num (efx); -int offset;int rc;BUILD_BUG_ON (MC_CMD_GET_BOARD_CFG_IN_LEN !=0 );
@@ -688,10 +687,16 @@ int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, : MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_OFST;if (mac_address)memcpy (mac_address, outbuf + offset,ETH_ALEN ); -if (fw_subtype_list) -memcpy (fw_subtype_list, - outbuf +MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST , -MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN ); +if (fw_subtype_list) { + offset =MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST ; +for (i =0 ; + i <MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN /2 ; + i++) { + fw_subtype_list[i] = +le16_to_cpup ((__le16 *)(outbuf + offset)); + offset +=2 ; + } + }return 0 ;
drivers/net/sfc/mcdi.h +1 -0
@@ -126,5 +126,6 @@ extern int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx,extern int efx_mcdi_wol_filter_get_magic (struct efx_nic *efx,int *id_out);extern int efx_mcdi_wol_filter_remove (struct efx_nic *efx,int id);extern int efx_mcdi_wol_filter_reset (struct efx_nic *efx); +extern int efx_mcdi_set_mac (struct efx_nic *efx);#endif /* EFX_MCDI_H */
drivers/net/sfc/mcdi_mac.c +3 -1
@@ -13,7 +13,7 @@#include "mcdi.h" #include "mcdi_pcol.h" -static int efx_mcdi_set_mac (struct efx_nic *efx) +int efx_mcdi_set_mac (struct efx_nic *efx) {u32 reject, fcntl;u8 cmdbytes[MC_CMD_SET_MAC_IN_LEN ];
@@ -45,6 +45,8 @@ static int efx_mcdi_set_mac(struct efx_nic *efx) }if (efx->wanted_fc &EFX_FC_AUTO ) fcntl =MC_CMD_FCNTL_AUTO ; +if (efx->fc_disable) + fcntl =MC_CMD_FCNTL_OFF ;MCDI_SET_DWORD (cmdbytes,SET_MAC_IN_FCNTL , fcntl);
drivers/net/sfc/net_driver.h +9 -1
@@ -214,6 +214,7 @@ struct efx_tx_queue {* If both this and page are %NULL, the buffer slot is currently free. * @page: The associated page buffer, if any. * If both this and skb are %NULL, the buffer slot is currently free. +* @page_offset: Offset within page. Valid iff @flags & %EFX_RX_BUF_PAGE. * @len: Buffer length, in bytes. * @is_page: Indicates if @page is valid. If false, @skb is valid. */
@@ -223,7 +224,8 @@ struct efx_rx_buffer {struct sk_buff *skb;struct page *page; } u; -unsigned int len; +u16 page_offset; +u16 len;bool is_page; };
@@ -690,6 +692,9 @@ struct efx_filter_state;* @promiscuous: Promiscuous flag. Protected by netif_tx_lock. * @multicast_hash: Multicast hash table * @wanted_fc: Wanted flow control flags +* @fc_disable: When non-zero flow control is disabled. Typically used to +* ensure that network back pressure doesn't delay dma queue flushes. +* Serialised by the rtnl lock. * @mac_work: Work item for changing MAC promiscuity and multicast hash * @loopback_mode: Loopback status * @loopback_modes: Supported loopback mode bitmask
@@ -783,6 +788,7 @@ struct efx_nic {bool promiscuous;union efx_multicast_hash multicast_hash;u8 wanted_fc; +unsigned fc_disable;atomic_t rx_reset;enum efx_loopback_mode loopback_mode;
@@ -834,6 +840,7 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)* @remove_port: Free resources allocated by probe_port() * @handle_global_event: Handle a "global" event (may be %NULL) * @prepare_flush: Prepare the hardware for flushing the DMA queues +* @finish_flush: Clean up after flushing the DMA queues * @update_stats: Update statistics not provided by event handling * @start_stats: Start the regular fetching of statistics * @stop_stats: Stop the regular fetching of statistics
@@ -879,6 +886,7 @@ struct efx_nic_type {void (*remove_port)(struct efx_nic *efx);bool (*handle_global_event)(struct efx_channel *channel,efx_qword_t *);void (*prepare_flush)(struct efx_nic *efx); +void (*finish_flush)(struct efx_nic *efx);void (*update_stats)(struct efx_nic *efx);void (*start_stats)(struct efx_nic *efx);void (*stop_stats)(struct efx_nic *efx);
drivers/net/sfc/nic.c +20 -4
@@ -370,7 +370,8 @@ efx_may_push_tx_desc(struct efx_tx_queue *tx_queue, unsigned int write_count)return false; tx_queue->empty_read_count =0 ; -return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID ) ==0 ; +return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID ) ==0 + && tx_queue->write_count - write_count ==1 ; }/* For each entry inserted into the software descriptor ring, create a
@@ -1260,13 +1261,27 @@ int efx_nic_flush_queues(struct efx_nic *efx) }efx_for_each_possible_channel_tx_queue (tx_queue, channel) {if (tx_queue->initialised && - tx_queue->flushed !=FLUSH_DONE ) - ++tx_pending; + tx_queue->flushed !=FLUSH_DONE ) { +efx_oword_t txd_ptr_tbl; + +efx_reado_table (efx, &txd_ptr_tbl, +FR_BZ_TX_DESC_PTR_TBL , + tx_queue->queue); +if (EFX_OWORD_FIELD (txd_ptr_tbl, +FRF_AZ_TX_DESCQ_FLUSH ) || +EFX_OWORD_FIELD (txd_ptr_tbl, +FRF_AZ_TX_DESCQ_EN )) + ++tx_pending; +else + tx_queue->flushed =FLUSH_DONE ; + } } } -if (rx_pending ==0 && tx_pending ==0 ) +if (rx_pending ==0 && tx_pending ==0 ) { + efx->type->finish_flush (efx);return 0 ; + }msleep (EFX_FLUSH_INTERVAL );efx_poll_flush_events (efx);
@@ -1292,6 +1307,7 @@ int efx_nic_flush_queues(struct efx_nic *efx) } } + efx->type->finish_flush (efx);return -ETIMEDOUT ; }
drivers/net/sfc/nic.h +2 -0
@@ -211,6 +211,8 @@ extern void falcon_irq_ack_a1(struct efx_nic *efx);/* Global Resources */ extern int efx_nic_flush_queues (struct efx_nic *efx); +extern void siena_prepare_flush (struct efx_nic *efx); +extern void siena_finish_flush (struct efx_nic *efx);extern void falcon_start_nic_stats (struct efx_nic *efx);extern void falcon_stop_nic_stats (struct efx_nic *efx);extern void falcon_setup_xaui (struct efx_nic *efx);
drivers/net/sfc/rx.c +15 -10
@@ -94,11 +94,7 @@ static unsigned int rx_refill_limit = 95;static inline unsigned int efx_rx_buf_offset (struct efx_nic *efx,struct efx_rx_buffer *buf) { -/* Offset is always within one page, so we don't need to consider -* the page order. -*/ -return (((__force unsigned long ) buf->dma_addr & (PAGE_SIZE -1 )) + - efx->type->rx_buffer_hash_size); +return buf->page_offset + efx->type->rx_buffer_hash_size; }static inline unsigned int efx_rx_buf_size (struct efx_nic *efx) {
@@ -193,6 +189,7 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)struct efx_rx_buffer *rx_buf;struct page *page;void *page_addr; +unsigned int page_offset;struct efx_rx_page_state *state;dma_addr_t dma_addr;unsigned index, count;
@@ -219,12 +216,14 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue) page_addr +=sizeof (struct efx_rx_page_state ); dma_addr +=sizeof (struct efx_rx_page_state ); + page_offset =sizeof (struct efx_rx_page_state ); split: index = rx_queue->added_count & rx_queue->ptr_mask; rx_buf =efx_rx_buffer (rx_queue, index); rx_buf->dma_addr = dma_addr +EFX_PAGE_IP_ALIGN ; rx_buf->u.page = page; + rx_buf->page_offset = page_offset +EFX_PAGE_IP_ALIGN ; rx_buf->len = efx->rx_buffer_len -EFX_PAGE_IP_ALIGN ; rx_buf->is_page = true; ++rx_queue->added_count;
@@ -236,6 +235,7 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)get_page (page); dma_addr += (PAGE_SIZE >>1 ); page_addr += (PAGE_SIZE >>1 ); + page_offset += (PAGE_SIZE >>1 ); ++count; goto split; }
@@ -245,7 +245,8 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue) }static void efx_unmap_rx_buffer (struct efx_nic *efx, -struct efx_rx_buffer *rx_buf) +struct efx_rx_buffer *rx_buf, +unsigned int used_len) {if (rx_buf->is_page && rx_buf->u.page) {struct efx_rx_page_state *state;
@@ -256,6 +257,10 @@ static void efx_unmap_rx_buffer(struct efx_nic *efx, state->dma_addr,efx_rx_buf_size (efx), PCI_DMA_FROMDEVICE); + }else if (used_len) { +dma_sync_single_for_cpu (&efx->pci_dev->dev, + rx_buf->dma_addr, used_len, +DMA_FROM_DEVICE ); } }else if (!rx_buf->is_page && rx_buf->u.skb) { pci_unmap_single(efx->pci_dev, rx_buf->dma_addr,
@@ -278,7 +283,7 @@ static void efx_free_rx_buffer(struct efx_nic *efx,static void efx_fini_rx_buffer (struct efx_rx_queue *rx_queue,struct efx_rx_buffer *rx_buf) { -efx_unmap_rx_buffer (rx_queue->efx, rx_buf); +efx_unmap_rx_buffer (rx_queue->efx, rx_buf,0 );efx_free_rx_buffer (rx_queue->efx, rx_buf); }
@@ -549,10 +554,10 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, goto out; } -/* Release card resources - assumes all RX buffers consumed in-order -* per RX queue +/* Release and/or sync DMA mapping - assumes all RX buffers +* consumed in-order per RX queue */ -efx_unmap_rx_buffer (efx, rx_buf); +efx_unmap_rx_buffer (efx, rx_buf, len);/* Prefetch nice and early so data will (hopefully) be in cache by * the time we look at it.
drivers/net/sfc/selftest.c +1 -1
@@ -698,7 +698,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,/* Detach the device so the kernel doesn't transmit during the * loopback test and the watchdog timeout doesn't fire. */ -netif_device_detach (efx->net_dev); +efx_device_detach_sync (efx);mutex_lock (&efx->mac_lock);if (efx->loopback_modes) {
drivers/net/sfc/siena.c +21 -8
@@ -135,6 +135,18 @@ static void siena_remove_port(struct efx_nic *efx)efx_nic_free_buffer (efx, &efx->stats_buffer); } +void siena_prepare_flush (struct efx_nic *efx) +{ +if (efx->fc_disable++ ==0 ) +efx_mcdi_set_mac (efx); +} + +void siena_finish_flush (struct efx_nic *efx) +{ +if (--efx->fc_disable ==0 ) +efx_mcdi_set_mac (efx); +} +static const struct efx_nic_register_test siena_register_tests[] = { {FR_AZ_ADR_REGION ,EFX_OWORD32 (0x0003FFFF ,0x0003FFFF ,0x0003FFFF ,0x0003FFFF ) },
@@ -372,14 +384,13 @@ static void siena_remove_nic(struct efx_nic *efx) efx->nic_data =NULL ; } -#define STATS_GENERATION_INVALID ((u64)(-1)) +#define STATS_GENERATION_INVALID ((__force __le64)(-1))static int siena_try_update_nic_stats (struct efx_nic *efx) { -u64 *dma_stats; +__le64 *dma_stats;struct efx_mac_stats *mac_stats; -u64 generation_start; -u64 generation_end; +__le64 generation_start, generation_end; mac_stats = &efx->mac_stats; dma_stats = (u64 *)efx->stats_buffer.addr;
@@ -390,7 +401,7 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)rmb ();#define MAC_STAT (M ,D ) \ - mac_stats->M = dma_stats[MC_CMD_MAC_ ## D] + mac_stats->M = le64_to_cpu(dma_stats[MC_CMD_MAC_ ## D])MAC_STAT (tx_bytes,TX_BYTES );MAC_STAT (tx_bad_bytes,TX_BAD_BYTES );
@@ -460,7 +471,8 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)MAC_STAT (rx_internal_error,RX_INTERNAL_ERROR_PKTS ); mac_stats->rx_good_lt64 =0 ; - efx->n_rx_nodesc_drop_cnt = dma_stats[MC_CMD_MAC_RX_NODESC_DROPS ]; + efx->n_rx_nodesc_drop_cnt = +le64_to_cpu (dma_stats[MC_CMD_MAC_RX_NODESC_DROPS ]);#undef MAC_STAT
@@ -489,7 +501,7 @@ static void siena_update_nic_stats(struct efx_nic *efx)static void siena_start_nic_stats (struct efx_nic *efx) { -u64 *dma_stats = (u64 *)efx->stats_buffer.addr; +__le64 *dma_stats = efx->stats_buffer.addr; dma_stats[MC_CMD_MAC_GENERATION_END ] =STATS_GENERATION_INVALID ;
@@ -590,7 +602,8 @@ const struct efx_nic_type siena_a0_nic_type = { .reset = siena_reset_hw, .probe_port = siena_probe_port, .remove_port = siena_remove_port, - .prepare_flush = efx_port_dummy_op_void, + .prepare_flush = siena_prepare_flush, + .finish_flush = siena_finish_flush, .update_stats = siena_update_nic_stats, .start_stats = siena_start_nic_stats, .stop_stats = siena_stop_nic_stats,
drivers/net/wireless/mwifiex/join.c +3 -4
@@ -1102,10 +1102,9 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, adhoc_join->bss_descriptor.bssid, adhoc_join->bss_descriptor.ssid); -for (i =0 ; bss_desc->supported_rates[i] && - i <MWIFIEX_SUPPORTED_RATES ; - i++) - ; +for (i =0 ; i <MWIFIEX_SUPPORTED_RATES && + bss_desc->supported_rates[i]; i++) + ; rates_size = i;/* Copy Data Rates from the Rates recorded in scan response */
drivers/net/wireless/rt2x00/rt2x00dev.c +2 -0
@@ -1113,7 +1113,9 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) rt2x00dev->hw->wiphy->interface_modes |=BIT (NL80211_IFTYPE_ADHOC ) |BIT (NL80211_IFTYPE_AP ) | +#ifdef CONFIG_MAC80211_MESHBIT (NL80211_IFTYPE_MESH_POINT ) | +#endifBIT (NL80211_IFTYPE_WDS );/*
drivers/platform/x86/asus-laptop.c +4 -13
@@ -643,8 +643,10 @@ static ssize_t show_infos(struct device *dev,/* * The HWRS method return informations about the hardware. * 0x80 bit is for WLAN, 0x100 for Bluetooth. +* 0x40 for WWAN, 0x10 for WIMAX. * The significance of others is yet to be found. -* If we don't find the method, we assume the device are present. +* We don't currently use this for device detection, and it +* takes several seconds to run on some systems. */ rv =acpi_evaluate_integer (asus->handle,"HWRS" ,NULL , &temp);if (!ACPI_FAILURE (rv))
@@ -1271,7 +1273,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus) {struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };union acpi_object *model =NULL ; -unsigned long long bsts_result, hwrs_result; +unsigned long long bsts_result;char *string =NULL ;acpi_status status;
@@ -1333,17 +1335,6 @@ static int asus_laptop_get_info(struct asus_laptop *asus)if (*string)pr_notice (" %s model detected\n" , string); -/* -* The HWRS method return informations about the hardware. -* 0x80 bit is for WLAN, 0x100 for Bluetooth, -* 0x40 for WWAN, 0x10 for WIMAX. -* The significance of others is yet to be found. -*/ - status = -acpi_evaluate_integer (asus->handle,"HWRS" ,NULL , &hwrs_result); -if (!ACPI_FAILURE (status)) -pr_notice (" HWRS returned %x" , (int )hwrs_result); -if (!acpi_check_handle (asus->handle,METHOD_WL_STATUS ,NULL )) asus->have_rsts = true;
drivers/tty/serial/sunsu.c +9 -12
@@ -968,6 +968,7 @@ static struct uart_ops sunsu_pops = {#define UART_NR 4static struct uart_sunsu_port sunsu_ports[UART_NR ]; +static int nr_inst;/* Number of already registered ports */ #ifdef CONFIG_SERIO
@@ -1337,13 +1338,8 @@ static int __init sunsu_console_setup(struct console *co, char *options)printk ("Console: ttyS%d (SU)\n" , (sunsu_reg.minor -64 ) + co->index); -/* -* Check whether an invalid uart number has been specified, and -* if so, search for the first available port that does have -* console support. -*/ -if (co->index >=UART_NR ) - co->index =0 ; +if (co->index > nr_inst) +return -ENODEV ; port = &sunsu_ports[co->index].port;/*
@@ -1408,7 +1404,6 @@ static enum su_type __devinit su_get_type(struct device_node *dp)static int __devinit su_probe (struct platform_device *op) { -static int inst;struct device_node *dp = op->dev.of_node;struct uart_sunsu_port *up;struct resource *rp;
@@ -1418,16 +1413,16 @@ static int __devinit su_probe(struct platform_device *op) type =su_get_type (dp);if (type ==SU_PORT_PORT ) { -if (inst >=UART_NR ) +if (nr_inst >=UART_NR )return -EINVAL ; - up = &sunsu_ports[inst]; + up = &sunsu_ports[nr_inst]; }else { up =kzalloc (sizeof (*up),GFP_KERNEL );if (!up)return -ENOMEM ; } - up->port.line = inst; + up->port.line = nr_inst;spin_lock_init (&up->port.lock);
@@ -1461,6 +1456,8 @@ static int __devinit su_probe(struct platform_device *op) }dev_set_drvdata (&op->dev, up); + nr_inst++; +return 0 ; }
@@ -1488,7 +1485,7 @@ static int __devinit su_probe(struct platform_device *op)dev_set_drvdata (&op->dev, up); - inst++; + nr_inst++;return 0 ;
drivers/usb/host/ehci-q.c +5 -13
@@ -137,7 +137,7 @@ qh_refresh (struct ehci_hcd *ehci, struct ehci_qh *qh)* qtd is updated in qh_completions(). Update the QH * overlay here. */ -if (qh->hw->hw_token &ACTIVE_BIT (ehci)) { +if (cpu_to_hc32 (ehci, qtd->qtd_dma) == qh->hw->hw_current) { qh->hw->hw_qtd_next = qtd->hw_next; qtd =NULL ; }
@@ -450,19 +450,11 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)else if (last_status == -EINPROGRESS && !urb->unlinked)continue ; -/* -* If this was the active qtd when the qh was unlinked -* and the overlay's token is active, then the overlay -* hasn't been written back to the qtd yet so use its -* token instead of the qtd's. After the qtd is -* processed and removed, the overlay won't be valid -* any more. -*/ -if (state ==QH_STATE_IDLE && - qh->qtd_list.next == &qtd->qtd_list && - (hw->hw_token &ACTIVE_BIT (ehci))) { +/* qh unlinked; token in overlay may be most current */ +if (state ==QH_STATE_IDLE + &&cpu_to_hc32 (ehci, qtd->qtd_dma) + == hw->hw_current) { token =hc32_to_cpu (ehci, hw->hw_token); - hw->hw_token &= ~ACTIVE_BIT (ehci);/* An unlink may leave an incomplete * async transaction in the TT buffer.
drivers/usb/host/xhci.h +2 -2
@@ -206,8 +206,8 @@ struct xhci_op_regs {/* bits 12:31 are reserved (and should be preserved on writes). */ /* IMAN - Interrupt Management Register */ -#define IMAN_IP (1 << 1) -#define IMAN_IE (1 << 0) +#define IMAN_IE (1 << 1) +#define IMAN_IP (1 << 0)/* USBSTS - USB status - status bitmasks */ /* HC not running - set to 1 when run/stop bit is cleared. */
drivers/usb/serial/garmin_gps.c +1 -6
@@ -973,10 +973,7 @@ static void garmin_close(struct usb_serial_port *port)if (!serial)return ; -mutex_lock (&port->serial->disc_mutex); - -if (!port->serial->disconnected) -garmin_clear (garmin_data_p); +garmin_clear (garmin_data_p);/* shutdown our urbs */ usb_kill_urb (port->read_urb);
@@ -985,8 +982,6 @@ static void garmin_close(struct usb_serial_port *port)/* keep reset state so we know that we must start a new session */ if (garmin_data_p->state !=STATE_RESET ) garmin_data_p->state =STATE_DISCONNECTED ; - -mutex_unlock (&port->serial->disc_mutex); }
drivers/usb/serial/io_ti.c +1 -0
@@ -2793,6 +2793,7 @@ static struct usb_serial_driver edgeport_2port_device = { .set_termios = edge_set_termios, .tiocmget = edge_tiocmget, .tiocmset = edge_tiocmset, + .get_icount = edge_get_icount, .write = edge_write, .write_room = edge_write_room, .chars_in_buffer = edge_chars_in_buffer,
drivers/usb/serial/usb-serial.c +2 -1
@@ -168,6 +168,7 @@ static void destroy_serial(struct kref *kref) } } +usb_put_intf (serial->interface);usb_put_dev (serial->dev);kfree (serial); }
@@ -624,7 +625,7 @@ static struct usb_serial *create_serial(struct usb_device *dev, } serial->dev =usb_get_dev (dev); serial->type = driver; - serial->interface = interface; + serial->interface =usb_get_intf (interface);kref_init (&serial->kref);mutex_init (&serial->disc_mutex); serial->minor =SERIAL_TTY_NO_MINOR ;
drivers/usb/storage/unusual_devs.h +7 -0
@@ -488,6 +488,13 @@ UNUSUAL_DEV( 0x04e8, 0x5122, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 | US_FL_BULK_IGNORE_TAG), +/* Added by Dmitry Artamonow <[email protected]> */ +UNUSUAL_DEV (0x04e8 ,0x5136 ,0x0000 ,0x9999 , +"Samsung" , +"YP-Z3" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , + US_FL_MAX_SECTORS_64), +/* Entry and supporting patch by Theodore Kilgore <[email protected]>. * Device uses standards-violating 32-byte Bulk Command Block Wrappers and * reports itself as "Proprietary SCSI Bulk." Cf. device entry 0x084d:0x0011.
fs/binfmt_em86.c +0 -1
@@ -42,7 +42,6 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)return -ENOEXEC ; } - bprm->recursion_depth++;/* Well, the bang-shell is implicit... */ allow_write_access (bprm->file);fput (bprm->file); bprm->file =NULL ;
fs/binfmt_misc.c +0 -6
@@ -116,10 +116,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)if (!enabled) goto _ret; - retval = -ENOEXEC ; -if (bprm->recursion_depth >BINPRM_MAX_RECURSION ) - goto _ret; -/* to keep locking time low, we copy the interpreter string */ read_lock (&entries_lock); fmt =check_file (bprm);
@@ -200,8 +196,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)if (retval <0 ) goto _error; - bprm->recursion_depth++; - retval =search_binary_handler (bprm, regs);if (retval <0 ) goto _error;
fs/binfmt_script.c +1 -3
@@ -22,15 +22,13 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)char interp[BINPRM_BUF_SIZE ];int retval; -if ((bprm->buf[0 ] !='#' ) || (bprm->buf[1 ] !='!' ) || - (bprm->recursion_depth >BINPRM_MAX_RECURSION )) +if ((bprm->buf[0 ] !='#' ) || (bprm->buf[1 ] !='!' ))return -ENOEXEC ;/* * This section does the #! interpretation. * Sorta complicated, but hopefully it will work. -TYT */ - bprm->recursion_depth++;allow_write_access (bprm->file);fput (bprm->file); bprm->file =NULL ;
fs/cifs/asn1.c +5 -48
58 lines not on this page · raw message
fs/compat.c +7 -8
@@ -576,6 +576,10 @@ ssize_t compat_rw_copy_check_uvector(int type, } *ret_pointer = iov; + ret = -EFAULT ; +if (!access_ok (VERIFY_READ , uvector, nr_segs*sizeof (*uvector))) + goto out; +/* * Single unix specification: * We should -EINVAL if an element length is not >= 0 and fitting an
@@ -1106,17 +1110,12 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,if (!file->f_op) goto out; - ret = -EFAULT ; -if (!access_ok (VERIFY_READ , uvector, nr_segs*sizeof (*uvector))) - goto out; - - tot_len =compat_rw_copy_check_uvector (type, uvector, nr_segs, + ret =compat_rw_copy_check_uvector (type, uvector, nr_segs,UIO_FASTIOV , iovstack, &iov); -if (tot_len ==0 ) { - ret =0 ; +if (ret <=0 ) goto out; - } + tot_len = ret; ret =rw_verify_area (type, file, pos, tot_len);if (ret <0 ) goto out;
fs/exec.c +5 -5
@@ -1369,6 +1369,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)int try,retval;struct linux_binfmt *fmt; +/* This allows 4 levels of binfmt rewrites before failing hard. */ +if (depth >5 ) +return -ELOOP ; + retval =security_bprm_check (bprm);if (retval)return retval;
@@ -1387,12 +1391,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)if (!try_module_get (fmt->module))continue ;read_unlock (&binfmt_lock); + bprm->recursion_depth = depth +1 ; retval =fn (bprm, regs); -/* -* Restore the depth counter to its starting value -* in this call, so we don't have to rely on every -* load_binary function to restore it on return. -*/ bprm->recursion_depth = depth;if (retval >=0 ) {if (depth ==0 )
fs/ext4/extents.c +5 -1
@@ -2901,6 +2901,7 @@ static int ext4_split_extent(handle_t *handle,int err =0 ;int uninitialized;int split_flag1, flags1; +int allocated = map->m_len; depth =ext_depth (inode); ex = path[depth].p_ext;
@@ -2919,6 +2920,8 @@ static int ext4_split_extent(handle_t *handle, map->m_lblk + map->m_len, split_flag1, flags1);if (err) goto out; + }else { + allocated = ee_len - (map->m_lblk - ee_block); }ext4_ext_drop_refs (path);
@@ -2941,7 +2944,7 @@ static int ext4_split_extent(handle_t *handle,ext4_ext_show_leaf (inode, path); out: -return err ? err : map->m_len; +return err ? err : allocated; }#define EXT4_EXT_ZERO_LEN 7
@@ -3309,6 +3312,7 @@ out: allocated - map->m_len); allocated = map->m_len; } + map->m_len = allocated;/* * If we have done fallocate with the offset that is already
fs/isofs/export.c +1 -0
@@ -135,6 +135,7 @@ isofs_export_encode_fh(struct dentry *dentry, len =3 ; fh32[0 ] = ei->i_iget5_block; fh16[2 ] = (__u16 )ei->i_iget5_offset;/* fh16 [sic] */ + fh16[3 ] =0 ;/* avoid leaking uninitialized data */ fh32[2 ] = inode->i_generation;if (connectable && !S_ISDIR (inode->i_mode)) {struct inode *parent;
fs/udf/namei.c +1 -0
@@ -1297,6 +1297,7 @@ static int udf_encode_fh(struct dentry *de, __u32 *fh, int *lenp, *lenp =3 ; fid->udf.block = location.logicalBlockNum; fid->udf.partref = location.partitionReferenceNum; + fid->udf.parent_partref =0 ; fid->udf.generation = inode->i_generation;if (connectable && !S_ISDIR (inode->i_mode)) {
fs/udf/udf_sb.h +1 -1
@@ -79,7 +79,7 @@ struct udf_virtual_data {struct udf_bitmap {__u32 s_extLength;__u32 s_extPosition; -__u16 s_nr_groups; +int s_nr_groups;struct buffer_head **s_block_bitmap; };
include/linux/binfmts.h +0 -2
@@ -67,8 +67,6 @@ struct linux_binprm {#define BINPRM_FLAGS_EXECFD_BIT 1#define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) -#define BINPRM_MAX_RECURSION 4 -/* Function parameter for binfmt->coredump */ struct coredump_params {long signr;
include/net/inet_frag.h +9 -0
@@ -33,6 +33,13 @@ struct inet_frag_queue {#define INETFRAGS_HASHSZ 64 +/* averaged: +* max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ / +* rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or +* struct frag_queue)) +*/ +#define INETFRAGS_MAXDEPTH 128 +struct inet_frags {struct hlist_head hash[INETFRAGS_HASHSZ ];rwlock_t lock;
@@ -64,6 +71,8 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f);struct inet_frag_queue *inet_frag_find (struct netns_frags *nf,struct inet_frags *f,void *key,unsigned int hash) __releases(&f->lock); +void inet_frag_maybe_warn_overflow (struct inet_frag_queue *q, +const char *prefix);static inline void inet_frag_put (struct inet_frag_queue *q,struct inet_frags *f) {
include/net/ip_fib.h +5 -7
@@ -129,18 +129,16 @@ struct fib_result_nl { };#ifdef CONFIG_IP_ROUTE_MULTIPATH -#define FIB_RES_NH (res) ((res).fi->fib_nh[(res).nh_sel]) - -#define FIB_TABLE_HASHSZ 2 -#else /* CONFIG_IP_ROUTE_MULTIPATH */ -#define FIB_RES_NH (res) ((res).fi->fib_nh[0]) +#endif /* CONFIG_IP_ROUTE_MULTIPATH */ +#ifdef CONFIG_IP_MULTIPLE_TABLES #define FIB_TABLE_HASHSZ 256 - -#endif /* CONFIG_IP_ROUTE_MULTIPATH */ +#else +#define FIB_TABLE_HASHSZ 2 +#endif extern __be32 fib_info_update_nh_saddr (struct net *net,struct fib_nh *nh);
kernel/time/tick-broadcast.c +2 -1
@@ -66,7 +66,8 @@ static void tick_broadcast_start_periodic(struct clock_event_device *bc)*/ int tick_check_broadcast_device (struct clock_event_device *dev) { -if ((tick_broadcast_device.evtdev && +if ((dev->features &CLOCK_EVT_FEAT_DUMMY ) || + (tick_broadcast_device.evtdev && tick_broadcast_device.evtdev->rating >= dev->rating) || (dev->features &CLOCK_EVT_FEAT_C3STOP ))return 0 ;
kernel/trace/ftrace.c +2 -2
@@ -2709,8 +2709,8 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,continue ; } -hlist_del (&entry->node); -call_rcu (&entry->rcu, ftrace_free_entry_rcu); +hlist_del_rcu (&entry->node); +call_rcu_sched (&entry->rcu, ftrace_free_entry_rcu); } }__disable_ftrace_function_probe ();
kernel/trace/trace.c +2 -1
@@ -649,7 +649,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)void update_max_tr (struct trace_array *tr,struct task_struct *tsk,int cpu) { -struct ring_buffer *buf = tr->buffer; +struct ring_buffer *buf;if (trace_stop_count)return ;
@@ -661,6 +661,7 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) }arch_spin_lock (&ftrace_max_lock); + buf = tr->buffer; tr->buffer = max_tr.buffer; max_tr.buffer = buf;
mm/hugetlb.c +6 -2
@@ -2006,8 +2006,12 @@ int hugetlb_report_node_meminfo(int nid, char *buf)/* Return the number pages of memory we physically have, in PAGE_SIZE units. */ unsigned long hugetlb_total_pages (void ) { -struct hstate *h = &default_hstate; -return h->nr_huge_pages *pages_per_huge_page (h); +struct hstate *h; +unsigned long nr_total_pages =0 ; + +for_each_hstate (h) + nr_total_pages += h->nr_huge_pages *pages_per_huge_page (h); +return nr_total_pages; }static int hugetlb_acct_memory (struct hstate *h,long delta)
net/core/rtnetlink.c +1 -1
@@ -2011,7 +2011,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)struct rtattr *attr = (void *)nlh +NLMSG_ALIGN (min_len);while (RTA_OK (attr, attrlen)) { -unsigned flavor = attr->rta_type; +unsigned int flavor = attr->rta_type &NLA_TYPE_MASK ;if (flavor) {if (flavor > rta_max[sz_idx])return -EINVAL ;
net/ipv4/inet_fragment.c +19 -1
@@ -21,6 +21,7 @@#include <linux/rtnetlink.h> #include <linux/slab.h> +#include <net/sock.h> #include <net/inet_frag.h> static void inet_frag_secret_rebuild (unsigned long dummy)
@@ -271,6 +272,7 @@ struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, {struct inet_frag_queue *q;struct hlist_node *n; +int depth =0 ;hlist_for_each_entry (q, n, &f->hash[hash], list) {if (q->net == nf && f->match (q, key)) {
@@ -278,9 +280,25 @@ struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,read_unlock (&f->lock);return q; } + depth++; }read_unlock (&f->lock); -return inet_frag_create (nf, f, key); +if (depth <=INETFRAGS_MAXDEPTH ) +return inet_frag_create (nf, f, key); +else +return ERR_PTR (-ENOBUFS ); }EXPORT_SYMBOL (inet_frag_find); + +void inet_frag_maybe_warn_overflow (struct inet_frag_queue *q, +const char *prefix) +{ +static const char msg[] ="inet_frag_find: Fragment hash bucket" + " list length grew over limit " __stringify(INETFRAGS_MAXDEPTH) +". Dropping fragment.\n" ; + +if (PTR_ERR (q) == -ENOBUFS ) +LIMIT_NETDEBUG (KERN_WARNING "%s%s" , prefix, msg); +} +EXPORT_SYMBOL (inet_frag_maybe_warn_overflow);
net/ipv4/ip_fragment.c +6 -6
@@ -20,6 +20,8 @@* Patrick McHardy : LRU queue of frag heads for evictor. */ +#define pr_fmt (fmt) "IPv4: " fmt +#include <linux/compiler.h> #include <linux/module.h> #include <linux/types.h>
@@ -292,14 +294,12 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user) hash =ipqhashfn (iph->id, iph->saddr, iph->daddr, iph->protocol); q =inet_frag_find (&net->ipv4.frags, &ip4_frags, &arg, hash); -if (q ==NULL ) - goto out_nomem; +if (IS_ERR_OR_NULL (q)) { +inet_frag_maybe_warn_overflow (q,pr_fmt ()); +return NULL ; + } return container_of(q, struct ipq, q); - -out_nomem: -LIMIT_NETDEBUG (KERN_ERR "ip_frag_create: no memory left !\n" ); -return NULL ; }/* Is the fragment too far ahead to be part of ipq? */
net/ipv4/ip_options.c +1 -4
@@ -358,7 +358,6 @@ int ip_options_compile(struct net *net, }switch (optptr[3 ]&0xF ) {case IPOPT_TS_TSONLY : - opt->ts = optptr - iph;if (skb) timeptr = &optptr[optptr[2 ]-1 ]; opt->ts_needtime =1 ;
@@ -369,7 +368,6 @@ int ip_options_compile(struct net *net, pp_ptr = optptr +2 ; goto error; } - opt->ts = optptr - iph;if (rt) {memcpy (&optptr[optptr[2 ]-1 ], &rt->rt_spec_dst,4 ); timeptr = &optptr[optptr[2 ]+3 ];
@@ -383,7 +381,6 @@ int ip_options_compile(struct net *net, pp_ptr = optptr +2 ; goto error; } - opt->ts = optptr - iph; {__be32 addr;memcpy (&addr, &optptr[optptr[2 ]-1 ],4 );
@@ -416,12 +413,12 @@ int ip_options_compile(struct net *net, pp_ptr = optptr +3 ; goto error; } - opt->ts = optptr - iph;if (skb) { optptr[3 ] = (optptr[3 ]&0xF )|((overflow+1 )<<4 ); opt->is_changed =1 ; } } + opt->ts = optptr - iph;break ;case IPOPT_RA :if (optlen <4 ) {
net/ipv6/netfilter/nf_conntrack_reasm.c +6 -6
@@ -14,6 +14,8 @@* 2 of the License, or (at your option) any later version. */ +#define pr_fmt (fmt) "IPv6-nf: " fmt +#include <linux/errno.h> #include <linux/types.h> #include <linux/string.h>
@@ -176,14 +178,12 @@ fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst) q =inet_frag_find (&nf_init_frags, &nf_frags, &arg, hash);local_bh_enable (); -if (q ==NULL ) - goto oom; +if (IS_ERR_OR_NULL (q)) { +inet_frag_maybe_warn_overflow (q,pr_fmt ()); +return NULL ; + } return container_of(q, struct nf_ct_frag6_queue, q); - -oom: -pr_debug ("Can't alloc new queue\n" ); -return NULL ; }
net/ipv6/reassembly.c +6 -2
@@ -26,6 +26,9 @@* YOSHIFUJI,H. @USAGI Always remove fragment header to * calculate ICV correctly. */ + +#define pr_fmt (fmt) "IPv6: " fmt +#include <linux/errno.h> #include <linux/types.h> #include <linux/string.h>
@@ -239,9 +242,10 @@ fq_find(struct net *net, __be32 id, const struct in6_addr *src, const struct in6 hash =inet6_hash_frag (id, src, dst, ip6_frags.rnd); q =inet_frag_find (&net->ipv6.frags, &ip6_frags, &arg, hash); -if (q ==NULL ) +if (IS_ERR_OR_NULL (q)) { +inet_frag_maybe_warn_overflow (q,pr_fmt ());return NULL ; - + } return container_of(q, struct frag_queue, q); }
net/sctp/associola.c +1 -1
@@ -1043,7 +1043,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc, transports) {if (transport == active) -break ; +continue ;list_for_each_entry (chunk, &transport->transmitted, transmitted_list) {if (key == chunk->subh.data_hdr->tsn) {
security/keys/compat.c +2 -2
@@ -40,12 +40,12 @@ long compat_keyctl_instantiate_key_iov(ARRAY_SIZE (iovstack), iovstack, &iov);if (ret <0 ) -return ret; + goto err;if (ret ==0 ) goto no_payload_free; ret =keyctl_instantiate_key_common (id, iov, ioc, ret, ringid); - +err:if (iov != iovstack)kfree (iov);return ret;
security/keys/keyctl.c +2 -2
@@ -1067,12 +1067,12 @@ long keyctl_instantiate_key_iov(key_serial_t id, ret =rw_copy_check_uvector (WRITE , _payload_iov, ioc,ARRAY_SIZE (iovstack), iovstack, &iov);if (ret <0 ) -return ret; + goto err;if (ret ==0 ) goto no_payload_free; ret =keyctl_instantiate_key_common (id, iov, ioc, ret, ringid); - +err:if (iov != iovstack)kfree (iov);return ret;
sound/pci/hda/hda_codec.c +1 -1
@@ -2625,7 +2625,7 @@ static unsigned int convert_to_spdif_status(unsigned short val)if (val &AC_DIG1_PROFESSIONAL ) sbits |=IEC958_AES0_PROFESSIONAL ;if (sbits &IEC958_AES0_PROFESSIONAL ) { -if (sbits &AC_DIG1_EMPHASIS ) +if (val &AC_DIG1_EMPHASIS ) sbits |=IEC958_AES0_PRO_EMPHASIS_5015 ; }else {if (val &AC_DIG1_EMPHASIS )
sound/usb/mixer.c +9 -7
@@ -711,8 +711,9 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_case UAC2_CLOCK_SELECTOR : {struct uac_selector_unit_descriptor *d = p1;/* call recursively to retrieve the channel info */ -if (check_input_term (state, d->baSourceID[0 ], term) <0 ) -return -ENODEV ; + err =check_input_term (state, d->baSourceID[0 ], term); +if (err <0 ) +return err; term->type = d->bDescriptorSubtype <<16 ;/* virtual type */ term->id = id; term->name =uac_selector_unit_iSelector (d);
@@ -1262,8 +1263,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, voidreturn err;/* determine the input source type and name */ -if (check_input_term (state, hdr->bSourceID, &iterm) <0 ) -return -EINVAL ; + err =check_input_term (state, hdr->bSourceID, &iterm); +if (err <0 ) +return err; master_bits =snd_usb_combine_bytes (bmaControls, csize);/* master configuration quirks */
@@ -2024,7 +2026,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) state.oterm.type =le16_to_cpu (desc->wTerminalType); state.oterm.name = desc->iTerminal; err =parse_audio_unit (&state, desc->bSourceID); -if (err <0 ) +if (err <0 && err != -EINVAL )return err; }else {/* UAC_VERSION_2 */ struct uac2_output_terminal_descriptor *desc = p;
@@ -2036,12 +2038,12 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) state.oterm.type =le16_to_cpu (desc->wTerminalType); state.oterm.name = desc->iTerminal; err =parse_audio_unit (&state, desc->bSourceID); -if (err <0 ) +if (err <0 && err != -EINVAL )return err;/* for UAC2, use the same approach to also add the clock selectors */ err =parse_audio_unit (&state, desc->bCSourceID); -if (err <0 ) +if (err <0 && err != -EINVAL )return err; } }