3.4.57-stable review
Subsystems (27)
Greg Kroah-Hartman
maintainercover 3.4.57-stable review
This is the start of the stable review cycle for the 3.4.57 release. There are 25 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Aug 11 01:33:13 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.57-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.4.57-rc1
Neil Horman <[email protected]>
8139cp: Add dma_mapping_error checking
Dan Carpenter <[email protected]>
net_sched: info leak in atm_tc_dump_class()
Dan Carpenter <[email protected]>
af_key: more info leaks in pfkey messages
David S. Miller <[email protected]>
net_sched: Fix stack info leak in cbq_dump_wrr().
Eric Dumazet <[email protected]>
usbnet: do not pretend to support SG/TSO
Hannes Frederic Sowa <[email protected]>
ipv6: take rtnl_lock and mark mrt6 table as freed on namespace cleanup
Neil Horman <[email protected]>
sctp: fully initialize sctp_outq in sctp_outq_init
Michal Tesar <[email protected]>
sysctl net: Keep tcp_syn_retries inside the boundary
Dan Carpenter <[email protected]>
arcnet: cleanup sizeof parameter
Salman Qazi <[email protected]>
perf: Use css_tryget() to avoid propping up css refcount
Kamal Mostafa <[email protected]>
drm/i915: quirk no PCH_PWM_ENABLE for Dell XPS13 backlight
H.J. Lu <[email protected]>
x86, fpu: correct the asm constraints for fxsave, unbreak mxcsr.daz
Jiri Olsa <[email protected]>
perf: Fix event group context move
Dan Carpenter <[email protected]>
fanotify: info leak in copy_event_to_user()
Zhu Yanhai <[email protected]>
sched: Fix the broken sched_rr_get_interval()
Lan Tianyu <[email protected]>
ACPI / battery: Fix parsing _BIX return value
Tomasz Moń <[email protected]>
mwifiex: Add missing endian conversion.
Stanislaw Gruszka <[email protected]>
rt2x00: fix stop queue
Jacob Keller <[email protected]>
ixgbe: Fix Tx Hang issue with lldpad on 82598EB
Johannes Berg <[email protected]>
mac80211: fix duplicate retransmission detection
Michal Kazior <[email protected]>
nl80211: fix mgmt tx status and testmode reporting for netns
Oleksij Rempel <[email protected]>
ath9k_htc: do some initial hardware configuration
Uwe Kleine-König <[email protected]>
serial/mxs-auart: increase time to wait for transmitter to become idle
Uwe Kleine-König <[email protected]>
serial/mxs-auart: fix race condition in interrupt handler
Vinod Koul <[email protected]>
ALSA: compress: fix the return value for SNDRV_COMPRESS_VERSION
-------------
Diffstat:
Makefile | 4 +- arch/x86/kernel/i387.c | 2 +- drivers/acpi/battery.c | 2 + drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 16 ++++++++ drivers/gpu/drm/i915/intel_lvds.c | 3 +- drivers/net/arcnet/arcnet.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c | 3 +- drivers/net/ethernet/realtek/8139cp.c | 48 ++++++++++++++++++++-- drivers/net/usb/smsc75xx.c | 12 ++---- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 + drivers/net/wireless/mwifiex/sdio.c | 4 +- drivers/net/wireless/rt2x00/rt2x00queue.c | 18 ++++---- drivers/tty/serial/mxs-auart.c | 38 +++++++++-------- fs/notify/fanotify/fanotify_user.c | 1 + kernel/events/core.c | 30 +++++++++++--- kernel/sched/fair.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 6 ++- net/ipv6/ip6mr.c | 5 +++ net/key/af_key.c | 4 ++ net/mac80211/rx.c | 10 ++++- net/sched/sch_atm.c | 1 + net/sched/sch_cbq.c | 1 + net/sctp/outqueue.c | 8 +--- net/wireless/nl80211.c | 7 +++- sound/core/compress_offload.c | 2 +- 26 files changed, 169 insertions(+), 62 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/25 ALSA: compress: fix the return value for SNDRV_COMPRESS_VERSION
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinod Koul <[email protected]>
commit a8d30608eaed6cc759b8e2e8a8bbbb42591f797f upstream.
the return value of SNDRV_COMPRESS_VERSION always return default -ENOTTY as the return value was never updated for this call
assign return value from put_user()
--- sound/core/compress_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/compress_offload.c +1 -1
@@ -582,7 +582,7 @@ static long snd_compr_ioctl(struct filemutex_lock (&stream->device->lock);switch (_IOC_NR (cmd)) {case _IOC_NR (SNDRV_COMPRESS_IOCTL_VERSION ): -put_user (SNDRV_COMPRESS_VERSION , + retval =put_user (SNDRV_COMPRESS_VERSION , (int __user *)arg) ? -EFAULT :0 ;break ;case _IOC_NR (SNDRV_COMPRESS_GET_CAPS ):
Greg Kroah-Hartman
maintainerPATCH 2/25 serial/mxs-auart: fix race condition in interrupt handler
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
commit d970d7fe65adff5efe75b4a73c4ffc9be57089f7 upstream.
The handler needs to ack the pending events before actually handling them. Otherwise a new event might come in after it it considered non-pending or handled and is acked then without being handled. So this event is only noticed when the next interrupt happens.
Without this patch an i.MX28 based machine running an rt-patched kernel regularly hangs during boot.
--- drivers/tty/serial/mxs-auart.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/tty/serial/mxs-auart.c +9 -8
@@ -375,11 +375,18 @@ static void mxs_auart_settermios(structstatic irqreturn_t mxs_auart_irq_handle (int irq,void *context) { -u32 istatus, istat; +u32 istat;struct mxs_auart_port *s = context;u32 stat =readl (s->port.membase +AUART_STAT ); - istatus = istat =readl (s->port.membase +AUART_INTR ); + istat =readl (s->port.membase +AUART_INTR ); + +/* ack irq */ +writel (istat & (AUART_INTR_RTIS + |AUART_INTR_TXIS + |AUART_INTR_RXIS + |AUART_INTR_CTSMIS ), + s->port.membase +AUART_INTR_CLR );if (istat &AUART_INTR_CTSMIS ) {uart_handle_cts_change (&s->port, stat &AUART_STAT_CTS );
@@ -398,12 +405,6 @@ static irqreturn_t mxs_auart_irq_handle( istat &= ~AUART_INTR_TXIS ; } -writel (istatus & (AUART_INTR_RTIS - |AUART_INTR_TXIS - |AUART_INTR_RXIS - |AUART_INTR_CTSMIS ), - s->port.membase +AUART_INTR_CLR ); -return IRQ_HANDLED ; }
Greg Kroah-Hartman
maintainerPATCH 3/25 serial/mxs-auart: increase time to wait for transmitter to become idle
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
commit 079a036f4283e2b0e5c26080b8c5112bc0cc1831 upstream.
Without this patch the driver waits ~1 ms for the UART to become idle. At 115200n8 this time is (theoretically) enough to transfer 11.5 characters (= 115200 bits/s / (10 Bits/char) * 1ms). As the mxs-auart has a fifo size of 16 characters the clock is gated too early. The problem is worse for lower baud rates.
This only happens to really shut down the transmitter in the middle of a transfer if /dev/ttyAPPx isn't opened in userspace (e.g. by a getty) but was at least once (because the bootloader doesn't disable the transmitter).
So increase the timeout to 20 ms which should be enough for 9600n8, too. Moreover skip gating the clock if the timeout is elapsed.
--- drivers/tty/serial/mxs-auart.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/tty/serial/mxs-auart.c +13 -8
@@ -544,7 +544,7 @@ auart_console_write(struct console *co,struct mxs_auart_port *s;struct uart_port *port;unsigned int old_ctrl0, old_ctrl2; -unsigned int to =1000 ; +unsigned int to =20000 ;if (co->index >MXS_AUART_PORTS || co->index <0 )return ;
@@ -565,18 +565,23 @@ auart_console_write(struct console *co,uart_console_write (port, str, count, mxs_auart_console_putchar); -/* -* Finally, wait for transmitter to become empty -* and restore the TCR -*/ +/* Finally, wait for transmitter to become empty ... */ while (readl (port->membase +AUART_STAT ) &AUART_STAT_BUSY ) { +udelay (1 );if (!to--)break ; -udelay (1 ); } -writel (old_ctrl0, port->membase +AUART_CTRL0 ); -writel (old_ctrl2, port->membase +AUART_CTRL2 ); +/* +* ... and restore the TCR if we waited long enough for the transmitter +* to be idle. This might keep the transmitter enabled although it is +* unused, but that is better than to disable it while it is still +* transmitting. +*/ +if (!(readl (port->membase +AUART_STAT ) &AUART_STAT_BUSY )) { +writel (old_ctrl0, port->membase +AUART_CTRL0 ); +writel (old_ctrl2, port->membase +AUART_CTRL2 ); + }clk_disable (s->clk); }
Greg Kroah-Hartman
maintainerPATCH 4/25 ath9k_htc: do some initial hardware configuration
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleksij Rempel <[email protected]>
commit dc2a87f519a4d8cb376ab54f22b6b98a943b51ce upstream.
Currently we configure harwdare and clock, only after interface start. In this case, if we reload module or reboot PC without configuring adapter, firmware will freeze. There is no software way to reset adpter.
This patch add initial configuration and set it in disabled state, to avoid this freeze. Behaviour of this patch should be similar to: ifconfig wlan0 up; ifconfig wlan0 down.
--- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -0
@@ -821,6 +821,7 @@ static int ath9k_init_device(struct ath9if (error !=0 ) goto err_rx; +ath9k_hw_disable (priv->ah);#ifdef CONFIG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw,
Greg Kroah-Hartman
maintainerPATCH 5/25 nl80211: fix mgmt tx status and testmode reporting for netns
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Kazior <[email protected]>
commit a0ec570f4f69c4cb700d743a915096c2c8f56a99 upstream.
These two events were sent to the default network namespace.
This caused AP mode in a non-default netns to not work correctly. Mgmt tx status was multicasted to a different (default) netns instead of the one the AP was in.
--- net/wireless/nl80211.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/wireless/nl80211.c +5 -2
@@ -5081,12 +5081,14 @@ EXPORT_SYMBOL(cfg80211_testmode_alloc_evvoid cfg80211_testmode_event (struct sk_buff *skb,gfp_t gfp) { +struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0 ];void *hdr = ((void **)skb->cb)[1 ];struct nlattr *data = ((void **)skb->cb)[2 ];nla_nest_end (skb, data);genlmsg_end (skb, hdr); -genlmsg_multicast (skb,0 , nl80211_testmode_mcgrp.id, gfp); +genlmsg_multicast_netns (wiphy_net (&rdev->wiphy), skb,0 , + nl80211_testmode_mcgrp.id, gfp); }EXPORT_SYMBOL (cfg80211_testmode_event);#endif
@@ -7768,7 +7770,8 @@ void nl80211_send_mgmt_tx_status(structgenlmsg_end (msg, hdr); -genlmsg_multicast (msg,0 , nl80211_mlme_mcgrp.id, gfp); +genlmsg_multicast_netns (wiphy_net (&rdev->wiphy), msg,0 , + nl80211_mlme_mcgrp.id, gfp);return ; nla_put_failure:
Greg Kroah-Hartman
maintainerPATCH 6/25 mac80211: fix duplicate retransmission detection
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 6b0f32745dcfba01d7be33acd1b40306c7a914c6 upstream.
The duplicate retransmission detection code in mac80211 erroneously attempts to do the check for every frame, even frames that don't have a sequence control field or that don't use it (QoS-Null frames.)
This is problematic because it causes the code to access data beyond the end of the SKB and depending on the data there will drop packets erroneously.
Correct the code to not do duplicate detection for such frames.
I found this error while testing AP powersave, it lead to retransmitted PS-Poll frames being dropped entirely as the data beyond the end of the SKB was always zero.
--- net/mac80211/rx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
net/mac80211/rx.c +8 -2
@@ -831,8 +831,14 @@ ieee80211_rx_h_check(struct ieee80211_rxstruct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;struct ieee80211_rx_status *status =IEEE80211_SKB_RXCB (rx->skb); -/* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */ -if (rx->sta && !is_multicast_ether_addr (hdr->addr1)) { +/* +* Drop duplicate 802.11 retransmissions +* (IEEE 802.11-2012: 9.3.2.10 "Duplicate detection and recovery") +*/ +if (rx->skb->len >=24 && rx->sta && + !ieee80211_is_ctl (hdr->frame_control) && + !ieee80211_is_qos_nullfunc (hdr->frame_control) && + !is_multicast_ether_addr (hdr->addr1)) {if (unlikely (ieee80211_has_retry (hdr->frame_control) && rx->sta->last_seq_ctrl[rx->seqno_idx] == hdr->seq_ctrl)) {
Greg Kroah-Hartman
maintainerPATCH 7/25 ixgbe: Fix Tx Hang issue with lldpad on 82598EB
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
commit 1eb9ac14c34a948bf1538bfb9034e8ab29099a64 upstream.
This patch fixes an issue with the 82598EB device, where lldpad is causing Tx Hangs on the card as soon as it attempts to configure DCB for the device. The adapter will continually Tx hang and reset in a loop.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c +1 -2
@@ -108,9 +108,8 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_825/* Enable arbiter */ reg &= ~IXGBE_DPMCS_ARBDIS ; -/* Enable DFP and Recycle mode */ - reg |= (IXGBE_DPMCS_TDPAC |IXGBE_DPMCS_TRM ); reg |=IXGBE_DPMCS_TSOEF ; +/* Configure Max TSO packet size 34KB including payload and headers */ reg |= (0x4 <<IXGBE_DPMCS_MTSOS_SHIFT );
Greg Kroah-Hartman
maintainerPATCH 8/25 rt2x00: fix stop queue
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit e2288b66fe7ff0288382b2af671b4da558b44472 upstream.
Since we clear QUEUE_STARTED in rt2x00queue_stop_queue(), following call to rt2x00queue_pause_queue() reduce to noop, i.e we do not stop queue in mac80211.
To fix that introduce rt2x00queue_pause_queue_nocheck() function, which will stop queue in mac80211 directly.
Note that rt2x00_start_queue() explicitly set QUEUE_PAUSED bit.
Note also that reordering operations i.e. first call to rt2x00queue_pause_queue() and then clear QUEUE_STARTED bit, will race with rt2x00queue_unpause_queue(), so calling ieee80211_stop_queue() directly is the only available solution to fix the problem without major rework.
--- drivers/net/wireless/rt2x00/rt2x00queue.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +11 -7
@@ -856,13 +856,8 @@ void rt2x00queue_index_inc(struct queue_spin_unlock_irqrestore (&queue->index_lock, irqflags); } -void rt2x00queue_pause_queue (struct data_queue *queue) +void rt2x00queue_pause_queue_nocheck (struct data_queue *queue) { -if (!test_bit (DEVICE_STATE_PRESENT , &queue->rt2x00dev->flags) || - !test_bit (QUEUE_STARTED , &queue->flags) || -test_and_set_bit (QUEUE_PAUSED , &queue->flags)) -return ; -switch (queue->qid) {case QID_AC_VO :case QID_AC_VI :
@@ -878,6 +873,15 @@ void rt2x00queue_pause_queue(struct databreak ; } } +void rt2x00queue_pause_queue (struct data_queue *queue) +{ +if (!test_bit (DEVICE_STATE_PRESENT , &queue->rt2x00dev->flags) || + !test_bit (QUEUE_STARTED , &queue->flags) || +test_and_set_bit (QUEUE_PAUSED , &queue->flags)) +return ; + +rt2x00queue_pause_queue_nocheck (queue); +}EXPORT_SYMBOL_GPL (rt2x00queue_pause_queue);void rt2x00queue_unpause_queue (struct data_queue *queue)
@@ -939,7 +943,7 @@ void rt2x00queue_stop_queue(struct data_return ; } -rt2x00queue_pause_queue (queue); +rt2x00queue_pause_queue_nocheck (queue); queue->rt2x00dev->ops->lib->stop_queue (queue);
Greg Kroah-Hartman
maintainerPATCH 9/25 mwifiex: Add missing endian conversion.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Moń <[email protected]>
commit 83e612f632c3897be29ef02e0472f6d63e258378 upstream.
Both type and pkt_len variables are in host endian and these should be in Little Endian in the payload.
--- drivers/net/wireless/mwifiex/sdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mwifiex/sdio.c +2 -2
@@ -1449,8 +1449,8 @@ static int mwifiex_sdio_host_to_card(str/* Allocate buffer and copy payload */ blk_size =MWIFIEX_SDIO_BLOCK_SIZE ; buf_block_len = (pkt_len + blk_size -1 ) / blk_size; - *(u16 *) &payload[0 ] = (u16 ) pkt_len; - *(u16 *) &payload[2 ] = type; + *(__le16 *)&payload[0 ] =cpu_to_le16 ((u16 )pkt_len); + *(__le16 *)&payload[2 ] =cpu_to_le16 (type);/* * This is SDIO specific header
Greg Kroah-Hartman
maintainerPATCH 10/25 ACPI / battery: Fix parsing _BIX return value
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lan Tianyu <[email protected]>
commit 016d5baad04269e8559332df05f89bd95b52d6ad upstream.
The _BIX method returns extended battery info as a package. According the ACPI spec (ACPI 5, Section 10.2.2.2), the first member of that package should be "Revision". However, the current ACPI battery driver treats the first member as "Power Unit" which should be the second member. This causes the result of _BIX return data parsing to be incorrect.
Fix this by adding a new member called 'revision' to struct acpi_battery and adding the offsetof() information on it to extended_info_offsets[] as the first row.
References: http://bugzilla.kernel.org/show_bug.cgi?id=60519
--- drivers/acpi/battery.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/battery.c +2 -0
@@ -117,6 +117,7 @@ struct acpi_battery {struct acpi_device *device;struct notifier_block pm_nb;unsigned long update_time; +int revision;int rate_now;int capacity_now;int voltage_now;
@@ -350,6 +351,7 @@ static struct acpi_offsets info_offsets[ };static struct acpi_offsets extended_info_offsets[] = { + {offsetof(struct acpi_battery , revision),0 }, {offsetof(struct acpi_battery , power_unit),0 }, {offsetof(struct acpi_battery , design_capacity),0 }, {offsetof(struct acpi_battery , full_charge_capacity),0 },
Greg Kroah-Hartman
maintainerPATCH 11/25 sched: Fix the broken sched_rr_get_interval()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhu Yanhai <[email protected]>
commit a59f4e079d19464eebb9b06513a1d4f55fdae5ba upstream.
The caller of sched_sliced() should pass se.cfs_rq and se as the arguments, however in sched_rr_get_interval() we gave it rq.cfs_rq and se, which made the following computation obviously wrong.
The change was introduced by commit:
77034937dc45 sched: fix crash in sys_sched_rr_get_interval()
... 5 years ago, while it had been the correct 'cfs_rq_of' before the commit. The change seems to be irrelevant to the commit msg, which was to return a 0 timeslice for tasks that are on an idle runqueue. So I believe that was just a plain typo.
[ Since this is an ABI and an old bug, we'll test this via a
slow upstream route, to hopefully discover any app breakage. ]
--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -5511,7 +5511,7 @@ static unsigned int get_rr_interval_fair* idle runqueue: */ if (rq->cfs.load.weight) - rr_interval =NS_TO_JIFFIES (sched_slice (&rq->cfs, se)); + rr_interval =NS_TO_JIFFIES (sched_slice (cfs_rq_of (se), se));return rr_interval; }
Greg Kroah-Hartman
maintainerPATCH 12/25 fanotify: info leak in copy_event_to_user()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit de1e0c40aceb9d5bff09c3a3b97b2f1b178af53f upstream.
The ->reserved field isn't cleared so we leak one byte of stack information to userspace.
--- fs/notify/fanotify/fanotify_user.c | 1 + 1 file changed, 1 insertion(+)
fs/notify/fanotify/fanotify_user.c +1 -0
@@ -120,6 +120,7 @@ static int fill_event_metadata(struct fs metadata->event_len =FAN_EVENT_METADATA_LEN ; metadata->metadata_len =FAN_EVENT_METADATA_LEN ; metadata->vers =FANOTIFY_METADATA_VERSION ; + metadata->reserved =0 ; metadata->mask = event->mask &FAN_ALL_OUTGOING_EVENTS ; metadata->pid =pid_vnr (event->tgid);if (unlikely (event->mask &FAN_Q_OVERFLOW ))
Greg Kroah-Hartman
maintainerPATCH 13/25 perf: Fix event group context move
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <[email protected]>
commit 0231bb5336758426b44ccd798ccd3c5419c95d58 upstream.
When we have group with mixed events (hw/sw) we want to end up with group leader being in hw context. So if group leader is initialy sw event, we move all the events under hw context.
The move is done for each event by removing it from its context and adding it back into proper one. As a part of the removal the event is automatically disabled, which is not what we want at this stage of creating groups.
The fix is to initialize event state after removal from sw context.
This fix resulted from the following discussion:
http://thread.gmane.org/gmane.linux.kernel.perf.user/1144
--- kernel/events/core.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
kernel/events/core.c +18 -2
@@ -911,6 +911,15 @@ list_add_event(struct perf_event *event, }/* +* Initialize event state based on the perf_event_attr::disabled. +*/ +static inline void perf_event__state_init (struct perf_event *event) +{ + event->state = event->attr.disabled ?PERF_EVENT_STATE_OFF : +PERF_EVENT_STATE_INACTIVE ; +} + +/* * Called at perf_event creation and when events are attached/detached from a * group. */
@@ -6058,8 +6067,7 @@ perf_event_alloc(struct perf_event_attr event->overflow_handler = overflow_handler; event->overflow_handler_context = context; -if (attr->disabled) - event->state =PERF_EVENT_STATE_OFF ; +perf_event__state_init (event); pmu =NULL ;
@@ -6481,9 +6489,17 @@ SYSCALL_DEFINE5(perf_event_open,mutex_lock (&gctx->mutex);perf_remove_from_context (group_leader); + +/* +* Removing from the context ends up with disabled +* event. What we want here is event in the initial +* startup state, ready to be add into new context. +*/ +perf_event__state_init (group_leader);list_for_each_entry (sibling, &group_leader->sibling_list, group_entry) {perf_remove_from_context (sibling); +perf_event__state_init (sibling);put_ctx (gctx); }mutex_unlock (&gctx->mutex);
Greg Kroah-Hartman
maintainerPATCH 14/25 x86, fpu: correct the asm constraints for fxsave, unbreak mxcsr.daz
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "H.J. Lu" <[email protected]>
commit eaa5a990191d204ba0f9d35dbe5505ec2cdd1460 upstream.
GCC will optimize mxcsr_feature_mask_init in arch/x86/kernel/i387.c:
memset(&fx_scratch, 0, sizeof(struct i387_fxsave_struct));
asm volatile("fxsave %0" : : "m" (fx_scratch));
mask = fx_scratch.mxcsr_mask;
if (mask == 0)
mask = 0x0000ffbf;to
memset(&fx_scratch, 0, sizeof(struct i387_fxsave_struct));
asm volatile("fxsave %0" : : "m" (fx_scratch));
mask = 0x0000ffbf;since asm statement doesn’t say it will update fx_scratch. As the result, the DAZ bit will be cleared. This patch fixes it. This bug dates back to at least kernel 2.6.12.
--- arch/x86/kernel/i387.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/i387.c +1 -1
@@ -132,7 +132,7 @@ static void __cpuinit mxcsr_feature_maskclts ();if (cpu_has_fxsr) {memset (&fx_scratch,0 ,sizeof (struct i387_fxsave_struct )); - asmvolatile ("fxsave %0" : :"m" (fx_scratch)); + asmvolatile ("fxsave %0" :"+m" (fx_scratch)); mask = fx_scratch.mxcsr_mask;if (mask ==0 ) mask =0x0000ffbf ;
Greg Kroah-Hartman
maintainerPATCH 15/25 drm/i915: quirk no PCH_PWM_ENABLE for Dell XPS13 backlight
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamal Mostafa <[email protected]>
commit e85843bec6c2ea7c10ec61238396891cc2b753a9 upstream.
Some machines suffer from non-functional backlight controls if BLM_PCH_PWM_ENABLE is set, so provide a quirk to avoid doing so. Apply this quirk to Dell XPS 13 models.
[ kamal: backport to 3.4 ]
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 16 ++++++++++++++++ drivers/gpu/drm/i915/intel_lvds.c | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -296,6 +296,7 @@ enum intel_pch {#define QUIRK_PIPEA_FORCE (1<<0)#define QUIRK_LVDS_SSC_DISABLE (1<<1) +#define QUIRK_NO_PCH_PWM_ENABLE (1<<2)struct intel_fbdev ;struct intel_fbc_work ;
drivers/gpu/drm/i915/intel_display.c +16 -0
@@ -9160,6 +9160,17 @@ static void quirk_ssc_force_disable(stru dev_priv->quirks |=QUIRK_LVDS_SSC_DISABLE ; } +/* +* Some machines (Dell XPS13) suffer broken backlight controls if +* BLM_PCH_PWM_ENABLE is set. +*/ +static void quirk_no_pcm_pwm_enable (struct drm_device *dev) +{ +struct drm_i915_private *dev_priv = dev->dev_private; + dev_priv->quirks |=QUIRK_NO_PCH_PWM_ENABLE ; +DRM_INFO ("applying no-PCH_PWM_ENABLE quirk\n" ); +} +struct intel_quirk {int device;int subsystem_vendor;
@@ -9192,6 +9203,11 @@ struct intel_quirk intel_quirks[] = {/* Sony Vaio Y cannot use SSC on LVDS */ { 0x0046, 0x104d, 0x9076, quirk_ssc_force_disable }, + +/* Dell XPS13 HD Sandy Bridge */ + { 0x0116, 0x1028, 0x052e, quirk_no_pcm_pwm_enable }, +/* Dell XPS13 HD and XPS13 FHD Ivy Bridge */ + { 0x0166, 0x1028, 0x058b, quirk_no_pcm_pwm_enable }, };static void intel_init_quirks (struct drm_device *dev)
drivers/gpu/drm/i915/intel_lvds.c +2 -1
@@ -1097,7 +1097,8 @@ bool intel_lvds_init(struct drm_device * goto failed; out: -if (HAS_PCH_SPLIT (dev)) { +if (HAS_PCH_SPLIT (dev) && + !(dev_priv->quirks &QUIRK_NO_PCH_PWM_ENABLE )) {u32 pwm; pipe = (I915_READ (PCH_LVDS ) &LVDS_PIPEB_SELECT ) ?1 :0 ;
Greg Kroah-Hartman
maintainerPATCH 16/25 perf: Use css_tryget() to avoid propping up css refcount
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Salman Qazi <[email protected]>
commit 9c5da09d266ca9b32eb16cf940f8161d949c2fe5 upstream.
An rmdir pushes css's ref count to zero. However, if the associated directory is open at the time, the dentry ref count is non-zero. If the fd for this directory is then passed into perf_event_open, it does a css_get(). This bounces the ref count back up from zero. This is a problem by itself. But what makes it turn into a crash is the fact that we end up doing an extra dput, since we perform a dput when css_put sees the ref count go down to zero.
css_tryget() does not fall into that trap. So, we use that instead.
Reproduction test-case for the bug:
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/unistd.h>
#include <linux/perf_event.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#define PERF_FLAG_PID_CGROUP (1U << 2)
int perf_event_open(struct perf_event_attr *hw_event_uptr,
pid_t pid, int cpu, int group_fd, unsigned long flags) {
return syscall(__NR_perf_event_open,hw_event_uptr, pid, cpu,
group_fd, flags);}
/*
* Directly poke at the perf_event bug, since it's proving hard to repro
* depending on where in the kernel tree. what moved?
*/
int main(int argc, char **argv)
{
int fd;
struct perf_event_attr attr;
memset(&attr, 0, sizeof(attr));
attr.exclude_kernel = 1;
attr.size = sizeof(attr);
mkdir("/dev/cgroup/perf_event/blah", 0777);
fd = open("/dev/cgroup/perf_event/blah", O_RDONLY);
perror("open");
rmdir("/dev/cgroup/perf_event/blah");
sleep(2);
perf_event_open(&attr, fd, 0, -1, PERF_FLAG_PID_CGROUP);
perror("perf_event_open");
close(fd);
return 0;}
--- kernel/events/core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
kernel/events/core.c +7 -3
@@ -250,9 +250,9 @@ perf_cgroup_match(struct perf_event *evereturn !event->cgrp || event->cgrp == cpuctx->cgrp; } -static inline void perf_get_cgroup (struct perf_event *event) +static inline bool perf_tryget_cgroup (struct perf_event *event) { -css_get (&event->cgrp->css); +return css_tryget (&event->cgrp->css); }static inline void perf_put_cgroup (struct perf_event *event)
@@ -481,7 +481,11 @@ static inline int perf_cgroup_connect(in event->cgrp = cgrp;/* must be done before we fput() the file */ -perf_get_cgroup (event); +if (!perf_tryget_cgroup (event)) { + event->cgrp =NULL ; + ret = -ENOENT ; + goto out; + }/* * all events in a group must monitor
Greg Kroah-Hartman
maintainerPATCH 17/25 arcnet: cleanup sizeof parameter
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 087d273caf4f7d3f2159256f255f1f432bc84a5b ]
This patch doesn't change the compiled code because ARC_HDR_SIZE is 4 and sizeof(int) is 4, but the intent was to use the header size and not the sizeof the header size.
--- drivers/net/arcnet/arcnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/arcnet/arcnet.c +1 -1
@@ -1007,7 +1007,7 @@ static void arcnet_rx(struct net_device soft = &pkt.soft.rfc1201; - lp->hw.copy_from_card (dev, bufnum,0 , &pkt,sizeof (ARC_HDR_SIZE )); + lp->hw.copy_from_card (dev, bufnum,0 , &pkt,ARC_HDR_SIZE );if (pkt.hard.offset[0 ]) { ofs = pkt.hard.offset[0 ]; length =256 - ofs;
Greg Kroah-Hartman
maintainerPATCH 18/25 sysctl net: Keep tcp_syn_retries inside the boundary
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Tesar <[email protected]>
[ Upstream commit 651e92716aaae60fc41b9652f54cb6803896e0da ]
Limit the min/max value passed to the/proc/sys/net/ipv4/tcp_syn_retries.
--- net/ipv4/sysctl_net_ipv4.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/ipv4/sysctl_net_ipv4.c +5 -1
@@ -34,6 +34,8 @@ static int tcp_adv_win_scale_min = -31;static int tcp_adv_win_scale_max =31 ;static int ip_ttl_min =1 ;static int ip_ttl_max =255 ; +static int tcp_syn_retries_min =1 ; +static int tcp_syn_retries_max =MAX_TCP_SYNCNT ;static int ip_ping_group_range_min[] = {0 ,0 };static int ip_ping_group_range_max[] = {GID_T_MAX ,GID_T_MAX };
@@ -276,7 +278,9 @@ static struct ctl_table ipv4_table[] = { .data = &sysctl_tcp_syn_retries, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dointvec_minmax, + .extra1 = &tcp_syn_retries_min, + .extra2 = &tcp_syn_retries_max }, { .procname = "tcp_synack_retries",
Greg Kroah-Hartman
maintainerPATCH 19/25 sctp: fully initialize sctp_outq in sctp_outq_init
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Horman <[email protected]>
[ Upstream commit c5c7774d7eb4397891edca9ebdf750ba90977a69 ]
In commit 2f94aabd9f6c925d77aecb3ff020f1cc12ed8f86
(refactor sctp_outq_teardown to insure proper re-initalization) we modified sctp_outq_teardown to use sctp_outq_init to fully re-initalize the outq structure. Steve West recently asked me why I removed the q->error = 0 initalization from sctp_outq_teardown. I did so because I was operating under the impression that sctp_outq_init would properly initalize that value for us, but it doesn't. sctp_outq_init operates under the assumption that the outq struct is all 0's (as it is when called from sctp_association_init), but using it in __sctp_outq_teardown violates that assumption. We should do a memset in sctp_outq_init to ensure that the entire structure is in a known state there instead.
--- net/sctp/outqueue.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
net/sctp/outqueue.c +2 -6
@@ -205,6 +205,8 @@ static inline int sctp_cacc_skip(struct*/ void sctp_outq_init (struct sctp_association *asoc,struct sctp_outq *q) { +memset (q,0 ,sizeof (struct sctp_outq )); + q->asoc = asoc;INIT_LIST_HEAD (&q->out_chunk_list);INIT_LIST_HEAD (&q->control_chunk_list);
@@ -212,13 +214,7 @@ void sctp_outq_init(struct sctp_associatINIT_LIST_HEAD (&q->sacked);INIT_LIST_HEAD (&q->abandoned); - q->fast_rtx =0 ; - q->outstanding_bytes =0 ; q->empty =1 ; - q->cork =0 ; - - q->malloced =0 ; - q->out_qlen =0 ; }/* Free the outqueue structure and any related pending chunks.
Greg Kroah-Hartman
maintainerPATCH 20/25 ipv6: take rtnl_lock and mark mrt6 table as freed on namespace cleanup
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Frederic Sowa <[email protected]>
[ Upstream commit 905a6f96a1b18e490a75f810d733ced93c39b0e5 ]
Otherwise we end up dereferencing the already freed net->ipv6.mrt pointer which leads to a panic (from Srivatsa S. Bhat):
BUG: unable to handle kernel paging request at ffff882018552020 IP: [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6] PGD 290a067 PUD 207ffe0067 PMD 207ff1d067 PTE 8000002018552060 Oops: 0000 [#1] SMP DEBUG_PAGEALLOC Modules linked in: ebtable_nat ebtables nfs fscache nf_conntrack_ipv4 nf_defrag_ipv4 ipt_REJECT xt_CHECKSUM iptable_mangle iptable_filter ip_tables nfsd lockd nfs_acl exportfs auth_rpcgss autofs4 sunrpc 8021q garp bridge stp llc ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter +ip6_tables ipv6 vfat fat vhost_net macvtap macvlan vhost tun kvm_intel kvm uinput iTCO_wdt iTCO_vendor_support cdc_ether usbnet mii microcode i2c_i801 i2c_core lpc_ich mfd_core shpchp ioatdma dca mlx4_core be2net wmi acpi_cpufreq mperf ext4 jbd2 mbcache dm_mirror dm_region_hash dm_log dm_mod CPU: 0 PID: 7 Comm: kworker/u33:0 Not tainted 3.11.0-rc1-ea45e-a #4 Hardware name: IBM -[8737R2A]-/00Y2738, BIOS -[B2E120RUS-1.20]- 11/30/2012 Workqueue: netns cleanup_net task: ffff8810393641c0 ti: ffff881039366000 task.ti: ffff881039366000 RIP: 0010:[<ffffffffa0366b02>] [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6] RSP: 0018:ffff881039367bd8 EFLAGS: 00010286 RAX: ffff881039367fd8 RBX: ffff882018552000 RCX: dead000000200200 RDX: 0000000000000000 RSI: ffff881039367b68 RDI: ffff881039367b68 RBP: ffff881039367bf8 R08: ffff881039367b68 R09: 2222222222222222 R10: 2222222222222222 R11: 2222222222222222 R12: ffff882015a7a040 R13: ffff882014eb89c0 R14: ffff8820289e2800 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88103fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff882018552020 CR3: 0000000001c0b000 CR4: 00000000000407f0 Stack: ffff881039367c18 ffff882014eb89c0 ffff882015e28c00 0000000000000000 ffff881039367c18 ffffffffa034d9d1 ffff8820289e2800 ffff882014eb89c0 ffff881039367c58 ffffffff815bdecb ffffffff815bddf2 ffff882014eb89c0 Call Trace: [<ffffffffa034d9d1>] rawv6_close+0x21/0x40 [ipv6] [<ffffffff815bdecb>] inet_release+0xfb/0x220 [<ffffffff815bddf2>] ? inet_release+0x22/0x220 [<ffffffffa032686f>] inet6_release+0x3f/0x50 [ipv6] [<ffffffff8151c1d9>] sock_release+0x29/0xa0 [<ffffffff81525520>] sk_release_kernel+0x30/0x70 [<ffffffffa034f14b>] icmpv6_sk_exit+0x3b/0x80 [ipv6] [<ffffffff8152fff9>] ops_exit_list+0x39/0x60 [<ffffffff815306fb>] cleanup_net+0xfb/0x1a0 [<ffffffff81075e3a>] process_one_work+0x1da/0x610 [<ffffffff81075dc9>] ? process_one_work+0x169/0x610 [<ffffffff81076390>] worker_thread+0x120/0x3a0 [<ffffffff81076270>] ? process_one_work+0x610/0x610 [<ffffffff8107da2e>] kthread+0xee/0x100 [<ffffffff8107d940>] ? __init_kthread_worker+0x70/0x70 [<ffffffff8162a99c>] ret_from_fork+0x7c/0xb0 [<ffffffff8107d940>] ? __init_kthread_worker+0x70/0x70 Code: 20 48 89 5d e8 4c 89 65 f0 4c 89 6d f8 66 66 66 66 90 4c 8b 67 30 49 89 fd e8 db 3c 1e e1 49 8b 9c 24 90 08 00 00 48 85 db 74 06 <4c> 39 6b 20 74 20 bb f3 ff ff ff e8 8e 3c 1e e1 89 d8 4c 8b 65 RIP [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6] RSP <ffff881039367bd8>
CR2: ffff882018552020
--- net/ipv6/ip6mr.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ipv6/ip6mr.c +5 -0
@@ -256,10 +256,12 @@ static void __net_exit ip6mr_rules_exit( {struct mr6_table *mrt, *next; +rtnl_lock ();list_for_each_entry_safe (mrt, next, &net->ipv6.mr6_tables, list) {list_del (&mrt->list);ip6mr_free_table (mrt); } +rtnl_unlock ();fib_rules_unregister (net->ipv6.mr6_rules_ops); }#else
@@ -286,7 +288,10 @@ static int __net_init ip6mr_rules_init(s static void __net_exit ip6mr_rules_exit(struct net *net) { +rtnl_lock ();ip6mr_free_table (net->ipv6.mrt6); + net->ipv6.mrt6 =NULL ; +rtnl_unlock (); }#endif
Greg Kroah-Hartman
maintainerPATCH 21/25 usbnet: do not pretend to support SG/TSO
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 20f0170377264e8449b6987041f0bcc4d746d3ed ]
usbnet doesn't support yet SG, so drivers should not advertise SG or TSO capabilities, as they allow TCP stack to build large TSO packets that need to be linearized and might use order-5 pages.
This adds an extra copy overhead and possible allocation failures.
Current code ignore skb_linearize() return code so crashes are even possible.
Best is to not pretend SG/TSO is supported, and add this again when/if usbnet really supports SG for devices who could get a performance gain.
Based on a prior patch from Freddy Xin <[email protected]>
--- drivers/net/usb/smsc75xx.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/net/usb/smsc75xx.c +3 -9
@@ -43,7 +43,6 @@#define EEPROM_MAC_OFFSET (0x01)#define DEFAULT_TX_CSUM_ENABLE (true)#define DEFAULT_RX_CSUM_ENABLE (true) -#define DEFAULT_TSO_ENABLE (true)#define SMSC75XX_INTERNAL_PHY_ID (1)#define SMSC75XX_TX_OVERHEAD (8)#define MAX_RX_FIFO_SIZE (20 * 1024)
@@ -1049,17 +1048,14 @@ static int smsc75xx_bind(struct usbnet *INIT_WORK (&pdata->set_multicast, smsc75xx_deferred_multicast_write); -if (DEFAULT_TX_CSUM_ENABLE ) { +if (DEFAULT_TX_CSUM_ENABLE ) dev->net->features |=NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM ; -if (DEFAULT_TSO_ENABLE ) - dev->net->features |=NETIF_F_SG | -NETIF_F_TSO |NETIF_F_TSO6 ; - } +if (DEFAULT_RX_CSUM_ENABLE ) dev->net->features |=NETIF_F_RXCSUM ; dev->net->hw_features =NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM | -NETIF_F_SG |NETIF_F_TSO |NETIF_F_TSO6 |NETIF_F_RXCSUM ; +NETIF_F_RXCSUM ;/* Init all registers */ ret =smsc75xx_reset (dev);
@@ -1184,8 +1180,6 @@ static struct sk_buff *smsc75xx_tx_fixup {u32 tx_cmd_a, tx_cmd_b; -skb_linearize (skb); -if (skb_headroom (skb) <SMSC75XX_TX_OVERHEAD ) {struct sk_buff *skb2 =skb_copy_expand (skb,SMSC75XX_TX_OVERHEAD ,0 , flags);
Greg Kroah-Hartman
maintainerPATCH 22/25 net_sched: Fix stack info leak in cbq_dump_wrr().
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <[email protected]>
[ Upstream commit a0db856a95a29efb1c23db55c02d9f0ff4f0db48 ]
Make sure the reserved fields, and padding (if any), are fully initialized.
Based upon a patch by Dan Carpenter and feedback from Joe Perches.
--- net/sched/sch_cbq.c | 1 + 1 file changed, 1 insertion(+)
net/sched/sch_cbq.c +1 -0
@@ -1467,6 +1467,7 @@ static int cbq_dump_wrr(struct sk_buff *unsigned char *b =skb_tail_pointer (skb);struct tc_cbq_wrropt opt; +memset (&opt,0 ,sizeof (opt)); opt.flags =0 ; opt.allot = cl->allot; opt.priority = cl->priority +1 ;
Greg Kroah-Hartman
maintainerPATCH 23/25 af_key: more info leaks in pfkey messages
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit ff862a4668dd6dba962b1d2d8bd344afa6375683 ]
This is inspired by a5cc68f3d6 "af_key: fix info leaks in notify messages". There are some struct members which don't get initialized and could disclose small amounts of private information.
--- net/key/af_key.c | 4 ++++ 1 file changed, 4 insertions(+)
net/key/af_key.c +4 -0
@@ -2073,6 +2073,7 @@ static int pfkey_xfrm_policy2msg(struct pol->sadb_x_policy_type =IPSEC_POLICY_NONE ; } pol->sadb_x_policy_dir = dir+1 ; + pol->sadb_x_policy_reserved =0 ; pol->sadb_x_policy_id = xp->index; pol->sadb_x_policy_priority = xp->priority;
@@ -3108,7 +3109,9 @@ static int pfkey_send_acquire(struct xfr pol->sadb_x_policy_exttype =SADB_X_EXT_POLICY ; pol->sadb_x_policy_type =IPSEC_POLICY_IPSEC ; pol->sadb_x_policy_dir = dir+1 ; + pol->sadb_x_policy_reserved =0 ; pol->sadb_x_policy_id = xp->index; + pol->sadb_x_policy_priority = xp->priority;/* Set sadb_comb's. */ if (x->id.proto ==IPPROTO_AH )
@@ -3496,6 +3499,7 @@ static int pfkey_send_migrate(const stru pol->sadb_x_policy_exttype =SADB_X_EXT_POLICY ; pol->sadb_x_policy_type =IPSEC_POLICY_IPSEC ; pol->sadb_x_policy_dir = dir +1 ; + pol->sadb_x_policy_reserved =0 ; pol->sadb_x_policy_id =0 ; pol->sadb_x_policy_priority =0 ;
Greg Kroah-Hartman
maintainerPATCH 24/25 net_sched: info leak in atm_tc_dump_class()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 8cb3b9c3642c0263d48f31d525bcee7170eedc20 ]
The "pvc" struct has a hole after pvc.sap_family which is not cleared.
--- net/sched/sch_atm.c | 1 + 1 file changed, 1 insertion(+)
net/sched/sch_atm.c +1 -0
@@ -606,6 +606,7 @@ static int atm_tc_dump_class(struct Qdisstruct sockaddr_atmpvc pvc;int state; +memset (&pvc,0 ,sizeof (pvc)); pvc.sap_family =AF_ATMPVC ; pvc.sap_addr.itf = flow->vcc->dev ? flow->vcc->dev->number :-1 ; pvc.sap_addr.vpi = flow->vcc->vpi;
Greg Kroah-Hartman
maintainerPATCH 25/25 8139cp: Add dma_mapping_error checking
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Horman <[email protected]>
[ Upstream commit cf3c4c03060b688cbc389ebc5065ebcce5653e96 ]
Self explanitory dma_mapping_error addition to the 8139 driver, based on this:
https://bugzilla.redhat.com/show_bug.cgi?id=947250
It showed several backtraces arising for dma_map_* usage without checking the return code on the mapping. Add the check and abort the rx/tx operation if its failed. Untested as I have no hardware and the reporter has wandered off, but seems pretty straightforward.
--- drivers/net/ethernet/realtek/8139cp.c | 48 +++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-)
drivers/net/ethernet/realtek/8139cp.c +45 -3
@@ -478,7 +478,7 @@ rx_status_loop:while (1 ) {u32 status, len; -dma_addr_t mapping; +dma_addr_t mapping, new_mapping;struct sk_buff *skb, *new_skb;struct cp_desc *desc;const unsigned buflen = cp->rx_buf_sz;
@@ -520,6 +520,13 @@ rx_status_loop: goto rx_next; } + new_mapping =dma_map_single (&cp->pdev->dev, new_skb->data, buflen, +PCI_DMA_FROMDEVICE ); +if (dma_mapping_error (&cp->pdev->dev, new_mapping)) { + dev->stats.rx_dropped++; + goto rx_next; + } +dma_unmap_single (&cp->pdev->dev, mapping, buflen,PCI_DMA_FROMDEVICE );
@@ -531,12 +538,11 @@ rx_status_loop:skb_put (skb, len); - mapping =dma_map_single (&cp->pdev->dev, new_skb->data, buflen, -PCI_DMA_FROMDEVICE ); cp->rx_skb[rx_tail] = new_skb;cp_rx_skb (cp, skb, desc); rx++; + mapping = new_mapping; rx_next: cp->rx_ring[rx_tail].opts2 =0 ;
@@ -704,6 +710,22 @@ static inline u32 cp_tx_vlan_tag(struct TxVlanTag | swab16(vlan_tx_tag_get(skb)) : 0x00; } +static void unwind_tx_frag_mapping (struct cp_private *cp,struct sk_buff *skb, +int first,int entry_last) +{ +int frag, index; +struct cp_desc *txd; +skb_frag_t *this_frag; +for (frag =0 ; frag+first < entry_last; frag++) { + index = first+frag; + cp->tx_skb[index] =NULL ; + txd = &cp->tx_ring[index]; + this_frag = &skb_shinfo (skb)->frags[frag]; +dma_unmap_single (&cp->pdev->dev,le64_to_cpu (txd->addr), +skb_frag_size (this_frag),PCI_DMA_TODEVICE ); + } +} +static netdev_tx_t cp_start_xmit (struct sk_buff *skb,struct net_device *dev) {
@@ -737,6 +759,9 @@ static netdev_tx_t cp_start_xmit (struct len = skb->len; mapping =dma_map_single (&cp->pdev->dev, skb->data, len,PCI_DMA_TODEVICE ); +if (dma_mapping_error (&cp->pdev->dev, mapping)) + goto out_dma_error; + txd->opts2 = opts2; txd->addr =cpu_to_le64 (mapping);wmb ();
@@ -774,6 +799,9 @@ static netdev_tx_t cp_start_xmit (struct first_len =skb_headlen (skb); first_mapping =dma_map_single (&cp->pdev->dev, skb->data, first_len,PCI_DMA_TODEVICE ); +if (dma_mapping_error (&cp->pdev->dev, first_mapping)) + goto out_dma_error; + cp->tx_skb[entry] = skb; entry =NEXT_TX (entry);
@@ -787,6 +815,11 @@ static netdev_tx_t cp_start_xmit (struct mapping =dma_map_single (&cp->pdev->dev,skb_frag_address (this_frag), len,PCI_DMA_TODEVICE ); +if (dma_mapping_error (&cp->pdev->dev, mapping)) { +unwind_tx_frag_mapping (cp, skb, first_entry, entry); + goto out_dma_error; + } + eor = (entry == (CP_TX_RING_SIZE -1 )) ? RingEnd :0 ; ctrl = eor | len | DescOwn;
@@ -845,11 +878,16 @@ static netdev_tx_t cp_start_xmit (structif (TX_BUFFS_AVAIL (cp) <= (MAX_SKB_FRAGS +1 ))netif_stop_queue (dev); +out_unlock:spin_unlock_irqrestore (&cp->lock, intr_flags);cpw8 (TxPoll, NormalTxPoll);return NETDEV_TX_OK ; +out_dma_error: +kfree_skb (skb); + cp->dev->stats.tx_dropped++; + goto out_unlock; }/* Set or clear the multicast filter for this adaptor.
@@ -1020,6 +1058,10 @@ static int cp_refill_rx(struct cp_privat mapping =dma_map_single (&cp->pdev->dev, skb->data, cp->rx_buf_sz,PCI_DMA_FROMDEVICE ); +if (dma_mapping_error (&cp->pdev->dev, mapping)) { +kfree_skb (skb); + goto err_out; + } cp->rx_skb[i] = skb; cp->rx_ring[i].opts2 =0 ;
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.4.57 release. There are 25 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 7 lines
Responses should be made by Sun Aug 11 01:33:13 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.57-rc1.gzand the diffstat can be found below.
Cross build results:
Total builds: 62 Total build errors: 10
Details:
http://server.roeck-us.net:8010/builders/stable-queue-3.4/builds/21/steps/shell/logs/stdio/text
Same results as with previous release; reported differences are due to different build targets.
If anyone is interested in per-build logs, please let me know.
Thanks,
Guenter
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.4.57 release. There are 25 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Aug 11 01:33:13 UTC 2013. Anything received after that time might be too late.
Quoted 8 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.57-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches applied cleanly to 3.0.89, 3.4.56 and 3.10.5
Compiled and booted on the following systems:
Samsung Series 9 900X4C Intel Corei5:
(3.4.57-rc1, 3.10.6-rc1)
HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics:
(3.0.90-rc1, 3.4.57-rc1, and 3.10.6-rc1)dmesgs for all releases look good. No regressions compared to the previous dmesgs for each of these releases. dmesg emerg, crit, alert, err are clean. No regressions in warn.
Cross-compile testing:
HP Compaq dc7700 SFF desktop: x86-64 Intel Core-i2:
(3.0.90-rc1, 3.4.57-rc1, and 3.10.6-rc1)
Cross-compile tests results:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.10.y
blackfin: defconfig passed on all
c6x: not applicable to 3.0.y, defconfig passed on 3.4.y, and 3.10.y
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all
-- Shuah
Shuah Khan, Linux Kernel Developer - Open Source Group Samsung Research America (Silicon Valley) [email protected] | (970) 672-0658