4 stable kernel review cycles starting
Subsystems (111)
PATCH 106/156 ALSA: ac97: Add IBM ThinkPad R40e to Headphone/Line Jack Sense blacklist
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit e1f7f02b45cf33a774d56e505ce1718af9392f5e upstream.
This model needs both 'Headphone Jack Sense' and 'Line Jack Sense' muted for audible audio, so just add its SSID to the blacklist and don't enumerate the controls.
--- sound/pci/ac97/ac97_patch.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/ac97/ac97_patch.c +1 -0
@@ -1867,6 +1867,7 @@ static unsigned int ad1981_jacks_blackli0x10140523 ,/* Thinkpad R40 */ 0x10140534 ,/* Thinkpad X31 */ 0x10140537 ,/* Thinkpad T41p */ +0x1014053e ,/* Thinkpad R40e */ 0x10140554 ,/* Thinkpad T42p/R50p */ 0x10140567 ,/* Thinkpad T43p 2668-G7U */ 0x10140581, /* Thinkpad X41-2527 */
PATCH 107/156 ath9k: Enable TIM timer interrupt only when needed.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Senthil Balasubramanian <[email protected]>
commit 3f7c5c10e9dc6bf90179eb9f7c06151d508fb324 upstream.
The TIM timer interrupt is enabled even before the ACK of nullqos is received which is unnecessary.
Also clean up the CONF_PS part of config callback properly for better readability.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 + drivers/net/wireless/ath/ath9k/main.c | 24 ++++++++++++++---------- drivers/net/wireless/ath/ath9k/xmit.c | 7 +++---- 3 files changed, 18 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -0
@@ -267,6 +267,7 @@ void ath_tx_aggr_start(struct ath_softc u16 tid, u16 *ssn);void ath_tx_aggr_stop (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid);void ath_tx_aggr_resume (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid); +void ath9k_enable_ps (struct ath_softc *sc);/********/ /* VIFs */
drivers/net/wireless/ath/ath9k/main.c +14 -10
@@ -2681,6 +2681,19 @@ static void ath9k_remove_interface(strucmutex_unlock (&sc->mutex); } +void ath9k_enable_ps (struct ath_softc *sc) +{ + sc->ps_enabled = true; +if (!(sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_AUTOSLEEP )) { +if ((sc->imask &ATH9K_INT_TIM_TIMER ) ==0 ) { + sc->imask |=ATH9K_INT_TIM_TIMER ; +ath9k_hw_set_interrupts (sc->sc_ah, + sc->imask); + } + } +ath9k_hw_setrxabort (sc->sc_ah,1 ); +} +static int ath9k_config (struct ieee80211_hw *hw,u32 changed) {struct ath_wiphy *aphy = hw->priv;
@@ -2734,22 +2747,13 @@ static int ath9k_config(struct ieee80211if (changed &IEEE80211_CONF_CHANGE_PS ) {if (conf->flags &IEEE80211_CONF_PS ) { sc->sc_flags |=SC_OP_PS_ENABLED ; -if (!(ah->caps.hw_caps & -ATH9K_HW_CAP_AUTOSLEEP )) { -if ((sc->imask &ATH9K_INT_TIM_TIMER ) ==0 ) { - sc->imask |=ATH9K_INT_TIM_TIMER ; -ath9k_hw_set_interrupts (sc->sc_ah, - sc->imask); - } - }/* * At this point we know hardware has received an ACK * of a previously sent null data frame. */ if ((sc->sc_flags &SC_OP_NULLFUNC_COMPLETED )) { sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED ; - sc->ps_enabled = true; -ath9k_hw_setrxabort (sc->sc_ah,1 ); +ath9k_enable_ps (sc); } }else { sc->ps_enabled = false;
drivers/net/wireless/ath/ath9k/xmit.c +3 -4
@@ -2034,10 +2034,9 @@ static void ath_tx_processq(struct ath_s*/ if (bf->bf_isnullfunc && (ds->ds_txstat.ts_status &ATH9K_TX_ACKED )) { -if ((sc->sc_flags &SC_OP_PS_ENABLED )) { - sc->ps_enabled = true; -ath9k_hw_setrxabort (sc->sc_ah,1 ); - }else +if ((sc->sc_flags &SC_OP_PS_ENABLED )) +ath9k_enable_ps (sc); +else sc->sc_flags |=SC_OP_NULLFUNC_COMPLETED ; }
PATCH 108/156 ath9k: configure the beacon only if the STA is associated
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Senthil Balasubramanian <[email protected]>
commit 1a20034a73a40b8056731f9db0c535cec2961eb7 upstream.
beacons configuration SHOULD be done only if the STA is associated.
--- drivers/net/wireless/ath/ath9k/beacon.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/ath/ath9k/beacon.c +7 -0
@@ -573,6 +573,13 @@ static void ath_beacon_config_sta(structu64 tsf;int num_beacons, offset, dtim_dec_count, cfp_dec_count; +/* No need to configure beacon if we are not associated */ +if (!common->curaid) { +ath_print (common,ATH_DBG_BEACON , +"STA is not yet associated..skipping beacon config\n" ); +return ; + } +memset (&bs,0 ,sizeof (bs)); intval = conf->beacon_interval &ATH9K_BEACON_PERIOD ;
PATCH 109/156 mac80211: Retry null data frame for power save
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vivek Natarajan <[email protected]>
commit 375177bf35efc08e1bd37bbda4cc0c8cc4db8500 upstream.
Even if the null data frame is not acked by the AP, mac80211 goes into power save. This might lead to loss of frames from the AP.
Prevent this by restarting dynamic_ps_timer when ack is not received for null data frames.
--- include/net/mac80211.h | 4 ++++ net/mac80211/ieee80211_i.h | 1 + net/mac80211/mlme.c | 20 +++++++++++++++----- net/mac80211/status.c | 17 +++++++++++++++-- 4 files changed, 35 insertions(+), 7 deletions(-)
include/net/mac80211.h +4 -0
@@ -926,6 +926,9 @@ enum ieee80211_tkip_key_type {* @IEEE80211_HW_BEACON_FILTER: * Hardware supports dropping of irrelevant beacon frames to * avoid waking up cpu. +* @IEEE80211_HW_REPORTS_TX_ACK_STATUS: +* Hardware can provide ack status reports of Tx frames to +* the stack. */ enum ieee80211_hw_flags {IEEE80211_HW_HAS_RATE_CONTROL =1 <<0 ,
@@ -943,6 +946,7 @@ enum ieee80211_hw_flags {IEEE80211_HW_SUPPORTS_DYNAMIC_PS =1 <<12 ,IEEE80211_HW_MFP_CAPABLE =1 <<13 ,IEEE80211_HW_BEACON_FILTER =1 <<14 , + IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<15, };/**
net/mac80211/ieee80211_i.h +1 -0
@@ -264,6 +264,7 @@ enum ieee80211_sta_flags {IEEE80211_STA_DISABLE_11N =BIT (4 ),IEEE80211_STA_CSA_RECEIVED =BIT (5 ),IEEE80211_STA_MFP_ENABLED =BIT (6 ), + IEEE80211_STA_NULLFUNC_ACKED = BIT(7), };/* flags for MLME request */
net/mac80211/mlme.c +15 -5
@@ -662,8 +662,11 @@ static void ieee80211_enable_ps(struct i }else {if (local->hw.flags &IEEE80211_HW_PS_NULLFUNC_STACK )ieee80211_send_nullfunc (local, sdata,1 ); - conf->flags |=IEEE80211_CONF_PS ; -ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); + +if (!(local->hw.flags &IEEE80211_HW_REPORTS_TX_ACK_STATUS )) { + conf->flags |=IEEE80211_CONF_PS ; +ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); + } } }
@@ -754,6 +757,7 @@ void ieee80211_dynamic_ps_enable_work(st container_of(work, struct ieee80211_local, dynamic_ps_enable_work);struct ieee80211_sub_if_data *sdata = local->ps_sdata; +struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;/* can only happen when PS was just disabled anyway */ if (!sdata)
@@ -762,11 +766,16 @@ void ieee80211_dynamic_ps_enable_work(stif (local->hw.conf.flags &IEEE80211_CONF_PS )return ; -if (local->hw.flags &IEEE80211_HW_PS_NULLFUNC_STACK ) +if ((local->hw.flags &IEEE80211_HW_PS_NULLFUNC_STACK ) && + (!(ifmgd->flags &IEEE80211_STA_NULLFUNC_ACKED )))ieee80211_send_nullfunc (local, sdata,1 ); - local->hw.conf.flags |=IEEE80211_CONF_PS ; -ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); +if (!(local->hw.flags &IEEE80211_HW_REPORTS_TX_ACK_STATUS ) || + (ifmgd->flags &IEEE80211_STA_NULLFUNC_ACKED )) { + ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED ; + local->hw.conf.flags |=IEEE80211_CONF_PS ; +ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); + } }void ieee80211_dynamic_ps_timer (unsigned long data)
@@ -2468,6 +2477,7 @@ int ieee80211_mgd_assoc(struct ieee80211list_add (&wk->list, &ifmgd->work_list); ifmgd->flags &= ~IEEE80211_STA_DISABLE_11N ; + ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED ;for (i =0 ; i < req->crypto.n_ciphers_pairwise; i++) if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||
net/mac80211/status.c +15 -2
@@ -165,6 +165,7 @@ void ieee80211_tx_status(struct ieee8021rcu_read_lock (); sband = local->hw.wiphy->bands[info->band]; + fc = hdr->frame_control; sta =sta_info_get (local, hdr->addr1);
@@ -180,8 +181,6 @@ void ieee80211_tx_status(struct ieee8021return ; } - fc = hdr->frame_control; -if ((info->flags &IEEE80211_TX_STAT_AMPDU_NO_BACK ) && (ieee80211_is_data_qos (fc))) {u16 tid, ssn;
@@ -246,6 +245,20 @@ void ieee80211_tx_status(struct ieee8021 local->dot11FailedCount++; } +if (ieee80211_is_nullfunc (fc) &&ieee80211_has_pm (fc) && + (local->hw.flags &IEEE80211_HW_REPORTS_TX_ACK_STATUS ) && + !(info->flags &IEEE80211_TX_CTL_INJECTED ) && + local->ps_sdata && !(local->scanning)) { +if (info->flags &IEEE80211_TX_STAT_ACK ) { + local->ps_sdata->u.mgd.flags |= +IEEE80211_STA_NULLFUNC_ACKED ; +ieee80211_queue_work (&local->hw, + &local->dynamic_ps_enable_work); + }else +mod_timer (&local->dynamic_ps_timer, jiffies + +msecs_to_jiffies (10 )); + } +/* this was a transmitted frame, but now we want to reuse it */ skb_orphan (skb);
PATCH 110/156 ath9k: Enable IEEE80211_HW_REPORTS_TX_ACK_STATUS flag for ath9k
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vivek Natarajan <[email protected]>
commit 05df49865be08b30e7ba91b9d3d94d7d52dd3033 upstream.
--- drivers/net/wireless/ath/ath9k/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/main.c +1 -0
@@ -1856,6 +1856,7 @@ void ath_set_hw_capab(struct ath_softc *IEEE80211_HW_SIGNAL_DBM |IEEE80211_HW_SUPPORTS_PS |IEEE80211_HW_PS_NULLFUNC_STACK | +IEEE80211_HW_REPORTS_TX_ACK_STATUS |IEEE80211_HW_SPECTRUM_MGMT ;if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_HT )
PATCH 111/156 leds-gpio: fix default state handling on OF platforms
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anton Vorontsov <[email protected]>
commit 0493a4ff10959ff4c8e0d65efee25b7ffd4fa5db upstream.
The driver wrongly sets default state for LEDs that don't specify default-state property.
Currently the driver handles default state this way:
memset(&led, 0, sizeof(led));
for_each_child_of_node(np, child) {
state = of_get_property(child, "default-state", NULL);
if (state) {
if (!strcmp(state, "keep"))
led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
...
}
ret = create_gpio_led(&led, ...);
}Which means that all LEDs that do not specify default-state will inherit the last value of the default-state property, which is wrong.
This patch fixes the issue by moving LED's template initialization into the loop body.
--- drivers/leds/leds-gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/leds/leds-gpio.c +1 -2
@@ -211,7 +211,6 @@ static int __devinit of_gpio_leds_probe( const struct of_device_id *match) {struct device_node *np = ofdev->node, *child; -struct gpio_led led;struct gpio_led_of_platform_data *pdata;int count =0 , ret;
@@ -226,8 +225,8 @@ static int __devinit of_gpio_leds_probe(if (!pdata)return -ENOMEM ; -memset (&led,0 ,sizeof (led));for_each_child_of_node (np, child) { +struct gpio_led led = {};enum of_gpio_flags flags;const char *state;
PATCH 112/156 icside: bring back ->maskproc method
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bartlomiej Zolnierkiewicz <[email protected]>
[ Upstream commit f75d4a238770d83d3a0475ce7f34e3fa37de161e ]
Bring back ->maskproc method since it is still needed for proper operation, as noticed by Russell King:
Quoted 27 lines
This change is bogus.
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1); readb(base + ICS_ARCIN_V6_INTROFFSET_2); writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2); readb(base + ICS_ARCIN_V6_INTROFFSET_1);This sequence of code does:
1. enable interrupt 1
2. disable interrupt 2
3. enable interrupt 2
4. disable interrupt 1which results in the interrupt for the second channel being enabled - leaving channel 1 blocked.
Firstly, icside shares its two IDE channels with one DMA engine - so it's a simplex interface. IDE supports those (or did when the code was written) serializing requests between the two interfaces. libata does not.
Secondly, the interrupt lines on icside float when there's no drive connected or when the drive has its NIEN bit set, which means that you get spurious screaming interrupts which can kill off all expansion card interrupts on the machine unless you disable the channel interrupt on the card.
Quoted 5 lines
Since libata can not serialize the operation of the two channels like IDE can, the libata version of the icside driver does not contain the interrupt stearing logic. Instead, it looks at the status after reset, and if nothing was found on that channel, it masks the interrupt from that channel.
This patch reverts changes done in commit dff8817 (I became confused due to non-standard & undocumented ->maskproc method, anyway sorry about that).
--- drivers/ide/icside.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 4 deletions(-)
drivers/ide/icside.c +60 -4
@@ -65,6 +65,8 @@ static struct cardinfo icside_cardinfo_v };struct icside_state { +unsigned int channel; +unsigned int enabled;void __iomem *irq_port;void __iomem *ioc_base;unsigned int sel;
@@ -114,11 +116,18 @@ static void icside_irqenable_arcin_v6 (sstruct icside_state *state = ec->irq_data;void __iomem *base = state->irq_port; -writeb (0 , base +ICS_ARCIN_V6_INTROFFSET_1 ); -readb (base +ICS_ARCIN_V6_INTROFFSET_2 ); + state->enabled =1 ; -writeb (0 , base +ICS_ARCIN_V6_INTROFFSET_2 ); -readb (base +ICS_ARCIN_V6_INTROFFSET_1 ); +switch (state->channel) { +case 0 : +writeb (0 , base +ICS_ARCIN_V6_INTROFFSET_1 ); +readb (base +ICS_ARCIN_V6_INTROFFSET_2 ); +break ; +case 1 : +writeb (0 , base +ICS_ARCIN_V6_INTROFFSET_2 ); +readb (base +ICS_ARCIN_V6_INTROFFSET_1 ); +break ; + } }/* Prototype: icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
@@ -128,6 +137,8 @@ static void icside_irqdisable_arcin_v6 ( {struct icside_state *state = ec->irq_data; + state->enabled =0 ; +readb (state->irq_port +ICS_ARCIN_V6_INTROFFSET_1 );readb (state->irq_port +ICS_ARCIN_V6_INTROFFSET_2 ); }
@@ -149,6 +160,44 @@ static const expansioncard_ops_t icside_ .irqpending = icside_irqpending_arcin_v6, }; +/* +* Handle routing of interrupts. This is called before +* we write the command to the drive. +*/ +static void icside_maskproc (ide_drive_t *drive,int mask) +{ +ide_hwif_t *hwif = drive->hwif; +struct expansion_card *ec =ECARD_DEV (hwif->dev); +struct icside_state *state =ecard_get_drvdata (ec); +unsigned long flags; + +local_irq_save (flags); + + state->channel = hwif->channel; + +if (state->enabled && !mask) { +switch (hwif->channel) { +case 0 : +writeb (0 , state->irq_port +ICS_ARCIN_V6_INTROFFSET_1 ); +readb (state->irq_port +ICS_ARCIN_V6_INTROFFSET_2 ); +break ; +case 1 : +writeb (0 , state->irq_port +ICS_ARCIN_V6_INTROFFSET_2 ); +readb (state->irq_port +ICS_ARCIN_V6_INTROFFSET_1 ); +break ; + } + }else { +readb (state->irq_port +ICS_ARCIN_V6_INTROFFSET_2 ); +readb (state->irq_port +ICS_ARCIN_V6_INTROFFSET_1 ); + } + +local_irq_restore (flags); +} + +static const struct ide_port_ops icside_v6_no_dma_port_ops = { + .maskproc = icside_maskproc, +}; +#ifdef CONFIG_BLK_DEV_IDEDMA_ICS /* * SG-DMA support.
@@ -228,6 +277,7 @@ static void icside_set_dma_mode(ide_drivstatic const struct ide_port_ops icside_v6_port_ops = { .set_dma_mode = icside_set_dma_mode, + .maskproc = icside_maskproc, };static void icside_dma_host_set (ide_drive_t *drive,int on)
@@ -272,6 +322,11 @@ static int icside_dma_setup(ide_drive_tBUG_ON (dma_channel_active (ec->dma));/* +* Ensure that we have the right interrupt routed. +*/ +icside_maskproc (drive,0 ); + +/* * Route the DMA signals to the correct interface. */ writeb (state->sel | hwif->channel, state->ioc_base);
@@ -399,6 +454,7 @@ err_free:static const struct ide_port_info icside_v6_port_info__initdata = { .init_dma = icside_dma_off_init, + .port_ops = &icside_v6_no_dma_port_ops, .dma_ops = &icside_v6_dma_ops, .host_flags =IDE_HFLAG_SERIALIZE |IDE_HFLAG_MMIO , .mwdma_mask =ATA_MWDMA2 ,
PATCH 113/156 Revert "ide: skip probe if there are no devices on the port (v2)"
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit 9ce41aed0d392246eb788786253f242e829fd5e1 ]
This reverts commit a20b2a44eca52818ef52a94959480b7e6ea2f528.
As requested by David Fries. This makes CDROMs which are slave drives on a ribbon without a master disappear and causes other similar kinds of badness.
--- drivers/ide/ide-probe.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/ide/ide-probe.c +3 -9
@@ -695,14 +695,8 @@ static int ide_probe_port(ide_hwif_t *hwif (irqd)disable_irq (hwif->irq); - rc =ide_port_wait_ready (hwif); -if (rc == -ENODEV ) { -printk (KERN_INFO "%s: no devices on the port\n" , hwif->name); - goto out; - }else if (rc == -EBUSY ) -printk (KERN_ERR "%s: not ready before the probe\n" , hwif->name); -else - rc = -ENODEV ; +if (ide_port_wait_ready (hwif) == -EBUSY ) +printk (KERN_DEBUG "%s: Wait for ready failed before probe !\n" , hwif->name);/* * Second drive should only exist if first drive was found,
@@ -713,7 +707,7 @@ static int ide_probe_port(ide_hwif_t *hwif (drive->dev_flags &IDE_DFLAG_PRESENT ) rc =0 ; } -out: +/* * Use cached IRQ number. It might be (and is...) changed by probe * code above
PATCH 114/156 ide: Fix Promise UDMA33 IDE driver (pdc202xx_old)
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Russell King <[email protected]>
[ Upstream commit c3be57b6f35ef96a980ce84e59d6a5a8ca6184ad ]
Quoted 4 lines · Russell King
- with IDE
- locks the interrupt line, and makes the machine extremely painful - about an hour to get to the point of being able to unload thepdc202xx_oldmodule.
Having manually bisected kernel versions, I've narrowed it down to some change between 2.6.30 and 2.6.31. There's not much which has changed between the two kernels, but one change stands out like a sore thumb:
+static int pdc202xx_test_irq(ide_hwif_t *hwif)
+{
+ struct pci_dev *dev = to_pci_dev(hwif->dev);
+ unsigned long high_16 = pci_resource_start(dev, 4);
+ u8 sc1d = inb(high_16 + 0x1d);
+
+ if (hwif->channel) {
+ /*
+ * bit 7: error, bit 6: interrupting,
+ * bit 5: FIFO full, bit 4: FIFO empty
+ */
+ return ((sc1d & 0x50) == 0x40) ? 1 : 0;
+ } else {
+ /*
+ * bit 3: error, bit 2: interrupting,
+ * bit 1: FIFO full, bit 0: FIFO empty
+ */+ return ((sc1d & 0x05) == 0x04) ? 1 : 0;
+ }
+}
Reading the (documented as a 32-bit) system control register when the interface is idle gives: 0x01da110c
So, the byte at 0x1d is 0x11, which is documented as meaning that the primary and secondary FIFOs are empty.
The code above, which is trying to see whether an IRQ is pending, checks for the IRQ bit to be one, and the FIFO bit to be zero - or in English, to be non-empty.
Since during a BM-DMA read, the FIFOs will naturally be drained to the PCI bus, the chance of us getting to the interface before this happens are extremely small - and if we don't, it means we decide not to service the interrupt. Hence, the screaming interrupt problem with drivers/ide.
Fix this by only indicating an interrupt is ready if both the interrupt and FIFO empty bits are at '1'.
This bug only affects PDC20246/PDC20247 (Promise Ultra33) based cards, and has been tested on 2.6.31 and 2.6.33-rc2.
--- drivers/ide/pdc202xx_old.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ide/pdc202xx_old.c +2 -2
@@ -100,13 +100,13 @@ static int pdc202xx_test_irq(ide_hwif_t* bit 7: error, bit 6: interrupting, * bit 5: FIFO full, bit 4: FIFO empty */ -return ((sc1d &0x50 ) ==0x40 ) ?1 :0 ; +return ((sc1d &0x50 ) ==0x50 ) ?1 :0 ; }else {/* * bit 3: error, bit 2: interrupting, * bit 1: FIFO full, bit 0: FIFO empty */ -return ((sc1d &0x05 ) ==0x04 ) ?1 :0 ; +return ((sc1d &0x05 ) ==0x05 ) ?1 :0 ; } }
PATCH 115/156 qlogicpti: Remove slash in QlogicPTI irq name
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Meelis Roos <[email protected]>
[ Upstream commit 77d3926306bf4eecac50150ba5625797219f14ba ]
qlogicpti driver registers its irq with a name containing slash. This results in
[ 71.049735] WARNING: at fs/proc/generic.c:316 __xlate_proc_name+0xa8/0xb8() [ 71.132815] name 'Qlogic/PTI'
because proc_mkdir with the name of the irq fails. Fix it by just removing the slash from irq name. Discovered and tested on real hardware (Sun Ultra 1).
--- drivers/scsi/qlogicpti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qlogicpti.c +1 -1
@@ -738,7 +738,7 @@ static int __devinit qpti_register_irq(s* sanely maintain. */ if (request_irq (qpti->irq, qpti_intr, -IRQF_SHARED ,"Qlogic/PTI" , qpti)) +IRQF_SHARED ,"QlogicPTI" , qpti)) goto fail;printk ("qlogicpti%d: IRQ %d " , qpti->qpti_id, qpti->irq);
PATCH 116/156 sparc64: Properly truncate pt_regs framepointer in perf callback.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit 9e8307ecaf9f8c8b5b3b22145021204c4e73114a ]
For 32-bit processes, we save the full 64-bits of the regs in pt_regs.
But unlike when the userspace actually does load and store instructions, the top 32-bits don't get automatically truncated by the cpu in kernel mode (because the kernel doesn't execute with PSTATE_AM address masking enabled).
So we have to do it by hand.
--- arch/sparc/kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/perf_event.c +1 -1
@@ -1337,7 +1337,7 @@ static void perf_callchain_user_32(struccallchain_store (entry,PERF_CONTEXT_USER );callchain_store (entry, regs->tpc); - ufp = regs->u_regs[UREG_I6 ]; + ufp = regs->u_regs[UREG_I6 ] &0xffffffffUL ; do { struct sparc_stackf32 *usf, sf; unsigned long pc;
PATCH 117/156 sparc64: Add very basic XVR-1000 framebuffer driver.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commits 2d378b9179881b46a0faf11430efb421fe03ddd8 and
f04e879bf296d136bcafd8c5a26e95599b141671 ]
--- drivers/video/Kconfig | 12 ++ drivers/video/Makefile | 1 drivers/video/sunxvr1000.c | 228 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 241 insertions(+)
drivers/video/Kconfig +12 -0
@@ -909,6 +909,18 @@ config FB_XVR2500 mostly initialized the card already. It is treated as a completely dumb framebuffer device. +config FB_XVR1000 + bool "Sun XVR-1000 support" + depends on (FB = y) && SPARC64 + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This is the framebuffer device for the Sun XVR-1000 and similar + graphics cards. The driver only works on sparc64 systems where + the system firmware has mostly initialized the card already. It + is treated as a completely dumb framebuffer device. + config FB_PVR2 tristate "NEC PowerVR 2 display support" depends on FB && SH_DREAMCAST
drivers/video/Makefile +1 -0
@@ -79,6 +79,7 @@ obj-$(CONFIG_FB_N411) += n41 obj-$(CONFIG_FB_HGA) += hgafb.o obj-$(CONFIG_FB_XVR500) += sunxvr500.o obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o +obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o obj-$(CONFIG_FB_IGA) += igafb.o obj-$(CONFIG_FB_APOLLO) += dnfb.o obj-$(CONFIG_FB_Q40) += q40fb.o
drivers/video/sunxvr1000.c new file +228 -0
228 lines not on this page · raw message
PATCH 118/156 l2tp: Fix oops in pppol2tp_xmit
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: James Chapman <[email protected]>
[ Upstream commit 3feec9095d12e311b7d4eb7fe7e5dfa75d4a72a5 ]
When transmitting L2TP frames, we derive the outgoing interface's UDP checksum hardware assist capabilities from the tunnel dst dev. This can sometimes be NULL, especially when routing protocols are used and routing changes occur. This patch just checks for NULL dst or dev pointers when checking for netdev hardware assist features.
BUG: unable to handle kernel NULL pointer dereference at 0000000c IP: [<f89d074c>] pppol2tp_xmit+0x341/0x4da [pppol2tp] *pde = 00000000 Oops: 0000 [#1] SMP last sysfs file: /sys/class/net/lo/operstate Modules linked in: pppol2tp pppox ppp_generic slhc ipv6 dummy loop snd_hda_codec_atihdmi snd_hda_intel snd_hda_codec snd_pcm snd_timer snd soundcore snd_page_alloc evdev psmouse serio_raw processor button i2c_piix4 i2c_core ati_agp agpgart pcspkr ext3 jbd mbcache sd_mod ide_pci_generic atiixp ide_core ahci ata_generic floppy ehci_hcd ohci_hcd libata e1000e scsi_mod usbcore nls_base thermal fan thermal_sys [last unloaded: scsi_wait_scan]
Pid: 0, comm: swapper Not tainted (2.6.32.8 #1)
EIP: 0060:[<f89d074c>] EFLAGS: 00010297 CPU: 3
EIP is at pppol2tp_xmit+0x341/0x4da [pppol2tp]
EAX: 00000000 EBX: f64d1680 ECX: 000005b9 EDX: 00000000
ESI: f6b91850 EDI: f64d16ac EBP: f6a0c4c0 ESP: f70a9cac
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process swapper (pid: 0, ti=f70a8000 task=f70a31c0 task.ti=f70a8000)
Stack: 000005a9 000005b9 f734c400 f66652c0 f7352e00 f67dc800 00000000 f6b91800 <0> 000005a3 f70ef6c4 f67dcda9 000005a3 f89b192e 00000246 000005a3 f64d1680 <0> f63633e0 f6363320 f64d1680 f65a7320 f65a7364 f65856c0 f64d1680 f679f02f Call Trace: [<f89b192e>] ? ppp_push+0x459/0x50e [ppp_generic] [<f89b217f>] ? ppp_xmit_process+0x3b6/0x430 [ppp_generic] [<f89b2306>] ? ppp_start_xmit+0x10d/0x120 [ppp_generic] [<c11c15cb>] ? dev_hard_start_xmit+0x21f/0x2b2 [<c11d0947>] ? sch_direct_xmit+0x48/0x10e [<c11c19a0>] ? dev_queue_xmit+0x263/0x3a6 [<c11e2a9f>] ? ip_finish_output+0x1f7/0x221 [<c11df682>] ? ip_forward_finish+0x2e/0x30 [<c11de645>] ? ip_rcv_finish+0x295/0x2a9 [<c11c0b19>] ? netif_receive_skb+0x3e9/0x404 [<f814b791>] ? e1000_clean_rx_irq+0x253/0x2fc [e1000e] [<f814cb7a>] ? e1000_clean+0x63/0x1fc [e1000e] [<c1047eff>] ? sched_clock_local+0x15/0x11b [<c11c1095>] ? net_rx_action+0x96/0x195 [<c1035750>] ? __do_softirq+0xaa/0x151 [<c1035828>] ? do_softirq+0x31/0x3c [<c10358fe>] ? irq_exit+0x26/0x58 [<c1004b21>] ? do_IRQ+0x78/0x89 [<c1003729>] ? common_interrupt+0x29/0x30 [<c101ac28>] ? native_safe_halt+0x2/0x3 [<c1008c54>] ? default_idle+0x55/0x75 [<c1009045>] ? c1e_idle+0xd2/0xd5 [<c100233c>] ? cpu_idle+0x46/0x62 Code: 8d 45 08 f0 ff 45 08 89 6b 08 c7 43 68 7e fb 9c f8 8a 45 24 83 e0 0c 3c 04 75 09 80 63 64 f3 e9 b4 00 00 00 8b 43 18 8b 4c 24 04 <8b> 40 0c 8d 79 11 f6 40 44 0e 8a 43 64 75 51 6a 00 8b 4c 24 08 EIP: [<f89d074c>] pppol2tp_xmit+0x341/0x4da [pppol2tp] SS:ESP 0068:f70a9cac
CR2: 000000000000000c
--- drivers/net/pppol2tp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/pppol2tp.c +2 -1
@@ -1180,7 +1180,8 @@ static int pppol2tp_xmit(struct ppp_chan/* Calculate UDP checksum if configured to do so */ if (sk_tun->sk_no_check ==UDP_CSUM_NOXMIT ) skb->ip_summed =CHECKSUM_NONE ; -else if (!(skb_dst (skb)->dev->features &NETIF_F_V4_CSUM )) { +else if ((skb_dst (skb) &&skb_dst (skb)->dev) && + (!(skb_dst (skb)->dev->features &NETIF_F_V4_CSUM ))) { skb->ip_summed =CHECKSUM_COMPLETE ; csum =skb_checksum (skb,0 , udp_len,0 ); uh->check = csum_tcpudp_magic(inet->inet_saddr,
PATCH 119/156 l2tp: Fix UDP socket reference count bugs in the pppol2tp driver
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: James Chapman <[email protected]>
[ Upstream commit c3259c8a7060d480e8eb2166da0a99d6879146b4 ]
This patch fixes UDP socket refcnt bugs in the pppol2tp driver.
A bug can cause a kernel stack trace when a tunnel socket is closed.
A way to reproduce the issue is to prepare the UDP socket for L2TP (by opening a tunnel pppol2tp socket) and then close it before any L2TP sessions are added to it. The sequence is
Create UDP socket
Create tunnel pppol2tp socket to prepare UDP socket for L2TP
pppol2tp_connect: session_id=0, peer_session_id=0
L2TP SCCRP control frame received (tunnel_id==0)
pppol2tp_recv_core: sock_hold()
pppol2tp_recv_core: sock_put
L2TP ZLB control frame received (tunnel_id=nnn)
pppol2tp_recv_core: sock_hold()
pppol2tp_recv_core: sock_put
Close tunnel management socket
pppol2tp_release: session_id=0, peer_session_id=0
Close UDP socket
udp_lib_close: BUG
The addition of sock_hold() in pppol2tp_connect() solves the problem.
For data frames, two sock_put() calls were added to plug a refcnt leak per received data frame. The ref that is grabbed at the top of pppol2tp_recv_core() must always be released, but this wasn't done for accepted data frames or data frames discarded because of bad UDP checksums. This leak meant that any UDP socket that had passed L2TP data traffic (i.e. L2TP data frames, not just L2TP control frames) using pppol2tp would not be released by the kernel.
WARNING: at include/net/sock.h:435 udp_lib_unhash+0x117/0x120() Pid: 1086, comm: openl2tpd Not tainted 2.6.33-rc1 #8 Call Trace: [<c119e9b7>] ? udp_lib_unhash+0x117/0x120 [<c101b871>] ? warn_slowpath_common+0x71/0xd0 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120 [<c101b8e3>] ? warn_slowpath_null+0x13/0x20 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120 [<c11598a7>] ? sk_common_release+0x17/0x90 [<c11a5e33>] ? inet_release+0x33/0x60 [<c11577b0>] ? sock_release+0x10/0x60 [<c115780f>] ? sock_close+0xf/0x30 [<c106e542>] ? __fput+0x52/0x150 [<c106b68e>] ? filp_close+0x3e/0x70 [<c101d2e2>] ? put_files_struct+0x62/0xb0 [<c101eaf7>] ? do_exit+0x5e7/0x650 [<c1081623>] ? mntput_no_expire+0x13/0x70 [<c106b68e>] ? filp_close+0x3e/0x70 [<c101eb8a>] ? do_group_exit+0x2a/0x70 [<c101ebe1>] ? sys_exit_group+0x11/0x20 [<c10029b0>] ? sysenter_do_call+0x12/0x26
--- drivers/net/pppol2tp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/pppol2tp.c +3 -0
@@ -756,6 +756,7 @@ static int pppol2tp_recv_core(struct soc/* Try to dequeue as many skbs from reorder_q as we can. */ pppol2tp_recv_dequeue (session); +sock_put (sock);return 0 ;
@@ -772,6 +773,7 @@ discard_bad_csum:UDP_INC_STATS_USER (&init_net,UDP_MIB_INERRORS ,0 ); tunnel->stats.rx_errors++;kfree_skb (skb); +sock_put (sock);return 0 ;
@@ -1662,6 +1664,7 @@ static int pppol2tp_connect(struct sockeif (tunnel_sock ==NULL ) goto end; +sock_hold (tunnel_sock); tunnel = tunnel_sock->sk_user_data; }else { tunnel =pppol2tp_tunnel_find (sock_net (sk), sp->pppol2tp.s_tunnel);
PATCH 120/156 route: Fix caught BUG_ON during rt_secret_rebuild_oneshot()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vitaliy Gusev <[email protected]>
[ Upstream commit 858a18a6a2f74e8f0e5b2e9671d4b74694aba708 ]
route: Fix caught BUG_ON during rt_secret_rebuild_oneshot()
Call rt_secret_rebuild can cause BUG_ON(timer_pending(&net->ipv4.rt_secret_timer)) in add_timer as there is not any synchronization for call rt_secret_rebuild_oneshot() for the same net namespace.
Also this issue affects to rt_secret_reschedule().
Thus use mod_timer enstead.
--- net/ipv4/route.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
net/ipv4/route.c +6 -10
@@ -922,10 +922,8 @@ static void rt_secret_rebuild_oneshot(st {del_timer_sync (&net->ipv4.rt_secret_timer);rt_cache_invalidate (net); -if (ip_rt_secret_interval) { - net->ipv4.rt_secret_timer.expires += ip_rt_secret_interval; -add_timer (&net->ipv4.rt_secret_timer); - } +if (ip_rt_secret_interval) +mod_timer (&net->ipv4.rt_secret_timer, jiffies + ip_rt_secret_interval); }static void rt_emergency_hash_rebuild (struct net *net)
@@ -3072,22 +3070,20 @@ static void rt_secret_reschedule(int oldrtnl_lock ();for_each_net (net) {int deleted =del_timer_sync (&net->ipv4.rt_secret_timer); +long time;if (!new)continue ;if (deleted) { -long time = net->ipv4.rt_secret_timer.expires - jiffies; + time = net->ipv4.rt_secret_timer.expires - jiffies;if (time <=0 || (time += diff) <=0 ) time =0 ; - - net->ipv4.rt_secret_timer.expires = time; }else - net->ipv4.rt_secret_timer.expires = new; + time = new; - net->ipv4.rt_secret_timer.expires += jiffies; -add_timer (&net->ipv4.rt_secret_timer); +mod_timer (&net->ipv4.rt_secret_timer, jiffies + time); }rtnl_unlock (); }
PATCH 121/156 net: add limit for socket backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 8eae939f1400326b06d0c9afe53d2a484a326871 ]
We got system OOM while running some UDP netperf testing on the loopback device. The case is multiple senders sent stream UDP packets to a single receiver via loopback on local host. Of course, the receiver is not able to handle all the packets in time. But we surprisingly found that these packets were not discarded due to the receiver's sk->sk_rcvbuf limit. Instead, they are kept queuing to sk->sk_backlog and finally ate up all the memory. We believe this is a secure hole that a none privileged user can crash the system.
The root cause for this problem is, when the receiver is doing __release_sock() (i.e. after userspace recv, kernel udp_recvmsg -> skb_free_datagram_locked -> release_sock), it moves skbs from backlog to sk_receive_queue with the softirq enabled. In the above case, multiple busy senders will almost make it an endless loop. The skbs in the backlog end up eat all the system memory.
The issue is not only for UDP. Any protocols using socket backlog is potentially affected. The patch adds limit for socket backlog so that the backlog size cannot be expanded endlessly.
--- include/net/sock.h | 15 ++++++++++++++- net/core/sock.c | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-)
include/net/sock.h +14 -1
@@ -253,6 +253,8 @@ struct sock {struct {struct sk_buff *head;struct sk_buff *tail; +int len; +int limit; } sk_backlog;wait_queue_head_t *sk_sleep;struct dst_entry *sk_dst_cache;
@@ -574,7 +576,7 @@ static inline int sk_stream_memory_free(return sk->sk_wmem_queued < sk->sk_sndbuf; } -/* The per-socket spinlock must be held here. */ +/* OOB backlog add */ static inline void sk_add_backlog (struct sock *sk,struct sk_buff *skb) {if (!sk->sk_backlog.tail) {
@@ -586,6 +588,17 @@ static inline void sk_add_backlog(struct skb->next =NULL ; } +/* The per-socket spinlock must be held here. */ +static inline int sk_add_backlog_limited (struct sock *sk,struct sk_buff *skb) +{ +if (sk->sk_backlog.len >=max (sk->sk_backlog.limit, sk->sk_rcvbuf <<1 )) +return -ENOBUFS ; + +sk_add_backlog (sk, skb); + sk->sk_backlog.len += skb->truesize; +return 0 ; +} +static inline int sk_backlog_rcv (struct sock *sk,struct sk_buff *skb) {return sk->sk_backlog_rcv (sk, skb);
net/core/sock.c +14 -2
@@ -340,8 +340,12 @@ int sk_receive_skb(struct sock *sk, stru rc =sk_backlog_rcv (sk, skb);mutex_release (&sk->sk_lock.dep_map,1 , _RET_IP_); - }else -sk_add_backlog (sk, skb); + }else if (sk_add_backlog_limited (sk, skb)) { +bh_unlock_sock (sk); +atomic_inc (&sk->sk_drops); + goto discard_and_relse; + } +bh_unlock_sock (sk); out:sock_put (sk);
@@ -1138,6 +1142,7 @@ struct sock *sk_clone(const struct socksock_lock_init (newsk);bh_lock_sock (newsk); newsk->sk_backlog.head = newsk->sk_backlog.tail =NULL ; + newsk->sk_backlog.len =0 ;atomic_set (&newsk->sk_rmem_alloc,0 );/*
@@ -1541,6 +1546,12 @@ static void __release_sock(struct sock *bh_lock_sock (sk); }while ((skb = sk->sk_backlog.head) !=NULL ); + +/* +* Doing the zeroing here guarantee we can not loop forever +* while a wild producer attempts to flood us. +*/ + sk->sk_backlog.len =0 ; }/**
@@ -1873,6 +1884,7 @@ void sock_init_data(struct socket *sock, sk->sk_allocation =GFP_KERNEL ; sk->sk_rcvbuf = sysctl_rmem_default; sk->sk_sndbuf = sysctl_wmem_default; + sk->sk_backlog.limit = sk->sk_rcvbuf <<1 ; sk->sk_state =TCP_CLOSE ;sk_set_socket (sk, sock);
PATCH 122/156 tcp: use limited socket backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 6b03a53a5ab7ccf2d5d69f96cf1c739c4d2a8fb9 ]
Make tcp adapt to the limited socket backlog change.
--- net/ipv4/tcp_ipv4.c | 6 ++++-- net/ipv6/tcp_ipv6.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
net/ipv4/tcp_ipv4.c +4 -2
@@ -1677,8 +1677,10 @@ process:if (!tcp_prequeue (sk, skb)) ret =tcp_v4_do_rcv (sk, skb); } - }else -sk_add_backlog (sk, skb); + }else if (sk_add_backlog_limited (sk, skb)) { +bh_unlock_sock (sk); + goto discard_and_relse; + }bh_unlock_sock (sk);sock_put (sk);
net/ipv6/tcp_ipv6.c +4 -2
@@ -1732,8 +1732,10 @@ process:if (!tcp_prequeue (sk, skb)) ret =tcp_v6_do_rcv (sk, skb); } - }else -sk_add_backlog (sk, skb); + }else if (sk_add_backlog_limited (sk, skb)) { +bh_unlock_sock (sk); + goto discard_and_relse; + }bh_unlock_sock (sk);sock_put (sk);
PATCH 123/156 udp: use limited socket backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 55349790d7cbf0d381873a7ece1dcafcffd4aaa9 ]
Make udp adapt to the limited socket backlog change.
--- net/ipv4/udp.c | 6 ++++-- net/ipv6/udp.c | 28 ++++++++++++++++++---------- 2 files changed, 22 insertions(+), 12 deletions(-)
net/ipv4/udp.c +4 -2
@@ -1372,8 +1372,10 @@ int udp_queue_rcv_skb(struct sock *sk, sbh_lock_sock (sk);if (!sock_owned_by_user (sk)) rc =__udp_queue_rcv_skb (sk, skb); -else -sk_add_backlog (sk, skb); +else if (sk_add_backlog_limited (sk, skb)) { +bh_unlock_sock (sk); + goto drop; + }bh_unlock_sock (sk);return rc;
net/ipv6/udp.c +18 -10
@@ -584,16 +584,20 @@ static void flush_stack(struct sock **stbh_lock_sock (sk);if (!sock_owned_by_user (sk))udpv6_queue_rcv_skb (sk, skb1); -else -sk_add_backlog (sk, skb1); +else if (sk_add_backlog_limited (sk, skb1)) { +kfree_skb (skb1); +bh_unlock_sock (sk); + goto drop; + }bh_unlock_sock (sk); - }else { -atomic_inc (&sk->sk_drops); -UDP6_INC_STATS_BH (sock_net (sk), -UDP_MIB_RCVBUFERRORS ,IS_UDPLITE (sk)); -UDP6_INC_STATS_BH (sock_net (sk), -UDP_MIB_INERRORS ,IS_UDPLITE (sk)); +continue ; } +drop: +atomic_inc (&sk->sk_drops); +UDP6_INC_STATS_BH (sock_net (sk), +UDP_MIB_RCVBUFERRORS ,IS_UDPLITE (sk)); +UDP6_INC_STATS_BH (sock_net (sk), +UDP_MIB_INERRORS ,IS_UDPLITE (sk)); } }/*
@@ -756,8 +760,12 @@ int __udp6_lib_rcv(struct sk_buff *skb,bh_lock_sock (sk);if (!sock_owned_by_user (sk))udpv6_queue_rcv_skb (sk, skb); -else -sk_add_backlog (sk, skb); +else if (sk_add_backlog_limited (sk, skb)) { +atomic_inc (&sk->sk_drops); +bh_unlock_sock (sk); +sock_put (sk); + goto discard; + }bh_unlock_sock (sk);sock_put (sk);return 0 ;
PATCH 124/156 llc: use limited socket backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 79545b681961d7001c1f4c3eb9ffb87bed4485db ]
Make llc adapt to the limited socket backlog change.
--- net/llc/llc_conn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/llc/llc_conn.c +2 -1
@@ -756,7 +756,8 @@ void llc_conn_handler(struct llc_sap *saelse {dprintk ("%s: adding to backlog...\n" , __func__);llc_set_backlog_type (skb,LLC_PACKET ); -sk_add_backlog (sk, skb); +if (sk_add_backlog_limited (sk, skb)) + goto drop_unlock; } out:bh_unlock_sock (sk);
PATCH 125/156 sctp: use limited socket backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 50b1a782f845140f4138f14a1ce8a4a6dd0cc82f ]
Make sctp adapt to the limited socket backlog change.
--- net/sctp/input.c | 42 +++++++++++++++++++++++++++--------------- net/sctp/socket.c | 3 +++ 2 files changed, 30 insertions(+), 15 deletions(-)
net/sctp/input.c +27 -15
@@ -75,7 +75,7 @@ static struct sctp_association *__sctp_lconst union sctp_addr *peer, struct sctp_transport **pt); -static void sctp_add_backlog (struct sock *sk,struct sk_buff *skb); +static int sctp_add_backlog (struct sock *sk,struct sk_buff *skb);/* Calculate the SCTP checksum of an SCTP packet. */
@@ -265,8 +265,13 @@ int sctp_rcv(struct sk_buff *skb) }if (sock_owned_by_user (sk)) { +if (sctp_add_backlog (sk, skb)) { +sctp_bh_unlock_sock (sk); +sctp_chunk_free (chunk); + skb =NULL ;/* sctp_chunk_free already freed the skb */ + goto discard_release; + }SCTP_INC_STATS_BH (SCTP_MIB_IN_PKT_BACKLOG ); -sctp_add_backlog (sk, skb); }else {SCTP_INC_STATS_BH (SCTP_MIB_IN_PKT_SOFTIRQ );sctp_inq_push (&chunk->rcvr->inqueue, chunk);
@@ -336,8 +341,10 @@ int sctp_backlog_rcv(struct sock *sk, stsctp_bh_lock_sock (sk);if (sock_owned_by_user (sk)) { -sk_add_backlog (sk, skb); - backloged =1 ; +if (sk_add_backlog_limited (sk, skb)) +sctp_chunk_free (chunk); +else + backloged =1 ; }else sctp_inq_push (inqueue, chunk);
@@ -362,22 +369,27 @@ done:return 0 ; } -static void sctp_add_backlog (struct sock *sk,struct sk_buff *skb) +static int sctp_add_backlog (struct sock *sk,struct sk_buff *skb) {struct sctp_chunk *chunk =SCTP_INPUT_CB (skb)->chunk;struct sctp_ep_common *rcvr = chunk->rcvr; +int ret; -/* Hold the assoc/ep while hanging on the backlog queue. -* This way, we know structures we need will not disappear from us -*/ -if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) -sctp_association_hold (sctp_assoc (rcvr)); -else if (SCTP_EP_TYPE_SOCKET == rcvr->type) -sctp_endpoint_hold (sctp_ep (rcvr)); -else -BUG (); + ret =sk_add_backlog_limited (sk, skb); +if (!ret) { +/* Hold the assoc/ep while hanging on the backlog queue. +* This way, we know structures we need will not disappear +* from us +*/ +if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) +sctp_association_hold (sctp_assoc (rcvr)); +else if (SCTP_EP_TYPE_SOCKET == rcvr->type) +sctp_endpoint_hold (sctp_ep (rcvr)); +else +BUG (); + } +return ret; -sk_add_backlog (sk, skb); }/* Handle icmp frag needed error. */
net/sctp/socket.c +3 -0
@@ -3720,6 +3720,9 @@ SCTP_STATIC int sctp_init_sock(struct soSCTP_DBG_OBJCNT_INC (sock);percpu_counter_inc (&sctp_sockets_allocated); +/* Set socket backlog limit. */ + sk->sk_backlog.limit = sysctl_sctp_rmem[1 ]; +local_bh_disable ();sock_prot_inuse_add (sock_net (sk), sk->sk_prot,1 );local_bh_enable ();
PATCH 126/156 tipc: use limited socket backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 53eecb1be5ae499d399d2923933937a9ea1a284f ]
Make tipc adapt to the limited socket backlog change.
--- net/tipc/socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/tipc/socket.c +4 -2
@@ -1322,8 +1322,10 @@ static u32 dispatch(struct tipc_port *tpif (!sock_owned_by_user (sk)) { res =filter_rcv (sk, buf); }else { -sk_add_backlog (sk, buf); - res =TIPC_OK ; +if (sk_add_backlog_limited (sk, buf)) + res =TIPC_ERR_OVERLOAD ; +else + res =TIPC_OK ; }bh_unlock_sock (sk);
PATCH 127/156 x25: use limited socket backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 2499849ee8f513e795b9f2c19a42d6356e4943a4 ]
Make x25 adapt to the limited socket backlog change.
--- net/x25/x25_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/x25/x25_dev.c +1 -1
@@ -53,7 +53,7 @@ static int x25_receive_data(struct sk_buif (!sock_owned_by_user (sk)) { queued =x25_process_rx_frame (sk, skb); }else { -sk_add_backlog (sk, skb); + queued = !sk_add_backlog_limited (sk, skb); }bh_unlock_sock (sk);sock_put (sk);
PATCH 128/156 net: backlog functions rename
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit a3a858ff18a72a8d388e31ab0d98f7e944841a62 ]
sk_add_backlog -> __sk_add_backlog sk_add_backlog_limited -> sk_add_backlog
--- include/net/sock.h | 6 +++--- net/core/sock.c | 2 +- net/dccp/minisocks.c | 2 +- net/ipv4/tcp_ipv4.c | 2 +- net/ipv4/tcp_minisocks.c | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- net/ipv6/udp.c | 4 ++-- net/llc/llc_c_ac.c | 2 +- net/llc/llc_conn.c | 2 +- net/sctp/input.c | 4 ++-- net/tipc/socket.c | 2 +- net/x25/x25_dev.c | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-)
include/net/sock.h +3 -3
@@ -577,7 +577,7 @@ static inline int sk_stream_memory_free( }/* OOB backlog add */ -static inline void sk_add_backlog (struct sock *sk,struct sk_buff *skb) +static inline void __sk_add_backlog (struct sock *sk,struct sk_buff *skb) {if (!sk->sk_backlog.tail) { sk->sk_backlog.head = sk->sk_backlog.tail = skb;
@@ -589,12 +589,12 @@ static inline void sk_add_backlog(struct }/* The per-socket spinlock must be held here. */ -static inline int sk_add_backlog_limited (struct sock *sk,struct sk_buff *skb) +static inline int sk_add_backlog (struct sock *sk,struct sk_buff *skb) {if (sk->sk_backlog.len >=max (sk->sk_backlog.limit, sk->sk_rcvbuf <<1 ))return -ENOBUFS ; -sk_add_backlog (sk, skb); +__sk_add_backlog (sk, skb); sk->sk_backlog.len += skb->truesize;return 0 ; }
net/core/sock.c +1 -1
@@ -340,7 +340,7 @@ int sk_receive_skb(struct sock *sk, stru rc =sk_backlog_rcv (sk, skb);mutex_release (&sk->sk_lock.dep_map,1 , _RET_IP_); - }else if (sk_add_backlog_limited (sk, skb)) { + }else if (sk_add_backlog (sk, skb)) {bh_unlock_sock (sk);atomic_inc (&sk->sk_drops); goto discard_and_relse;
net/dccp/minisocks.c +1 -1
@@ -254,7 +254,7 @@ int dccp_child_process(struct sock *pare* in main socket hash table and lock on listening * socket does not protect us more. */ -sk_add_backlog (child, skb); +__sk_add_backlog (child, skb); }bh_unlock_sock (child);
net/ipv4/tcp_ipv4.c +1 -1
@@ -1677,7 +1677,7 @@ process:if (!tcp_prequeue (sk, skb)) ret =tcp_v4_do_rcv (sk, skb); } - }else if (sk_add_backlog_limited (sk, skb)) { + }else if (sk_add_backlog (sk, skb)) {bh_unlock_sock (sk); goto discard_and_relse; }
net/ipv4/tcp_minisocks.c +1 -1
@@ -728,7 +728,7 @@ int tcp_child_process(struct sock *paren* in main socket hash table and lock on listening * socket does not protect us more. */ -sk_add_backlog (child, skb); +__sk_add_backlog (child, skb); }bh_unlock_sock (child);
net/ipv4/udp.c +1 -1
@@ -1372,7 +1372,7 @@ int udp_queue_rcv_skb(struct sock *sk, sbh_lock_sock (sk);if (!sock_owned_by_user (sk)) rc =__udp_queue_rcv_skb (sk, skb); -else if (sk_add_backlog_limited (sk, skb)) { +else if (sk_add_backlog (sk, skb)) {bh_unlock_sock (sk); goto drop; }
net/ipv6/tcp_ipv6.c +1 -1
@@ -1732,7 +1732,7 @@ process:if (!tcp_prequeue (sk, skb)) ret =tcp_v6_do_rcv (sk, skb); } - }else if (sk_add_backlog_limited (sk, skb)) { + }else if (sk_add_backlog (sk, skb)) {bh_unlock_sock (sk); goto discard_and_relse; }
net/ipv6/udp.c +2 -2
@@ -584,7 +584,7 @@ static void flush_stack(struct sock **stbh_lock_sock (sk);if (!sock_owned_by_user (sk))udpv6_queue_rcv_skb (sk, skb1); -else if (sk_add_backlog_limited (sk, skb1)) { +else if (sk_add_backlog (sk, skb1)) {kfree_skb (skb1);bh_unlock_sock (sk); goto drop;
@@ -760,7 +760,7 @@ int __udp6_lib_rcv(struct sk_buff *skb,bh_lock_sock (sk);if (!sock_owned_by_user (sk))udpv6_queue_rcv_skb (sk, skb); -else if (sk_add_backlog_limited (sk, skb)) { +else if (sk_add_backlog (sk, skb)) {atomic_inc (&sk->sk_drops);bh_unlock_sock (sk);sock_put (sk);
net/llc/llc_c_ac.c +1 -1
@@ -1437,7 +1437,7 @@ static void llc_process_tmr_ev(struct sollc_conn_state_process (sk, skb); else {llc_set_backlog_type (skb,LLC_EVENT ); -sk_add_backlog (sk, skb); +__sk_add_backlog (sk, skb); } } }
net/llc/llc_conn.c +1 -1
@@ -756,7 +756,7 @@ void llc_conn_handler(struct llc_sap *saelse {dprintk ("%s: adding to backlog...\n" , __func__);llc_set_backlog_type (skb,LLC_PACKET ); -if (sk_add_backlog_limited (sk, skb)) +if (sk_add_backlog (sk, skb)) goto drop_unlock; } out:
net/sctp/input.c +2 -2
@@ -341,7 +341,7 @@ int sctp_backlog_rcv(struct sock *sk, stsctp_bh_lock_sock (sk);if (sock_owned_by_user (sk)) { -if (sk_add_backlog_limited (sk, skb)) +if (sk_add_backlog (sk, skb))sctp_chunk_free (chunk);else backloged =1 ;
@@ -375,7 +375,7 @@ static int sctp_add_backlog(struct sockstruct sctp_ep_common *rcvr = chunk->rcvr;int ret; - ret =sk_add_backlog_limited (sk, skb); + ret =sk_add_backlog (sk, skb);if (!ret) {/* Hold the assoc/ep while hanging on the backlog queue. * This way, we know structures we need will not disappear
net/tipc/socket.c +1 -1
@@ -1322,7 +1322,7 @@ static u32 dispatch(struct tipc_port *tpif (!sock_owned_by_user (sk)) { res =filter_rcv (sk, buf); }else { -if (sk_add_backlog_limited (sk, buf)) +if (sk_add_backlog (sk, buf)) res =TIPC_ERR_OVERLOAD ;else res =TIPC_OK ;
net/x25/x25_dev.c +1 -1
@@ -53,7 +53,7 @@ static int x25_receive_data(struct sk_buif (!sock_owned_by_user (sk)) { queued =x25_process_rx_frame (sk, skb); }else { - queued = !sk_add_backlog_limited (sk, skb); + queued = !sk_add_backlog (sk, skb); }bh_unlock_sock (sk);sock_put (sk);
PATCH 129/156 net: add __must_check to sk_add_backlog
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhu Yi <[email protected]>
[ Upstream commit 4045635318538d3ddd2007720412fdc4b08f6a62 ]
Add the "__must_check" tag to sk_add_backlog() so that any failure to check and drop packets will be warned about.
--- include/net/sock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/sock.h +1 -1
@@ -589,7 +589,7 @@ static inline void __sk_add_backlog(stru }/* The per-socket spinlock must be held here. */ -static inline int sk_add_backlog (struct sock *sk,struct sk_buff *skb) +static inline __must_check int sk_add_backlog (struct sock *sk,struct sk_buff *skb) {if (sk->sk_backlog.len >=max (sk->sk_backlog.limit, sk->sk_rcvbuf <<1 ))return -ENOBUFS ;
PATCH 130/156 bonding: fix device leak on error in bond_create()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Patrick McHardy <[email protected]>
[ Upstream commit 8d6184e4881b423522136aeb3ec1cbd9c35e8813 ]
When the register_netdevice() call fails, the newly allocated device is not freed.
--- drivers/net/bonding/bond_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/bonding/bond_main.c +2 -0
@@ -4935,6 +4935,8 @@ int bond_create(struct net *net, const c } res =register_netdevice (bond_dev); +if (res <0 ) + goto out_netdev; out:rtnl_unlock ();
PATCH 131/156 e100: Fix ring parameter change handling regression.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit 211a0d941b1924e667483f822a55e2cc694cd212 ]
When the PCI pool changes were added to fix resume failures:
commit 98468efddb101f8a29af974101c17ba513b07be1
e100: Use pci pool to work around GFP_ATOMIC order 5 memory allocation failu
and
commit 70abc8cb90e679d8519721e2761d8366a18212a6
e100: Fix broken cbs accounting due to missing memset.
This introduced a problem that can happen if the TX ring size is increased. We need to size the PCI pool using cbs->max instead of the default cbs->count value.
--- drivers/net/e100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/e100.c +1 -1
@@ -2854,7 +2854,7 @@ static int __devinit e100_probe(struct p } nic->cbs_pool =pci_pool_create (netdev->name, nic->pdev, - nic->params.cbs.count *sizeof (struct cb ), + nic->params.cbs.max *sizeof (struct cb ),sizeof (u32),0 ); DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n",
PATCH 132/156 ip_gre: include route header_len in max_headroom calculation
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Timo Ter�s <[email protected]>
[ Upstream commit 243aad830e8a4cdda261626fbaeddde16b08d04a ]
Taking route's header_len into account, and updating gre device needed_headroom will give better hints on upper bound of required headroom. This is useful if the gre traffic is xfrm'ed.
--- net/ipv4/ip_gre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv4/ip_gre.c +3 -1
@@ -810,11 +810,13 @@ static netdev_tx_t ipgre_tunnel_xmit(str tunnel->err_count =0 ; } - max_headroom =LL_RESERVED_SPACE (tdev) + gre_hlen; + max_headroom =LL_RESERVED_SPACE (tdev) + gre_hlen + rt->u.dst.header_len;if (skb_headroom (skb) < max_headroom ||skb_shared (skb)|| (skb_cloned (skb) && !skb_clone_writable (skb,0 ))) {struct sk_buff *new_skb =skb_realloc_headroom (skb, max_headroom); +if (max_headroom > dev->needed_headroom) + dev->needed_headroom = max_headroom;if (!new_skb) {ip_rt_put (rt); txq->tx_dropped++;
PATCH 133/156 ipsec: Fix bogus bundle flowi
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 87c1e12b5eeb7b30b4b41291bef8e0b41fc3dde9 ]
When I merged the bundle creation code, I introduced a bogus flowi value in the bundle. Instead of getting from the caller, it was instead set to the flow in the route object, which is totally different.
The end result is that the bundles we created never match, and we instead end up with an ever growing bundle list.
Thanks to Jamal for find this problem.
--- include/net/xfrm.h | 3 ++- net/ipv4/xfrm4_policy.c | 5 +++-- net/ipv6/xfrm6_policy.c | 3 ++- net/xfrm/xfrm_policy.c | 7 ++++--- 4 files changed, 11 insertions(+), 7 deletions(-)
include/net/xfrm.h +2 -1
@@ -274,7 +274,8 @@ struct xfrm_policy_afinfo {struct dst_entry *dst, int nfheader_len);int (*fill_dst)(struct xfrm_dst *xdst, -struct net_device *dev); +struct net_device *dev, +struct flowi *fl); };extern int xfrm_policy_register_afinfo (struct xfrm_policy_afinfo *afinfo);
net/ipv4/xfrm4_policy.c +3 -2
@@ -91,11 +91,12 @@ static int xfrm4_init_path(struct xfrm_dreturn 0 ; } -static int xfrm4_fill_dst (struct xfrm_dst *xdst,struct net_device *dev) +static int xfrm4_fill_dst (struct xfrm_dst *xdst,struct net_device *dev, +struct flowi *fl) {struct rtable *rt = (struct rtable *)xdst->route; - xdst->u.rt.fl = rt->fl; + xdst->u.rt.fl = *fl; xdst->u.dst.dev = dev;dev_hold (dev);
net/ipv6/xfrm6_policy.c +2 -1
@@ -116,7 +116,8 @@ static int xfrm6_init_path(struct xfrm_dreturn 0 ; } -static int xfrm6_fill_dst (struct xfrm_dst *xdst,struct net_device *dev) +static int xfrm6_fill_dst (struct xfrm_dst *xdst,struct net_device *dev, +struct flowi *fl) {struct rt6_info *rt = (struct rt6_info *)xdst->route;
net/xfrm/xfrm_policy.c +4 -3
@@ -1354,7 +1354,8 @@ static inline int xfrm_init_path(structreturn err; } -static inline int xfrm_fill_dst (struct xfrm_dst *xdst,struct net_device *dev) +static inline int xfrm_fill_dst (struct xfrm_dst *xdst,struct net_device *dev, +struct flowi *fl) {struct xfrm_policy_afinfo *afinfo =xfrm_policy_get_afinfo (xdst->u.dst.ops->family);
@@ -1363,7 +1364,7 @@ static inline int xfrm_fill_dst(struct xif (!afinfo)return -EINVAL ; - err = afinfo->fill_dst (xdst, dev); + err = afinfo->fill_dst (xdst, dev, fl);xfrm_policy_put_afinfo (afinfo);
@@ -1468,7 +1469,7 @@ static struct dst_entry *xfrm_bundle_crefor (dst_prev = dst0; dst_prev != dst; dst_prev = dst_prev->child) {struct xfrm_dst *xdst = (struct xfrm_dst *)dst_prev; - err =xfrm_fill_dst (xdst, dev); + err =xfrm_fill_dst (xdst, dev, fl);if (err) goto free_dst;
PATCH 134/156 ipv4: check rt_genid in dst_check
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Timo Ter�s <[email protected]>
[ Upstream commit d11a4dc18bf41719c9f0d7ed494d295dd2973b92 ]
Xfrm_dst keeps a reference to ipv4 rtable entries on each cached bundle. The only way to renew xfrm_dst when the underlying route has changed, is to implement dst_check for this. This is what ipv6 side does too.
The problems started after 87c1e12b5eeb7b30b4b41291bef8e0b41fc3dde9 ("ipsec: Fix bogus bundle flowi") which fixed a bug causing xfrm_dst to not get reused, until that all lookups always generated new xfrm_dst with new route reference and path mtu worked. But after the fix, the old routes started to get reused even after they were expired causing pmtu to break (well it would occationally work if the rtable gc had run recently and marked the route obsolete causing dst_check to get called).
--- net/ipv4/route.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
net/ipv4/route.c +10 -4
@@ -1415,7 +1415,7 @@ void ip_rt_redirect(__be32 old_gw, __be3dev_hold (rt->u.dst.dev);if (rt->idev)in_dev_hold (rt->idev); - rt->u.dst.obsolete =0 ; + rt->u.dst.obsolete =-1 ; rt->u.dst.lastuse = jiffies; rt->u.dst.path = &rt->u.dst; rt->u.dst.neighbour =NULL ;
@@ -1480,7 +1480,7 @@ static struct dst_entry *ipv4_negative_astruct dst_entry *ret = dst;if (rt) { -if (dst->obsolete) { +if (dst->obsolete >0 ) {ip_rt_put (rt); ret =NULL ; } else if ((rt->rt_flags & RTCF_REDIRECTED) ||
@@ -1700,7 +1700,9 @@ static void ip_rt_update_pmtu(struct dststatic struct dst_entry *ipv4_dst_check (struct dst_entry *dst,u32 cookie) { -return NULL ; +if (rt_is_expired ((struct rtable *)dst)) +return NULL ; +return dst; }static void ipv4_dst_destroy (struct dst_entry *dst)
@@ -1862,7 +1864,8 @@ static int ip_route_input_mc(struct sk_bif (!rth) goto e_nobufs; - rth->u.dst.output= ip_rt_bug; + rth->u.dst.output = ip_rt_bug; + rth->u.dst.obsolete =-1 ;atomic_set (&rth->u.dst.__refcnt,1 ); rth->u.dst.flags=DST_HOST ;
@@ -2023,6 +2026,7 @@ static int __mkroute_input(struct sk_buf rth->fl.oif =0 ; rth->rt_spec_dst= spec_dst; + rth->u.dst.obsolete =-1 ; rth->u.dst.input = ip_forward; rth->u.dst.output = ip_output; rth->rt_genid =rt_genid (dev_net (rth->u.dst.dev));
@@ -2187,6 +2191,7 @@ local_input: goto e_nobufs; rth->u.dst.output= ip_rt_bug; + rth->u.dst.obsolete =-1 ; rth->rt_genid =rt_genid (net);atomic_set (&rth->u.dst.__refcnt,1 );
@@ -2413,6 +2418,7 @@ static int __mkroute_output(struct rtabl rth->rt_spec_dst= fl->fl4_src; rth->u.dst.output=ip_output; + rth->u.dst.obsolete =-1 ; rth->rt_genid =rt_genid (dev_net (dev_out));RT_CACHE_STAT_INC (out_slow_tot);
PATCH 135/156 ipv4: Dont drop redirected route cache entry unless PTMU actually expired
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit 5e016cbf6cffd4a53b7922e0c91b775399d7fe47 ]
TCP sessions over IPv4 can get stuck if routers between endpoints do not fragment packets but implement PMTU instead, and we are using those routers because of an ICMP redirect.
Setup is as follows
MTU1 MTU2 MTU1
A--------B------C------D
with MTU1 > MTU2. A and D are endpoints, B and C are routers. B and C implement PMTU and drop packets larger than MTU2 (for example because DF is set on all packets). TCP sessions are initiated between A and D. There is packet loss between A and D, causing frequent TCP retransmits.
After the number of retransmits on a TCP session reaches tcp_retries1, tcp calls dst_negative_advice() prior to each retransmit. This results in route cache entries for the peer to be deleted in ipv4_negative_advice() if the Path MTU is set.
If the outstanding data on an affected TCP session is larger than MTU2, packets sent from the endpoints will be dropped by B or C, and ICMP NEEDFRAG will be returned. A and D receive NEEDFRAG messages and update PMTU.
Before the next retransmit, tcp will again call dst_negative_advice(), causing the route cache entry (with correct PMTU) to be deleted. The retransmitted packet will be larger than MTU2, causing it to be dropped again.
This sequence repeats until the TCP session aborts or is terminated.
Problem is fixed by removing redirected route cache entries in ipv4_negative_advice() only if the PMTU is expired.
--- net/ipv4/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/route.c +2 -1
@@ -1484,7 +1484,8 @@ static struct dst_entry *ipv4_negative_aip_rt_put (rt); ret =NULL ; }else if ((rt->rt_flags &RTCF_REDIRECTED ) || - rt->u.dst.expires) { + (rt->u.dst.expires && +time_after_eq (jiffies, rt->u.dst.expires))) {unsigned hash =rt_hash (rt->fl.fl4_dst, rt->fl.fl4_src, rt->fl.oif,rt_genid (dev_net (dst->dev)));
PATCH 136/156 ipv6: Dont drop cache route entry unless timer actually expired.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: YOSHIFUJI Hideaki / 吉藤英明 <[email protected]>
[ Upstream commit 54c1a859efd9fd6cda05bc700315ba2519c14eba ]
This is ipv6 variant of the commit 5e016cbf6.. ("ipv4: Don't drop redirected route cache entry unless PTMU actually expired") by Guenter Roeck <[email protected]>.
Remove cache route entry in ipv6_negative_advice() only if the timer is expired.
--- net/ipv6/route.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
net/ipv6/route.c +9 -4
@@ -897,12 +897,17 @@ static struct dst_entry *ip6_negative_adstruct rt6_info *rt = (struct rt6_info *) dst;if (rt) { -if (rt->rt6i_flags &RTF_CACHE ) -ip6_del_rt (rt); -else +if (rt->rt6i_flags &RTF_CACHE ) { +if (rt6_check_expired (rt)) { +ip6_del_rt (rt); + dst =NULL ; + } + }else {dst_release (dst); + dst =NULL ; + } } -return NULL ; +return dst; }static void ip6_link_failure (struct sk_buff *skb)
PATCH 137/156 NET_DMA: free skbs periodically
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven J. Magnani <[email protected]>
[ Upstream commit 73852e8151b7d7a529fbe019ab6d2d0c02d8f3f2 ]
Under NET_DMA, data transfer can grind to a halt when userland issues a large read on a socket with a high RCVLOWAT (i.e., 512 KB for both). This appears to be because the NET_DMA design queues up lots of memcpy operations, but doesn't issue or wait for them (and thus free the associated skbs) until it is time for tcp_recvmesg() to return. The socket hangs when its TCP window goes to zero before enough data is available to satisfy the read.
Periodically issue asynchronous memcpy operations, and free skbs for ones that have completed, to prevent sockets from going into zero-window mode.
--- net/ipv4/tcp.c | 63 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 20 deletions(-)
net/ipv4/tcp.c +43 -20
@@ -1254,6 +1254,39 @@ static void tcp_prequeue_process(struct tp->ucopy.memory =0 ; } +#ifdef CONFIG_NET_DMA +static void tcp_service_net_dma (struct sock *sk,bool wait) +{ +dma_cookie_t done, used; +dma_cookie_t last_issued; +struct tcp_sock *tp =tcp_sk (sk); + +if (!tp->ucopy.dma_chan) +return ; + + last_issued = tp->ucopy.dma_cookie; +dma_async_memcpy_issue_pending (tp->ucopy.dma_chan); + +do { +if (dma_async_memcpy_complete (tp->ucopy.dma_chan, + last_issued, &done, + &used) ==DMA_SUCCESS ) { +/* Safe to free early-copied skbs now */ +__skb_queue_purge (&sk->sk_async_wait_queue); +break ; + }else { +struct sk_buff *skb; +while ((skb =skb_peek (&sk->sk_async_wait_queue)) && + (dma_async_is_complete (skb->dma_cookie, done, + used) ==DMA_SUCCESS )) { +__skb_dequeue (&sk->sk_async_wait_queue); +kfree_skb (skb); + } + } + }while (wait); +} +#endif +static inline struct sk_buff *tcp_recv_skb (struct sock *sk,u32 seq,u32 *off) {struct sk_buff *skb;
@@ -1546,6 +1579,10 @@ int tcp_recvmsg(struct kiocb *iocb, stru/* __ Set realtime policy in scheduler __ */ } +#ifdef CONFIG_NET_DMA +if (tp->ucopy.dma_chan) +dma_async_memcpy_issue_pending (tp->ucopy.dma_chan); +#endif if (copied >= target) {/* Do not sleep, just process backlog. */ release_sock (sk);
@@ -1554,6 +1591,7 @@ int tcp_recvmsg(struct kiocb *iocb, strusk_wait_data (sk, &timeo);#ifdef CONFIG_NET_DMA +tcp_service_net_dma (sk, false);/* Don't block */ tp->ucopy.wakeup =0 ;#endif
@@ -1633,6 +1671,9 @@ do_prequeue: copied = -EFAULT ;break ; } + +dma_async_memcpy_issue_pending (tp->ucopy.dma_chan); +if ((offset + used) == skb->len) copied_early =1 ;
@@ -1702,27 +1743,9 @@ skip_copy: }#ifdef CONFIG_NET_DMA -if (tp->ucopy.dma_chan) { -dma_cookie_t done, used; - -dma_async_memcpy_issue_pending (tp->ucopy.dma_chan); - -while (dma_async_memcpy_complete (tp->ucopy.dma_chan, - tp->ucopy.dma_cookie, &done, - &used) ==DMA_IN_PROGRESS ) { -/* do partial cleanup of sk_async_wait_queue */ -while ((skb =skb_peek (&sk->sk_async_wait_queue)) && - (dma_async_is_complete (skb->dma_cookie, done, - used) ==DMA_SUCCESS )) { -__skb_dequeue (&sk->sk_async_wait_queue); -kfree_skb (skb); - } - } +tcp_service_net_dma (sk, true);/* Wait for queue to drain */ + tp->ucopy.dma_chan =NULL ; -/* Safe to free early-copied skbs now */ -__skb_queue_purge (&sk->sk_async_wait_queue); - tp->ucopy.dma_chan =NULL ; - }if (tp->ucopy.pinned_list) {dma_unpin_iovec_pages (tp->ucopy.pinned_list); tp->ucopy.pinned_list =NULL ;
PATCH 138/156 netlink: fix NETLINK_RECV_NO_ENOBUFS in netlink_set_err()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 1a50307ba1826e4da0024e64b245ce4eadf7688a ]
Currently, ENOBUFS errors are reported to the socket via netlink_set_err() even if NETLINK_RECV_NO_ENOBUFS is set. However, that should not happen. This fixes this problem and it changes the prototype of netlink_set_err() to return the number of sockets that have set the NETLINK_RECV_NO_ENOBUFS socket option. This return value is used in the next patch in these bugfix series.
--- include/linux/netlink.h | 2 +- net/netlink/af_netlink.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-)
include/linux/netlink.h +1 -1
@@ -188,7 +188,7 @@ extern int netlink_has_listeners(structextern int netlink_unicast (struct sock *ssk,struct sk_buff *skb,__u32 pid,int nonblock);extern int netlink_broadcast (struct sock *ssk,struct sk_buff *skb,__u32 pid,__u32 group,gfp_t allocation); -extern void netlink_set_err (struct sock *ssk,__u32 pid,__u32 group,int code); +extern int netlink_set_err (struct sock *ssk,__u32 pid,__u32 group,int code);extern int netlink_register_notifier (struct notifier_block *nb);extern int netlink_unregister_notifier (struct notifier_block *nb);
net/netlink/af_netlink.c +14 -3
@@ -1093,6 +1093,7 @@ static inline int do_one_set_err(struct struct netlink_set_err_data *p) {struct netlink_sock *nlk =nlk_sk (sk); +int ret =0 ;if (sk == p->exclude_sk) goto out;
@@ -1104,10 +1105,15 @@ static inline int do_one_set_err(struct !test_bit(p->group - 1, nlk->groups)) goto out; +if (p->code ==ENOBUFS && nlk->flags &NETLINK_RECV_NO_ENOBUFS ) { + ret =1 ; + goto out; + } + sk->sk_err = p->code; sk->sk_error_report (sk); out: -return 0 ; +return ret; }/**
@@ -1116,12 +1122,16 @@ out:* @pid: the PID of a process that we want to skip (if any) * @groups: the broadcast group that will notice the error * @code: error code, must be negative (as usual in kernelspace) +* +* This function returns the number of broadcast listeners that have set the +* NETLINK_RECV_NO_ENOBUFS socket option. */ -void netlink_set_err (struct sock *ssk,u32 pid,u32 group,int code) +int netlink_set_err (struct sock *ssk,u32 pid,u32 group,int code) {struct netlink_set_err_data info;struct hlist_node *node;struct sock *sk; +int ret =0 ; info.exclude_sk = ssk; info.pid = pid;
@@ -1132,9 +1142,10 @@ void netlink_set_err(struct sock *ssk, uread_lock (&nl_table_lock);sk_for_each_bound (sk, node, &nl_table[ssk->sk_protocol].mc_list) -do_one_set_err (sk, &info); + ret +=do_one_set_err (sk, &info);read_unlock (&nl_table_lock); +return ret; }EXPORT_SYMBOL (netlink_set_err);
PATCH 139/156 netfilter: ctnetlink: fix reliable event delivery if message building fails
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 37b7ef7203240b3aba577bb1ff6765fe15225976 ]
This patch fixes a bug that allows to lose events when reliable event delivery mode is used, ie. if NETLINK_BROADCAST_SEND_ERROR and NETLINK_RECV_NO_ENOBUFS socket options are set.
--- include/linux/netfilter/nfnetlink.h | 2 +- net/netfilter/nf_conntrack_netlink.c | 3 ++- net/netfilter/nfnetlink.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-)
include/linux/netfilter/nfnetlink.h +1 -1
@@ -76,7 +76,7 @@ extern int nfnetlink_subsys_unregister(cextern int nfnetlink_has_listeners (unsigned int group);extern int nfnetlink_send (struct sk_buff *skb,u32 pid,unsigned group,int echo,gfp_t flags); -extern void nfnetlink_set_err (u32 pid,u32 group,int error); +extern int nfnetlink_set_err (u32 pid,u32 group,int error);extern int nfnetlink_unicast (struct sk_buff *skb,u_int32_t pid,int flags);extern void nfnl_lock (void );
net/netfilter/nf_conntrack_netlink.c +2 -1
@@ -571,7 +571,8 @@ nla_put_failure: nlmsg_failure:kfree_skb (skb); errout: -nfnetlink_set_err (0 , group, -ENOBUFS ); +if (nfnetlink_set_err (0 , group, -ENOBUFS ) >0 ) +return -ENOBUFS ; return 0; }#endif /* CONFIG_NF_CONNTRACK_EVENTS */
net/netfilter/nfnetlink.c +2 -2
@@ -114,9 +114,9 @@ int nfnetlink_send(struct sk_buff *skb, }EXPORT_SYMBOL_GPL (nfnetlink_send); -void nfnetlink_set_err (u32 pid,u32 group,int error) +int nfnetlink_set_err (u32 pid,u32 group,int error) { -netlink_set_err (nfnl, pid, group, error); +return netlink_set_err (nfnl, pid, group, error); }EXPORT_SYMBOL_GPL (nfnetlink_set_err);
PATCH 140/156 netlink: fix unaligned access in nla_get_be64()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit f5d410f2ea7ba340f11815a56e05b9fa9421c421 ]
This patch fixes a unaligned access in nla_get_be64() that was introduced by myself in a17c859849402315613a0015ac8fbf101acf0cc1.
--- include/net/netlink.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/net/netlink.h +5 -1
@@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const stru*/ static inline __be64 nla_get_be64 (const struct nlattr *nla) { -return *(__be64 *)nla_data (nla); +__be64 tmp; + +nla_memcpy (&tmp, nla,sizeof (tmp)); + +return tmp; }/**
PATCH 141/156 r8169: offical fix for CVE-2009-4537 (overlength frame DMAs)
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Neil Horman <[email protected]>
[ Upstream commit c0cd884af045338476b8e69a61fceb3f34ff22f1 ]
Official patch to fix the r8169 frame length check error.
Based on this initial thread:
http://marc.info/?l=linux-netdev&m=126202972828626&w=1
This is the official patch to fix the frame length problems in the r8169 driver. As noted in the previous thread, while this patch incurs a performance hit on the driver, its possible to improve performance dynamically by updating the mtu and rx_copybreak values at runtime to return performance to what it was for those NICS which are unaffected by the ideosyncracy (if there are any).
Summary:
A while back Eric submitted a patch for r8169 in which the proper
allocated frame size was written to RXMaxSize to prevent the NIC from dmaing too much data. This was done in commit fdd7b4c3302c93f6833e338903ea77245eb510b4. A long time prior to that however, Francois posted 126fa4b9ca5d9d7cb7d46f779ad3bd3631ca387c, which expiclitly disabled the MaxSize setting due to the fact that the hardware behaved in odd ways when overlong frames were received on NIC's supported by this driver. This was mentioned in a security conference recently:
http://events.ccc.de/congress/2009/Fahrplan//events/3596.en.html
It seems that if we can't enable frame size filtering, then, as Eric correctly noticed, we can find ourselves DMA-ing too much data to a buffer, causing corruption. As a result is seems that we are forced to allocate a frame which is ready to handle a maximally sized receive.
This obviously has performance issues with it, so to mitigate that issue, this patch does two things:
1) Raises the copybreak value to the frame allocation size, which should force appropriately sized packets to get allocated on rx, rather than a full new 16k buffer.
2) This patch only disables frame filtering initially (i.e., during the NIC open), changing the MTU results in ring buffer allocation of a size in relation to the new mtu (along with a warning indicating that this is dangerous).
Because of item (2), individuals who can't cope with the performance hit (or can otherwise filter frames to prevent the bug), or who have hardware they are sure is unaffected by this issue, can manually lower the copybreak and reset the mtu such that performance is restored easily.
--- drivers/net/r8169.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-)
drivers/net/r8169.c +24 -5
@@ -186,7 +186,12 @@ static struct pci_device_id rtl8169_pci_MODULE_DEVICE_TABLE (pci, rtl8169_pci_tbl); -static int rx_copybreak =200 ; +/* +* we set our copybreak very high so that we don't have +* to allocate 16k frames all the time (see note in +* rtl8169_open() +*/ +static int rx_copybreak =16383 ;static int use_dac; static struct { u32 msg_enable;
@@ -3245,9 +3250,13 @@ static void __devexit rtl8169_remove_one }static void rtl8169_set_rxbufsize (struct rtl8169_private *tp, -struct net_device *dev) +unsigned int mtu) { -unsigned int max_frame = dev->mtu +VLAN_ETH_HLEN +ETH_FCS_LEN ; +unsigned int max_frame = mtu +VLAN_ETH_HLEN +ETH_FCS_LEN ; + +if (max_frame !=16383 ) +printk (KERN_WARNING "WARNING! Changing of MTU on this NIC" +"May lead to frame reception errors!\n" ); tp->rx_buf_sz = (max_frame >RX_BUF_SIZE ) ? max_frame :RX_BUF_SIZE ; }
@@ -3259,7 +3268,17 @@ static int rtl8169_open(struct net_devicint retval = -ENOMEM ; -rtl8169_set_rxbufsize (tp, dev); +/* +* Note that we use a magic value here, its wierd I know +* its done because, some subset of rtl8169 hardware suffers from +* a problem in which frames received that are longer than +* the size set in RxMaxSize register return garbage sizes +* when received. To avoid this we need to turn off filtering, +* which is done by setting a value of 16383 in the RxMaxSize register +* and allocating 16k frames to handle the largest possible rx value +* thats what the magic math below does. +*/ +rtl8169_set_rxbufsize (tp,16383 -VLAN_ETH_HLEN -ETH_FCS_LEN );/* * Rx and Tx desscriptors needs 256 bytes alignment.
@@ -3912,7 +3931,7 @@ static int rtl8169_change_mtu(struct netrtl8169_down (dev); -rtl8169_set_rxbufsize (tp, dev); +rtl8169_set_rxbufsize (tp, dev->mtu); ret =rtl8169_init_ring (dev);if (ret <0 )
PATCH 142/156 net: Potential null skb->dev dereference
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 0641e4fbf2f824faee00ea74c459a088d94905fd ]
When doing "ifenslave -d bond0 eth0", there is chance to get NULL dereference in netif_receive_skb(), because dev->master suddenly becomes NULL after we tested it.
We should use ACCESS_ONCE() to avoid this (or rcu_dereference())
--- include/linux/netdevice.h | 8 ++++---- net/8021q/vlan_core.c | 4 ++-- net/core/dev.c | 8 +++++--- 3 files changed, 11 insertions(+), 9 deletions(-)
include/linux/netdevice.h +4 -4
@@ -2023,12 +2023,12 @@ static inline void skb_bond_set_mac_by_m* duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and * ARP on active-backup slaves with arp_validate enabled. */ -static inline int skb_bond_should_drop (struct sk_buff *skb) +static inline int skb_bond_should_drop (struct sk_buff *skb, +struct net_device *master) { -struct net_device *dev = skb->dev; -struct net_device *master = dev->master; -if (master) { +struct net_device *dev = skb->dev; +if (master->priv_flags &IFF_MASTER_ARPMON ) dev->last_rx = jiffies;
net/8021q/vlan_core.c +2 -2
@@ -11,7 +11,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skif (netpoll_rx (skb))return NET_RX_DROP ; -if (skb_bond_should_drop (skb)) +if (skb_bond_should_drop (skb,ACCESS_ONCE (skb->dev->master))) goto drop;__vlan_hwaccel_put_tag (skb, vlan_tci);
@@ -82,7 +82,7 @@ vlan_gro_common(struct napi_struct *napi {struct sk_buff *p; -if (skb_bond_should_drop (skb)) +if (skb_bond_should_drop (skb,ACCESS_ONCE (skb->dev->master))) goto drop;__vlan_hwaccel_put_tag (skb, vlan_tci);
net/core/dev.c +5 -3
@@ -2421,6 +2421,7 @@ int netif_receive_skb(struct sk_buff *sk {struct packet_type *ptype, *pt_prev;struct net_device *orig_dev; +struct net_device *master;struct net_device *null_or_orig;int ret =NET_RX_DROP ;__be16 type;
@@ -2440,11 +2441,12 @@ int netif_receive_skb(struct sk_buff *sk null_or_orig =NULL ; orig_dev = skb->dev; -if (orig_dev->master) { -if (skb_bond_should_drop (skb)) + master =ACCESS_ONCE (orig_dev->master); +if (master) { +if (skb_bond_should_drop (skb, master)) null_or_orig = orig_dev;/* deliver only exact match */ else - skb->dev = orig_dev->master; + skb->dev = master; }__get_cpu_var (netdev_rx_stat).total++;
PATCH 143/156 skbuff: remove unused dma_head & dma_maps fields
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexander Duyck <[email protected]>
[ Upstream commit 03e6d819c2cb2cc8ce5642669a0a7c72336ee7a2 ]
The dma map fields in the skb_shared_info structure no longer has any users and can be dropped since it is making the skb_shared_info unecessarily larger.
Running slabtop show that we were using 4K slabs for the skb->head on x86_64 w/ an allocation size of 1522. It turns out that the dma_head and dma_maps array made skb_shared large enough that we had crossed over the 2k boundary with standard frames and as such we were using 4k blocks of memory for all skbs.
--- include/linux/skbuff.h | 6 ------ 1 file changed, 6 deletions(-)
include/linux/skbuff.h +0 -6
@@ -190,9 +190,6 @@ struct skb_shared_info {atomic_t dataref;unsigned short nr_frags;unsigned short gso_size; -#ifdef CONFIG_HAS_DMA -dma_addr_t dma_head; -#endif /* Warning: this field is not always filled in (UFO)! */ unsigned short gso_segs;unsigned short gso_type;
@@ -201,9 +198,6 @@ struct skb_shared_info {struct sk_buff *frag_list;struct skb_shared_hwtstamps hwtstamps;skb_frag_t frags[MAX_SKB_FRAGS ]; -#ifdef CONFIG_HAS_DMA -dma_addr_t dma_maps[MAX_SKB_FRAGS ]; -#endif /* Intermediate layers must ensure that destructor_arg * remains valid until skb destructor */ void * destructor_arg;
PATCH 144/156 tcp: Fix tcp_mark_head_lost() with packets == 0
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lennart Schulte <[email protected]>
[ Upstream commit 6830c25b7d08fbbd922959425193791bc42079f2 ]
A packet is marked as lost in case packets == 0, although nothing should be done. This results in a too early retransmitted packet during recovery in some cases. This small patch fixes this issue by returning immediately.
--- net/ipv4/tcp_input.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv4/tcp_input.c +3 -0
@@ -2499,6 +2499,9 @@ static void tcp_mark_head_lost(struct soint err;unsigned int mss; +if (packets ==0 ) +return ; +WARN_ON (packets > tp->packets_out);if (tp->lost_skb_hint) { skb = tp->lost_skb_hint;
PATCH 145/156 tcp: Fix OOB POLLIN avoidance.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexandra Kossovsky <[email protected]>
[ Upstream commit b634f87522dff87712df8bda2a6c9061954d552a ]
From: [email protected]
Fixes kernel bugzilla #15541
--- net/ipv4/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp.c +1 -1
@@ -429,7 +429,7 @@ unsigned int tcp_poll(struct file *file,if (tp->urg_seq == tp->copied_seq && !sock_flag (sk,SOCK_URGINLINE ) && tp->urg_data) - target--; + target++;/* Potential race condition. If read of tp below will * escape above sk->sk_state, we can be illegally awaken
PATCH 146/156 tcp: Fix tcp_make_synack()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 28b2774a0d5852236dab77a4147b8b88548110f1 ]
Commit 4957faad (TCPCT part 1g: Responder Cookie => Initiator), part of TCP_COOKIE_TRANSACTION implementation, forgot to correctly size synack skb in case user data must be included.
Many thanks to Mika Pentill� for spotting this error.
--- net/ipv4/tcp_output.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
net/ipv4/tcp_output.c +9 -9
@@ -2393,13 +2393,17 @@ struct sk_buff *tcp_make_synack(struct sstruct tcp_extend_values *xvp =tcp_xv (rvp);struct inet_request_sock *ireq =inet_rsk (req);struct tcp_sock *tp =tcp_sk (sk); +const struct tcp_cookie_values *cvp = tp->cookie_values;struct tcphdr *th;struct sk_buff *skb;struct tcp_md5sig_key *md5;int tcp_header_size;int mss; +int s_data_desired =0 ; - skb =sock_wmalloc (sk,MAX_TCP_HEADER +15 ,1 ,GFP_ATOMIC ); +if (cvp !=NULL && cvp->s_data_constant && cvp->s_data_desired) + s_data_desired = cvp->s_data_desired; + skb =sock_wmalloc (sk,MAX_TCP_HEADER +15 + s_data_desired,1 ,GFP_ATOMIC );if (skb ==NULL )return NULL ;
@@ -2454,16 +2458,12 @@ struct sk_buff *tcp_make_synack(struct s TCPCB_FLAG_SYN | TCPCB_FLAG_ACK);if (OPTION_COOKIE_EXTENSION & opts.options) { -const struct tcp_cookie_values *cvp = tp->cookie_values; - -if (cvp !=NULL && - cvp->s_data_constant && - cvp->s_data_desired >0 ) { -u8 *buf =skb_put (skb, cvp->s_data_desired); +if (s_data_desired) { +u8 *buf =skb_put (skb, s_data_desired);/* copy data directly from the listening socket. */ -memcpy (buf, cvp->s_data_payload, cvp->s_data_desired); -TCP_SKB_CB (skb)->end_seq += cvp->s_data_desired; +memcpy (buf, cvp->s_data_payload, s_data_desired); +TCP_SKB_CB (skb)->end_seq += s_data_desired; }if (opts.hash_size >0 ) {
PATCH 147/156 quota: manage reserved space when quota is not active [v2]
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dmitry Monakhov <[email protected]>
commit c469070aea5a0ada45a836937c776fd3083dae2b upstream.
Since we implemented generic reserved space management interface, then it is possible to account reserved space even when quota is not active (similar to i_blocks/i_bytes).
Without this patch following testcase result in massive comlain from WARN_ON in dquot_claim_space()
TEST_CASE:
mount /dev/sdb /mnt -oquota
dd if=/dev/zero of=/mnt/test bs=1M count=1
quotaon /mnt
# fs_reserved_spave == 1Mb # quota_reserved_space == 0, because quota was disabled dd if=/dev/zero of=/mnt/test seek=1 bs=1M count=1 # fs_reserved_spave == 2Mb # quota_reserved_space == 1Mb sync # ->dquot_claim_space() -> WARN_ON
--- fs/quota/dquot.c | 10 ++++++---- include/linux/quotaops.h | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-)
fs/quota/dquot.c +6 -4
@@ -1351,28 +1351,30 @@ static qsize_t *inode_reserved_space(strreturn inode->i_sb->dq_op->get_reserved_space (inode); } -static void inode_add_rsv_space (struct inode *inode,qsize_t number) +void inode_add_rsv_space (struct inode *inode,qsize_t number) {spin_lock (&inode->i_lock); *inode_reserved_space (inode) += number;spin_unlock (&inode->i_lock); } +EXPORT_SYMBOL (inode_add_rsv_space); - -static void inode_claim_rsv_space (struct inode *inode,qsize_t number) +void inode_claim_rsv_space (struct inode *inode,qsize_t number) {spin_lock (&inode->i_lock); *inode_reserved_space (inode) -= number;__inode_add_bytes (inode, number);spin_unlock (&inode->i_lock); } +EXPORT_SYMBOL (inode_claim_rsv_space); -static void inode_sub_rsv_space (struct inode *inode,qsize_t number) +void inode_sub_rsv_space (struct inode *inode,qsize_t number) {spin_lock (&inode->i_lock); *inode_reserved_space (inode) -= number;spin_unlock (&inode->i_lock); } +EXPORT_SYMBOL (inode_sub_rsv_space);static qsize_t inode_get_rsv_space (struct inode *inode) {
include/linux/quotaops.h +9 -2
@@ -26,6 +26,10 @@ static inline void writeout_quota_sb(str sb->s_qcop->quota_sync (sb, type); } +void inode_add_rsv_space (struct inode *inode,qsize_t number); +void inode_claim_rsv_space (struct inode *inode,qsize_t number); +void inode_sub_rsv_space (struct inode *inode,qsize_t number); +int dquot_initialize (struct inode *inode,int type);int dquot_drop (struct inode *inode);struct dquot *dqget (struct super_block *sb,unsigned int id,int type);
@@ -42,7 +46,6 @@ int dquot_alloc_inode(const struct inodeint dquot_reserve_space (struct inode *inode,qsize_t number,int prealloc);int dquot_claim_space (struct inode *inode,qsize_t number);void dquot_release_reserved_space (struct inode *inode,qsize_t number); -qsize_t dquot_get_reserved_space (struct inode *inode);int dquot_free_space (struct inode *inode,qsize_t number);int dquot_free_inode (const struct inode *inode,qsize_t number);
@@ -199,6 +202,8 @@ static inline int vfs_dq_reserve_space(sif (inode->i_sb->dq_op->reserve_space (inode, nr,0 ) ==NO_QUOTA )return 1 ; } +else +inode_add_rsv_space (inode, nr);return 0 ; }
@@ -221,7 +226,7 @@ static inline int vfs_dq_claim_space(strif (inode->i_sb->dq_op->claim_space (inode, nr) ==NO_QUOTA )return 1 ; }else -inode_add_bytes (inode, nr); +inode_claim_rsv_space (inode, nr);mark_inode_dirty (inode);return 0 ;
@@ -235,6 +240,8 @@ void vfs_dq_release_reservation_space(st {if (sb_any_quota_active (inode->i_sb)) inode->i_sb->dq_op->release_rsv (inode, nr); +else +inode_sub_rsv_space (inode, nr); }static inline void vfs_dq_free_space_nodirty (struct inode *inode,qsize_t nr)
PATCH 148/156 quota: Fix warning when a delayed write happens before quota is enabled
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Kara <[email protected]>
commit 0a5a9c725512461d19397490f3adf29931dca1f2 upstream.
If a delayed-allocation write happens before quota is enabled, the kernel spits out a warning:
WARNING: at fs/quota/dquot.c:988 dquot_claim_space+0x77/0x112()
because the fact that user has some delayed allocation is not recorded in quota structure.
Make dquot_initialize() update amount of reserved space for user if it sees inode has some space reserved. Also make sure that reserved quota space does not go negative and we warn about the filesystem bug just once.
--- fs/quota/dquot.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-)
fs/quota/dquot.c +31 -4
@@ -225,6 +225,8 @@ static struct hlist_head *dquot_hash;struct dqstats dqstats;EXPORT_SYMBOL (dqstats); +static qsize_t inode_get_rsv_space (struct inode *inode); +static inline unsigned int hashfn (const struct super_block *sb,unsigned int id,int type) {
@@ -840,11 +842,14 @@ static int dqinit_needed(struct inode *istatic void add_dquot_ref (struct super_block *sb,int type) {struct inode *inode, *old_inode =NULL ; +int reserved =0 ;spin_lock (&inode_lock);list_for_each_entry (inode, &sb->s_inodes, i_sb_list) {if (inode->i_state & (I_FREEING |I_CLEAR |I_WILL_FREE |I_NEW ))continue ; +if (unlikely (inode_get_rsv_space (inode) >0 )) + reserved =1 ;if (!atomic_read (&inode->i_writecount))continue ;if (!dqinit_needed (inode, type))
@@ -865,6 +870,12 @@ static void add_dquot_ref(struct super_b }spin_unlock (&inode_lock);iput (old_inode); + +if (reserved) { +printk (KERN_WARNING "VFS (%s): Writes happened before quota" +" was turned on thus quota information is probably " +"inconsistent. Please run quotacheck(8).\n" , sb->s_id); + } }/*
@@ -978,10 +989,12 @@ static inline void dquot_resv_space(stru/* * Claim reserved quota space */ -static void dquot_claim_reserved_space (struct dquot *dquot, -qsize_t number) +static void dquot_claim_reserved_space (struct dquot *dquot,qsize_t number) { -WARN_ON (dquot->dq_dqb.dqb_rsvspace < number); +if (dquot->dq_dqb.dqb_rsvspace < number) { +WARN_ON_ONCE (1 ); + number = dquot->dq_dqb.dqb_rsvspace; + } dquot->dq_dqb.dqb_curspace += number; dquot->dq_dqb.dqb_rsvspace -= number; }
@@ -989,7 +1002,12 @@ static void dquot_claim_reserved_space(sstatic inline void dquot_free_reserved_space (struct dquot *dquot,qsize_t number) { - dquot->dq_dqb.dqb_rsvspace -= number; +if (dquot->dq_dqb.dqb_rsvspace >= number) + dquot->dq_dqb.dqb_rsvspace -= number; +else { +WARN_ON_ONCE (1 ); + dquot->dq_dqb.dqb_rsvspace =0 ; + } }static void dquot_decr_inodes (struct dquot *dquot,qsize_t number)
@@ -1242,6 +1260,7 @@ static int info_bdq_free(struct dquot *dreturn QUOTA_NL_BHARDBELOW ;return QUOTA_NL_NOWARN ; } +/* * Initialize quota pointers in inode * We do things in a bit complicated way but by that we avoid calling
@@ -1253,6 +1272,7 @@ int dquot_initialize(struct inode *inodeint cnt, ret =0 ;struct dquot *got[MAXQUOTAS ] = {NULL ,NULL };struct super_block *sb = inode->i_sb; +qsize_t rsv;/* First test before acquiring mutex - solves deadlocks when we * re-enter the quota code and are already holding the mutex */
@@ -1287,6 +1307,13 @@ int dquot_initialize(struct inode *inodeif (!inode->i_dquot[cnt]) { inode->i_dquot[cnt] = got[cnt]; got[cnt] =NULL ; +/* +* Make quota reservation system happy if someone +* did a write before quota was turned on +*/ + rsv =inode_get_rsv_space (inode); +if (unlikely (rsv)) +dquot_resv_space (inode->i_dquot[cnt], rsv); } } out_err:
PATCH 149/156 ahci: use BIOS date in broken_suspend list
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 9deb343189b3cf45e84dd08480f330575ffe2004 upstream.
HP is recycling both DMI_PRODUCT_NAME and DMI_BIOS_VERSION making ahci_broken_suspend() trigger for later products which are not affected by the original problems. Match BIOS date instead of version and add references to bko's so that full information can be found easier later.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=15462
--- drivers/ata/ahci.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
drivers/ata/ahci.c +20 -8
@@ -2831,6 +2831,14 @@ static bool ahci_broken_suspend(struct p* On HP dv[4-6] and HDX18 with earlier BIOSen, link * to the harddisk doesn't become online after * resuming from STR. Warn and fail suspend. +* +* http://bugzilla.kernel.org/show_bug.cgi?id=12276 +* +* Use dates instead of versions to match as HP is +* apparently recycling both product and version +* strings. +* +* http://bugzilla.kernel.org/show_bug.cgi?id=15462 */ { .ident = "dv4",
@@ -2839,7 +2847,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP Pavilion dv4 Notebook PC"), }, - .driver_data ="F.30" ,/* cutoff BIOS version */ + .driver_data ="20090105" ,/* F.30 */ }, { .ident = "dv5",
@@ -2848,7 +2856,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP Pavilion dv5 Notebook PC"), }, - .driver_data ="F.16" ,/* cutoff BIOS version */ + .driver_data ="20090506" ,/* F.16 */ }, { .ident = "dv6",
@@ -2857,7 +2865,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP Pavilion dv6 Notebook PC"), }, - .driver_data ="F.21" ,/* cutoff BIOS version */ + .driver_data ="20090423" ,/* F.21 */ }, { .ident = "HDX18",
@@ -2866,7 +2874,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP HDX18 Notebook PC"), }, - .driver_data = "F.23", /* cutoff BIOS version */ + .driver_data = "20090430", /* F.23 */ },/* * Acer eMachines G725 has the same problem. BIOS
@@ -2874,6 +2882,8 @@ static bool ahci_broken_suspend(struct p* work. Inbetween, there are V1.06, V2.06 and V3.03 * that we don't have much idea about. For now, * blacklist anything older than V3.04. +* +* http://bugzilla.kernel.org/show_bug.cgi?id=15104 */ { .ident = "G725",
@@ -2881,19 +2891,21 @@ static bool ahci_broken_suspend(struct p DMI_MATCH(DMI_SYS_VENDOR, "eMachines"), DMI_MATCH(DMI_PRODUCT_NAME, "eMachines G725"), }, - .driver_data = "V3.04", /* cutoff BIOS version */ + .driver_data = "20091216", /* V3.04 */ }, { }/* terminate list */ };const struct dmi_system_id *dmi =dmi_first_match (sysids); -const char *ver; +int year, month, date; +char buf[9 ];if (!dmi || pdev->bus->number || pdev->devfn !=PCI_DEVFN (0x1f ,2 ))return false; - ver =dmi_get_system_info (DMI_BIOS_VERSION ); +dmi_get_date (DMI_BIOS_DATE , &year, &month, &date); +snprintf (buf,sizeof (buf),"%04d%02d%02d" , year, month, date); -return !ver ||strcmp (ver, dmi->driver_data) <0 ; +return strcmp (buf, dmi->driver_data) <0 ; }static bool ahci_broken_online (struct pci_dev *pdev)
PATCH 150/156 Bluetooth: Fix potential bad memory access with sysfs files
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marcel Holtmann <[email protected]>
commit 101545f6fef4a0a3ea8daf0b5b880df2c6a92a69 upstream.
When creating a high number of Bluetooth sockets (L2CAP, SCO and RFCOMM) it is possible to scribble repeatedly on arbitrary pages of memory. Ensure that the content of these sysfs files is always less than one page. Even if this means truncating. The files in question are scheduled to be moved over to debugfs in the future anyway.
Based on initial patches from Neil Brown and Linus Torvalds
--- net/bluetooth/l2cap.c | 10 +++++++++- net/bluetooth/rfcomm/core.c | 13 ++++++++++++- net/bluetooth/rfcomm/sock.c | 11 ++++++++++- net/bluetooth/sco.c | 11 ++++++++++- 4 files changed, 41 insertions(+), 4 deletions(-)
net/bluetooth/l2cap.c +9 -1
@@ -3942,16 +3942,24 @@ static ssize_t l2cap_sysfs_show(struct cstruct sock *sk;struct hlist_node *node;char *str = buf; +int size =PAGE_SIZE ;read_lock_bh (&l2cap_sk_list.lock);sk_for_each (sk, node, &l2cap_sk_list.head) {struct l2cap_pinfo *pi =l2cap_pi (sk); +int len; - str +=sprintf (str,"%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n" , + len =snprintf (str, size,"%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), sk->sk_state,__le16_to_cpu (pi->psm), pi->scid, pi->dcid, pi->imtu, pi->omtu, pi->sec_level); + + size -= len; +if (size <=0 ) +break ; + + str += len; }read_unlock_bh (&l2cap_sk_list.lock);
net/bluetooth/rfcomm/core.c +12 -1
@@ -2103,6 +2103,7 @@ static ssize_t rfcomm_dlc_sysfs_show(strstruct rfcomm_session *s;struct list_head *pp, *p;char *str = buf; +int size =PAGE_SIZE ;rfcomm_lock ();
@@ -2111,11 +2112,21 @@ static ssize_t rfcomm_dlc_sysfs_show(strlist_for_each (pp, &s->dlcs) {struct sock *sk = s->sock->sk; struct rfcomm_dlc *d = list_entry(pp, struct rfcomm_dlc, list); +int len; - str +=sprintf (str,"%s %s %ld %d %d %d %d\n" , + len =snprintf (str, size,"%s %s %ld %d %d %d %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), d->state, d->dlci, d->mtu, d->rx_credits, d->tx_credits); + + size -= len; +if (size <=0 ) +break ; + + str += len; } + +if (size <=0 ) +break ; }rfcomm_unlock ();
net/bluetooth/rfcomm/sock.c +10 -1
@@ -1066,13 +1066,22 @@ static ssize_t rfcomm_sock_sysfs_show(ststruct sock *sk;struct hlist_node *node;char *str = buf; +int size =PAGE_SIZE ;read_lock_bh (&rfcomm_sk_list.lock);sk_for_each (sk, node, &rfcomm_sk_list.head) { - str +=sprintf (str,"%s %s %d %d\n" , +int len; + + len =snprintf (str, size,"%s %s %d %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), sk->sk_state,rfcomm_pi (sk)->channel); + + size -= len; +if (size <=0 ) +break ; + + str += len; }read_unlock_bh (&rfcomm_sk_list.lock);
net/bluetooth/sco.c +10 -1
@@ -958,13 +958,22 @@ static ssize_t sco_sysfs_show(struct clastruct sock *sk;struct hlist_node *node;char *str = buf; +int size =PAGE_SIZE ;read_lock_bh (&sco_sk_list.lock);sk_for_each (sk, node, &sco_sk_list.head) { - str +=sprintf (str,"%s %s %d\n" , +int len; + + len =snprintf (str, size,"%s %s %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), sk->sk_state); + + size -= len; +if (size <=0 ) +break ; + + str += len; }read_unlock_bh (&sco_sk_list.lock);
PATCH 151/156 Bluetooth: Fix kernel crash on L2CAP stress tests
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrei Emeltchenko <[email protected]>
commit c2c77ec83bdad17fb688557b5b3fdc36661dd1c6 upstream.
Added very simple check that req buffer has enough space to fit configuration parameters. Shall be enough to reject packets with configuration size more than req buffer.
Crash trace below
[ 6069.659393] Unable to handle kernel paging request at virtual address 02000205 [ 6069.673034] Internal error: Oops: 805 [#1] PREEMPT ... [ 6069.727172] PC is at l2cap_add_conf_opt+0x70/0xf0 [l2cap] [ 6069.732604] LR is at l2cap_recv_frame+0x1350/0x2e78 [l2cap] ... [ 6070.030303] Backtrace: [ 6070.032806] [<bf1c2880>] (l2cap_add_conf_opt+0x0/0xf0 [l2cap]) from [<bf1c6624>] (l2cap_recv_frame+0x1350/0x2e78 [l2cap]) [ 6070.043823] r8:dc5d3100 r7:df2a91d6 r6:00000001 r5:df2a8000 r4:00000200 [ 6070.050659] [<bf1c52d4>] (l2cap_recv_frame+0x0/0x2e78 [l2cap]) from [<bf1c8408>] (l2cap_recv_acldata+0x2bc/0x350 [l2cap]) [ 6070.061798] [<bf1c814c>] (l2cap_recv_acldata+0x0/0x350 [l2cap]) from [<bf0037a4>] (hci_rx_task+0x244/0x478 [bluetooth]) [ 6070.072631] r6:dc647700 r5:00000001 r4:df2ab740 [ 6070.077362] [<bf003560>] (hci_rx_task+0x0/0x478 [bluetooth]) from [<c006b9fc>] (tasklet_action+0x78/0xd8) [ 6070.087005] [<c006b984>] (tasklet_action+0x0/0xd8) from [<c006c160>]
--- net/bluetooth/l2cap.c | 5 +++++ 1 file changed, 5 insertions(+)
net/bluetooth/l2cap.c +5 -0
@@ -2830,6 +2830,11 @@ static inline int l2cap_config_rsp(strucint len = cmd->len -sizeof (*rsp);char req[64 ]; +if (len >sizeof (req) -sizeof (struct l2cap_conf_req )) { +l2cap_send_disconn_req (conn, sk); + goto done; + } +/* throw out any old stored conf requests */ result =L2CAP_CONF_SUCCESS ; len = l2cap_parse_conf_rsp(sk, rsp->data,
PATCH 152/156 b43: Workaround circular locking in hw-tkip key update callback
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Buesch <[email protected]>
commit 96869a39399269a776a94812e9fff3d38b47d838 upstream
The TKIP key update callback is called from the RX path, where the driver mutex is already locked. This results in a circular locking bug. Avoid this by removing the lock.
Johannes noted that there is a separate bug: The callback still breaks on SDIO hardware, because SDIO hardware access needs to sleep, but we are not allowed to sleep in the callback due to mac80211's RCU locking.
--- drivers/net/wireless/b43/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/net/wireless/b43/main.c +4 -7
@@ -852,19 +852,16 @@ static void b43_op_update_tkip_key(strucif (B43_WARN_ON (!modparam_hwtkip))return ; -mutex_lock (&wl->mutex); - +/* This is only called from the RX path through mac80211, where +* our mutex is already locked. */ +B43_WARN_ON (!mutex_is_locked (&wl->mutex)); dev = wl->current_dev; -if (!dev ||b43_status (dev) <B43_STAT_INITIALIZED ) - goto out_unlock; +B43_WARN_ON (!dev ||b43_status (dev) <B43_STAT_INITIALIZED );keymac_write (dev, index,NULL );/* First zero out mac to avoid race */ rx_tkip_phase1_write (dev, index, iv32, phase1key);keymac_write (dev, index, addr); - -out_unlock: -mutex_unlock (&wl->mutex); } static void do_key_write(struct b43_wldev *dev,
PATCH 153/156 x86: Fix sched_clock_cpu for systems with unsynchronized TSC
In reply to Greg KHFrom: Dimitri Sivanich <[email protected]>
commit 14be1f7454ea96ee614467a49cf018a1a383b189 upstream.
On UV systems, the TSC is not synchronized across blades. The sched_clock_cpu() function is returning values that can go backwards (I've seen as much as 8 seconds) when switching between cpus.
As each cpu comes up, early_init_intel() will currently set the sched_clock_stable flag true. When mark_tsc_unstable() runs, it clears the flag, but this only occurs once (the first time a cpu comes up whose TSC is not synchronized with cpu 0). After this, early_init_intel() will set the flag again as the next cpu comes up.
Only set sched_clock_stable if tsc has not been marked unstable.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/intel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/intel.c +2 -1
@@ -70,7 +70,8 @@ static void __cpuinit early_init_intel(sif (c->x86_power & (1 <<8 )) {set_cpu_cap (c,X86_FEATURE_CONSTANT_TSC );set_cpu_cap (c,X86_FEATURE_NONSTOP_TSC ); - sched_clock_stable =1 ; +if (!check_tsc_unstable ()) + sched_clock_stable =1 ; }/*
PATCH 154/156 classmate-laptop: use a single MODULE_DEVICE_TABLE to get correct aliases
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
commit 02e77a55f7b7e36888e39c62439fedb90ae4e808 upstream.
Instead of a MODULE_DEVICE_TABLE for every acpi_driver ids table, we create a table containing all ids to export to get a module alias for each one.
This will fix automatic loading of the driver when one of the ACPI devices is not present (like the accelerometer, which is not present in some models).
--- drivers/platform/x86/classmate-laptop.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-)
drivers/platform/x86/classmate-laptop.c +21 -10
@@ -34,6 +34,11 @@ struct cmpc_accel {#define CMPC_ACCEL_SENSITIVITY_DEFAULT 5 +#define CMPC_ACCEL_HID "ACCE0000" +#define CMPC_TABLET_HID "TBLT0000" +#define CMPC_BL_HID "IPML200" +#define CMPC_KEYS_HID "FnBT0000" +/* * Generic input device code. */
@@ -282,10 +287,9 @@ static int cmpc_accel_remove(struct acpi }static const struct acpi_device_id cmpc_accel_device_ids[] = { - {"ACCE0000" ,0 }, + {CMPC_ACCEL_HID ,0 }, {"" ,0 } }; -MODULE_DEVICE_TABLE (acpi, cmpc_accel_device_ids);static struct acpi_driver cmpc_accel_acpi_driver = { .owner =THIS_MODULE ,
@@ -366,10 +370,9 @@ static int cmpc_tablet_resume(struct acp }static const struct acpi_device_id cmpc_tablet_device_ids[] = { - {"TBLT0000" ,0 }, + {CMPC_TABLET_HID ,0 }, {"" ,0 } }; -MODULE_DEVICE_TABLE (acpi, cmpc_tablet_device_ids);static struct acpi_driver cmpc_tablet_acpi_driver = { .owner =THIS_MODULE ,
@@ -477,17 +480,16 @@ static int cmpc_bl_remove(struct acpi_dereturn 0 ; } -static const struct acpi_device_id cmpc_device_ids[] = { - {"IPML200" ,0 }, +static const struct acpi_device_id cmpc_bl_device_ids[] = { + {CMPC_BL_HID ,0 }, {"" ,0 } }; -MODULE_DEVICE_TABLE (acpi, cmpc_device_ids);static struct acpi_driver cmpc_bl_acpi_driver = { .owner =THIS_MODULE , .name ="cmpc" , .class ="cmpc" , - .ids = cmpc_device_ids, + .ids = cmpc_bl_device_ids, .ops = { .add = cmpc_bl_add, .remove = cmpc_bl_remove
@@ -540,10 +542,9 @@ static int cmpc_keys_remove(struct acpi_ }static const struct acpi_device_id cmpc_keys_device_ids[] = { - {"FnBT0000" ,0 }, + {CMPC_KEYS_HID ,0 }, {"" ,0 } }; -MODULE_DEVICE_TABLE (acpi, cmpc_keys_device_ids);static struct acpi_driver cmpc_keys_acpi_driver = { .owner =THIS_MODULE ,
@@ -607,3 +608,13 @@ static void cmpc_exit(void)module_init (cmpc_init);module_exit (cmpc_exit); + +static const struct acpi_device_id cmpc_device_ids[] = { + {CMPC_ACCEL_HID ,0 }, + {CMPC_TABLET_HID ,0 }, + {CMPC_BL_HID ,0 }, + {CMPC_KEYS_HID ,0 }, + {"" ,0 } +}; + +MODULE_DEVICE_TABLE (acpi, cmpc_device_ids);
PATCH 155/156 GFS2: Skip check for mandatory locks when unlocking
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sachin Prabhu <[email protected]>
commit 720e7749279bde0d08684b1bb4e7a2eedeec6394 upstream.
gfs2_lock() will skip locks on file which have mode set to 02666. This is a problem in cases where the mode of the file is changed after a process has obtained a lock on the file. Such a lock will be skipped and will result in a BUG in locks_remove_flock().
gfs2_lock() should skip the check for mandatory locks when unlocking a file.
--- fs/gfs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/file.c +1 -1
@@ -640,7 +640,7 @@ static int gfs2_lock(struct file *file,if (!(fl->fl_flags &FL_POSIX ))return -ENOLCK ; -if (__mandatory_lock (&ip->i_inode)) +if (__mandatory_lock (&ip->i_inode) && fl->fl_type !=F_UNLCK )return -ENOLCK ;if (cmd ==F_CANCELLK ) {
PATCH 156/156 pata_via: fix VT6410/6415/6330 detection issue
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: [email protected] <[email protected]>
commit bc8a67386fd462914269fa93446e1891955a8bb3 upstream.
When using VT6410/6415/6330 chips on some VIA's platforms, the HDD connection to VT6410/6415/6330 cannot be detected.
It is because the driver detects wrong via_isa_bridge ID, and then causes this issue to happen.
--- drivers/ata/pata_via.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/ata/pata_via.c +4 -0
@@ -588,6 +588,10 @@ static int via_init_one(struct pci_dev *u8 rev = isa->revision;pci_dev_put (isa); +if ((id->device ==0x0415 || id->device ==0x3164 ) && + (config->id != id->device)) +continue ; +if (rev >= config->rev_min && rev <= config->rev_max)break ; }
cover 2.6.27.46-stable review
In reply to Greg KHThis is the start of the stable review cycle for the 2.6.27.46 release. There are 45 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 us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by April 1, 2010, 22:00:00 UTC. 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/v2.6/stable-review/patch-2.6.27.46-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Documentation/filesystems/tmpfs.txt | 6 +++- Makefile | 2 +- arch/x86/ia32/ia32_aout.c | 1 - arch/x86/kvm/vmx.c | 3 ++ arch/x86/kvm/x86.c | 21 ++++++++++- arch/x86/kvm/x86_emulate.c | 5 ++- drivers/char/mem.c | 3 ++ drivers/char/tty_io.c | 4 ++- drivers/gpu/drm/r128/r128_cce.c | 18 +++++++-- drivers/gpu/drm/r128/r128_drv.h | 8 ++++ drivers/gpu/drm/r128/r128_state.c | 36 ++++++++++--------- drivers/hwmon/coretemp.c | 2 +- drivers/hwmon/lm78.c | 23 ++++++++---- drivers/i2c/i2c-core.c | 5 ++- drivers/media/video/em28xx/em28xx-dvb.c | 1 + drivers/mtd/ubi/cdev.c | 1 - drivers/net/b44.c | 3 +- drivers/net/bonding/bond_main.c | 8 ++++ drivers/net/r8169.c | 4 +- drivers/net/sky2.c | 4 ++- drivers/parisc/eisa_eeprom.c | 2 +- drivers/serial/8250.c | 7 ++-- drivers/usb/core/devio.c | 61 +++++++++++++++++++++---------- drivers/usb/host/ehci-hub.c | 7 ++-- drivers/usb/host/ehci-q.c | 11 +++--- drivers/usb/host/ehci-sched.c | 1 + fs/exec.c | 3 +- fs/ext4/super.c | 3 +- fs/fcntl.c | 6 +-- fs/namei.c | 14 ++++++- include/asm-x86/checksum_32.h | 3 +- include/asm-x86/kvm_host.h | 1 + include/asm-x86/kvm_x86_emulate.h | 2 +- include/linux/sched.h | 24 ++++++++++++- include/linux/topology.h | 4 +- kernel/futex.c | 28 +++++++++++++- kernel/printk.c | 2 +- kernel/sched.c | 12 +++--- kernel/sched_fair.c | 13 +++++-- kernel/sched_features.h | 1 + kernel/sched_idletask.c | 6 ++-- kernel/sched_rt.c | 2 +- mm/mempolicy.c | 34 +++++++++++------ mm/migrate.c | 3 ++ net/ax25/af_ax25.c | 2 +- net/ipv4/tcp_minisocks.c | 2 +- net/ipv6/sit.c | 2 +- net/sched/sch_api.c | 2 + net/unix/af_unix.c | 5 ++- 49 files changed, 301 insertions(+), 120 deletions(-)
PATCH 1/45 UBI: fix volume creation input checking
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mika Westerberg <[email protected]>
commit c5ce5b46af76f52dea21f467397d24c4ae6cb3ff upstream.
Do not use an unchecked variable UBI_IOCMKVOL ioctl.
--- drivers/mtd/ubi/cdev.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/ubi/cdev.c +0 -1
@@ -793,7 +793,6 @@ static int ubi_cdev_ioctl(struct inode *break ; } - req.name[req.name_len] ='\0' ; err =verify_mkvol_req (ubi, &req);if (err)break ;
PATCH 2/45 Fix potential crash with sys_move_pages
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit 6f5a55f1a6c5abee15a0e878e5c74d9f1569b8b0 upstream.
We incorrectly depended on the 'node_state/node_isset()' functions testing the node range, rather than checking it explicitly. That's not reliable, even if it might often happen to work. So do the proper explicit test.
--- mm/migrate.c | 3 +++ 1 file changed, 3 insertions(+)
mm/migrate.c +3 -0
@@ -1062,6 +1062,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, goto out; err = -ENODEV ; +if (node <0 || node >=MAX_NUMNODES ) + goto out; +if (!node_state (node,N_HIGH_MEMORY )) goto out;
PATCH 3/45 Fix race in tty_fasync() properly
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit 80e1e823989ec44d8e35bdfddadbddcffec90424 upstream.
This reverts commit 703625118069 ("tty: fix race in tty_fasync") and commit b04da8bfdfbb ("fnctl: f_modown should call write_lock_irqsave/ restore") that tried to fix up some of the fallout but was incomplete.
It turns out that we really cannot hold 'tty->ctrl_lock' over calling __f_setown, because not only did that cause problems with interrupt disables (which the second commit fixed), it also causes a potential ABBA deadlock due to lock ordering.
Thanks to Tetsuo Handa for following up on the issue, and running lockdep to show the problem. It goes roughly like this:
- f_getown gets filp->f_owner.lock for reading without interrupts disabled, so an interrupt that happens while that lock is held can cause a lockdep chain from f_owner.lock -> sighand->siglock.
- at the same time, the tty->ctrl_lock -> f_owner.lock chain that commit 703625118069 introduced, together with the pre-existing sighand->siglock -> tty->ctrl_lock chain means that we have a lock dependency the other way too.
So instead of extending tty->ctrl_lock over the whole __f_setown() call, we now just take a reference to the 'pid' structure while holding the lock, and then release it after having done the __f_setown. That still guarantees that 'struct pid' won't go away from under us, which is all we really ever needed.
--- drivers/char/tty_io.c | 4 +++- fs/fcntl.c | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/char/tty_io.c +3 -1
@@ -2437,8 +2437,10 @@ static int tty_fasync(int fd, struct fil pid =task_pid (current); type =PIDTYPE_PID ; } - retval =__f_setown (filp, pid, type,0 ); +get_pid (pid);spin_unlock_irqrestore (&tty->ctrl_lock, flags); + retval =__f_setown (filp, pid, type,0 ); +put_pid (pid);if (retval) goto out; }else {
fs/fcntl.c +2 -4
@@ -200,9 +200,7 @@ static int setfl(int fd, struct file * fstatic void f_modown (struct file *filp,struct pid *pid,enum pid_type type,uid_t uid,uid_t euid,int force) { -unsigned long flags; - -write_lock_irqsave (&filp->f_owner.lock, flags); +write_lock_irq (&filp->f_owner.lock);if (force || !filp->f_owner.pid) {put_pid (filp->f_owner.pid); filp->f_owner.pid =get_pid (pid);
@@ -210,7 +208,7 @@ static void f_modown(struct file *filp, filp->f_owner.uid = uid; filp->f_owner.euid = euid; } -write_unlock_irqrestore (&filp->f_owner.lock, flags); +write_unlock_irq (&filp->f_owner.lock); } int __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
PATCH 4/45 futex: Handle futex value corruption gracefully
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <[email protected]>
commit 59647b6ac3050dd964bc556fe6ef22f4db5b935c upstream.
The WARN_ON in lookup_pi_state which complains about a mismatch between pi_state->owner->pid and the pid which we retrieved from the user space futex is completely bogus.
The code just emits the warning and then continues despite the fact that it detected an inconsistent state of the futex. A conveniant way for user space to spam the syslog.
Replace the WARN_ON by a consistency check. If the values do not match return -EINVAL and let user space deal with the mess it created.
This also fixes the missing task_pid_vnr() when we compare the pi_state->owner pid with the futex value.
--- kernel/futex.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
kernel/futex.c +19 -2
@@ -533,8 +533,25 @@ lookup_pi_state(u32 uval, struct futex_hreturn -EINVAL ;WARN_ON (!atomic_read (&pi_state->refcount)); -WARN_ON (pid && pi_state->owner && - pi_state->owner->pid != pid); + +/* +* When pi_state->owner is NULL then the owner died +* and another waiter is on the fly. pi_state->owner +* is fixed up by the task which acquires +* pi_state->rt_mutex. +* +* We do not check for pid == 0 which can happen when +* the owner died and robust_list_exit() cleared the +* TID. +*/ +if (pid && pi_state->owner) { +/* +* Bail out if user space manipulated the +* futex value. +*/ +if (pid !=task_pid_vnr (pi_state->owner)) +return -EINVAL ; + }atomic_inc (&pi_state->refcount); *ps = pi_state;
PATCH 5/45 futex: Handle user space corruption gracefully
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <[email protected]>
commit 51246bfd189064079c54421507236fd2723b18f3 upstream.
If the owner of a PI futex dies we fix up the pi_state and set pi_state->owner to NULL. When a malicious or just sloppy programmed user space application sets the futex value to 0 e.g. by calling pthread_mutex_init(), then the futex can be acquired again. A new waiter manages to enqueue itself on the pi_state w/o damage, but on unlock the kernel dereferences pi_state->owner and oopses.
Prevent this by checking pi_state->owner in the unlock path. If pi_state->owner is not current we know that user space manipulated the futex value. Ignore the mess and return -EINVAL.
This catches the above case and also the case where a task hijacks the futex by setting the tid value and then tries to unlock it.
--- kernel/futex.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/futex.c +7 -0
@@ -647,6 +647,13 @@ static int wake_futex_pi(u32 __user *uadif (!pi_state)return -EINVAL ; +/* +* If current does not own the pi_state then the futex is +* inconsistent and user space fiddled with the futex value. +*/ +if (pi_state->owner != current) +return -EINVAL ; +spin_lock (&pi_state->pi_mutex.wait_lock); new_owner =rt_mutex_next_owner (&pi_state->pi_mutex);
PATCH 6/45 resource: add helpers for fetching rlimits
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit 3e10e716abf3c71bdb5d86b8f507f9e72236c9cd upstream.
We want to be sure that compiler fetches the limit variable only once, so add helpers for fetching current and maximal resource limits which do that.
Add them to sched.h (instead of resource.h) due to circular dependency
sched.h->resource.h->task_struct
Alternative would be to create a separate res_access.h or similar.
--- include/linux/sched.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
include/linux/sched.h +22 -0
@@ -2232,6 +2232,28 @@ static inline void mm_init_owner(struct#define TASK_STATE_TO_CHAR_STR "RSDTtZX" +static inline unsigned long task_rlimit (const struct task_struct *tsk, +unsigned int limit) +{ +return ACCESS_ONCE (tsk->signal->rlim[limit].rlim_cur); +} + +static inline unsigned long task_rlimit_max (const struct task_struct *tsk, +unsigned int limit) +{ +return ACCESS_ONCE (tsk->signal->rlim[limit].rlim_max); +} + +static inline unsigned long rlimit (unsigned int limit) +{ +return task_rlimit (current, limit); +} + +static inline unsigned long rlimit_max (unsigned int limit) +{ +return task_rlimit_max (current, limit); +} +#endif /* __KERNEL__ */ #endif
PATCH 7/45 printk: robustify printk, fix #2
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <[email protected]>
commit fa33507a22623b3bd543b15a21c362cf364b6cff upstream.
Dmitry Adamushko reported:
Quoted 44 lines
[*] btw., with DEBUG being enabled,
pr_debug()generates [1] whendebug_smp_processor_id()is used (CONFIG_DEBUG_PREEMPT).the problem seems to be caused by the following commit:
commitb845b517b5e3706a3729f6ea83b88ab85f0725b0Author: Peter Zijlstra <[email protected]> Date: Fri Aug 8 21:47:09 2008 +0200printk: robustify printk
wake_up_klogd()->__get_cpu_var()->smp_processor_id()and that's being called from
release_console_sem()which is, in turn, said to be "may be called from any context" [2]and in this case, it seems to be called from some non-preemptible context (although, it can't be
printk()...
although, I haven't looked carefully yet).Provided [2],
__get_cpu_var()is perhaps not the right solution there.[1]
[ 7697.942005] BUG: using smp_processor_id() in preemptible [00000000] code: syslogd/3542 [ 7697.942005] caller is wake_up_klogd+0x1b/0x50 [ 7697.942005] Pid: 3542, comm: syslogd Not tainted 2.6.27-rc3-tip-git #2 [ 7697.942005] Call Trace: [ 7697.942005] [<ffffffff8036b398>] debug_smp_processor_id+0xe8/0xf0 [ 7697.942005] [<ffffffff80239d3b>] wake_up_klogd+0x1b/0x50 [ 7697.942005] [<ffffffff8023a047>] release_console_sem+0x1e7/0x200 [ 7697.942005] [<ffffffff803c0f17>] do_con_write+0xb7/0x1f30 [ 7697.942005] [<ffffffff8020d920>] ? show_trace+0x10/0x20 [ 7697.942005] [<ffffffff8020dc42>] ? dump_stack+0x72/0x80 [ 7697.942005] [<ffffffff8036392d>] ? __ratelimit+0xbd/0xe0 [ 7697.942005] [<ffffffff8036b398>] ? debug_smp_processor_id+0xe8/0xf0 [ 7697.942005] [<ffffffff80239d3b>] ? wake_up_klogd+0x1b/0x50 [ 7697.942005] [<ffffffff8023a047>] ? release_console_sem+0x1e7/0x200 [ 7697.942005] [<ffffffff803c2de9>] con_write+0x19/0x30 [ 7697.942005] [<ffffffff803b37b6>] write_chan+0x276/0x3c0 [ 7697.942005] [<ffffffff80232b20>] ? default_wake_function+0x0/0x10 [ 7697.942005] [<ffffffff804cb872>] ? _spin_lock_irqsave+0x22/0x50 [ 7697.942005] [<ffffffff803b1334>] tty_write+0x194/0x260
Quoted 8 lines
[ 7697.942005] [<ffffffff803b3540>] ? write_chan+0x0/0x3c0 [ 7697.942005] [<ffffffff803b14a4>] redirected_tty_write+0xa4/0xb0 [ 7697.942005] [<ffffffff803b1400>] ? redirected_tty_write+0x0/0xb0 [ 7697.942005] [<ffffffff802a88c2>] do_loop_readv_writev+0x52/0x80 [ 7697.942005] [<ffffffff802a939d>] do_readv_writev+0x1bd/0x1d0 [ 7697.942005] [<ffffffff802a93e9>] vfs_writev+0x39/0x60 [ 7697.942005] [<ffffffff802a9870>] sys_writev+0x50/0x90 [ 7697.942005] [<ffffffff8020bb3b>] system_call_fastpath+0x16/0x1b
--- kernel/printk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/printk.c +1 -1
@@ -995,7 +995,7 @@ int printk_needs_cpu(int cpu)void wake_up_klogd (void ) {if (waitqueue_active (&log_wait)) -__get_cpu_var (printk_pending) =1 ; +__raw_get_cpu_var (printk_pending) =1 ; }/**
PATCH 8/45 hwmon: (lm78) Fix I/O resource conflict with PNP
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
This fix is the combination of the following two upstream patches:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=197027e6ef830d60e10f76efc8d12bf3b6c35db5
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=47c15532ddcd6818f51cb15f914d63864b3ee9ab
Only request I/O ports 0x295-0x296 instead of the full I/O address range. This solves a conflict with PNP resources on a few motherboards.
Also request the I/O ports individually during device detection, otherwise the PNP resource may cause the request (and thus the detection) fail.
--- drivers/hwmon/lm78.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/hwmon/lm78.c +15 -6
@@ -655,7 +655,7 @@ static int __devinit lm78_isa_probe(stru/* Reserve the ISA region */ res =platform_get_resource (pdev,IORESOURCE_IO ,0 ); -if (!request_region (res->start,LM78_EXTENT ,"lm78" )) { +if (!request_region (res->start +LM78_ADDR_REG_OFFSET ,2 ,"lm78" )) { err = -EBUSY ; goto exit; }
@@ -699,7 +699,7 @@ static int __devinit lm78_isa_probe(strudevice_remove_file (&pdev->dev, &dev_attr_name);kfree (data); exit_release_region: -release_region (res->start,LM78_EXTENT ); +release_region (res->start +LM78_ADDR_REG_OFFSET ,2 ); exit:return err; }
@@ -711,7 +711,7 @@ static int __devexit lm78_isa_remove(strhwmon_device_unregister (data->hwmon_dev);sysfs_remove_group (&pdev->dev.kobj, &lm78_group);device_remove_file (&pdev->dev, &dev_attr_name); -release_region (data->client.addr,LM78_EXTENT ); +release_region (data->client.addr +LM78_ADDR_REG_OFFSET ,2 );kfree (data);return 0 ;
@@ -836,9 +836,17 @@ static struct lm78_data *lm78_update_devstatic int __init lm78_isa_found (unsigned short address) {int val, save, found =0 ; +int port; -if (!request_region (address,LM78_EXTENT ,"lm78" )) -return 0 ; +/* Some boards declare base+0 to base+7 as a PNP device, some base+4 +* to base+7 and some base+5 to base+6. So we better request each port +* individually for the probing phase. */ +for (port = address; port < address +LM78_EXTENT ; port++) { +if (!request_region (port,1 ,"lm78" )) { +pr_debug ("lm78: Failed to request port 0x%x\n" , port); + goto release; + } + }#define REALLY_SLOW_IO /* We need the timeouts for at least some LM78-like
@@ -901,7 +909,8 @@ static int __init lm78_isa_found(unsigne val & 0x80 ? "LM79" : "LM78", (int)address); release: -release_region (address,LM78_EXTENT ); +for (port--; port >= address; port--) +release_region (port,1 );return found; }
PATCH 9/45 r8169: Fix receive buffer length when MTU is between 1515 and 1536
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Raimonds Cicans <[email protected]>
commit 8812304cf1110ae16b0778680f6022216cf4716a upstream.
In r8169 driver MTU is used to calculate receive buffer size. Receive buffer size is used to configure hardware incoming packet filter.
For jumbo frames:
Receive buffer size = Max frame size = MTU + 14 (ethernet header) + 4 (vlan header) + 4 (ethernet checksum) = MTU + 22
Bug:
driver for all MTU up to 1536 use receive buffer size 1536
As you can see from formula, this mean all IP packets > 1536 - 22 (for vlan tagged, 1536 - 18 for not tagged) are dropped by hardware filter.
Example:
host_good> ifconfig eth0 mtu 1536host_r8169> ifconfig eth0 mtu 1536host_good> ping host_r8169
Okhost_good> ping -s 1500 host_r8169
Failhost_good> ifconfig eth0 mtu 7000host_r8169> ifconfig eth0 mtu 7000host_good> ping -s 1500 host_r8169
Ok
Bonus: got rid of magic number 8
--- drivers/net/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/r8169.c +2 -2
@@ -1842,9 +1842,9 @@ static void __devexit rtl8169_remove_onestatic void rtl8169_set_rxbufsize (struct rtl8169_private *tp,struct net_device *dev) { -unsigned int mtu = dev->mtu; +unsigned int max_frame = dev->mtu +VLAN_ETH_HLEN +ETH_FCS_LEN ; - tp->rx_buf_sz = (mtu >RX_BUF_SIZE ) ? mtu +ETH_HLEN +8 :RX_BUF_SIZE ; + tp->rx_buf_sz = (max_frame >RX_BUF_SIZE ) ? max_frame :RX_BUF_SIZE ; }static int rtl8169_open (struct net_device *dev)
PATCH 10/45 EHCI: fix bug in keeping track of resuming ports
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
This patch fixes a bug caused by backporting commit cec3a53c7fe794237b582e8e77fc0e48465e65ee (USB: EHCI & UHCI: fix race between root-hub suspend and port resume) to 2.6.27.stable without also backporting commit eafe5b99f2135488b21cf17a262c54997c44f784 (USB:
EHCI: fix remote-wakeup support for ARC/TDI core). This extracts the necessary changes from the earlier patch and backports them.
The symptom of the bug is that the system will fail to suspend more than once. The problem is caused by setting ehci->reset_done[i] but never clearing it. When ehci_bus_suspend() sees a nonzero value there, it assumes this means the port is in the middle of resuming so it aborts the bus suspend.
--- drivers/usb/host/ehci-hub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/usb/host/ehci-hub.c +4 -3
@@ -254,10 +254,8 @@ static int ehci_bus_resume (struct usb_h temp =ehci_readl (ehci, &ehci->regs->port_status [i]); temp &= ~(PORT_RWC_BITS |PORT_WAKE_BITS );if (test_bit (i, &ehci->bus_suspended) && - (temp &PORT_SUSPEND )) { - ehci->reset_done [i] = jiffies +msecs_to_jiffies (20 ); + (temp &PORT_SUSPEND )) temp |=PORT_RESUME ; - }ehci_writel (ehci, temp, &ehci->regs->port_status [i]); } i =HCS_N_PORTS (ehci->hcs_params);
@@ -752,6 +750,9 @@ static int ehci_hub_control ( ehci_readl(ehci, status_reg)); } +if (!(temp & (PORT_RESUME |PORT_RESET ))) + ehci->reset_done[wIndex] =0 ; +/* transfer dedicated ports to the companion hc */ if ((temp &PORT_CONNECT ) &&test_bit (wIndex, &ehci->companion_ports)) {
PATCH 11/45 ax25: Fix possible oops in ax25_make_new
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jarek Poplawski <[email protected]>
commit 8c185ab6185bf5e67766edb000ce428269364c86 upstream.
In ax25_make_new, if kmemdup of digipeat returns an error, there would be an oops in sk_free while calling sk_destruct, because sk_protinfo is NULL at the moment; move sk->sk_destruct initialization after this.
BTW of reported-by: Bernard Pidoux F6BVP <[email protected]>
--- net/ax25/af_ax25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ax25/af_ax25.c +1 -1
@@ -894,7 +894,6 @@ struct sock *ax25_make_new(struct sock *sock_init_data (NULL , sk); - sk->sk_destruct = ax25_free_sock; sk->sk_type = osk->sk_type; sk->sk_priority = osk->sk_priority; sk->sk_protocol = osk->sk_protocol;
@@ -932,6 +931,7 @@ struct sock *ax25_make_new(struct sock * } sk->sk_protinfo = ax25; + sk->sk_destruct = ax25_free_sock; ax25->sk = sk;return sk;
PATCH 12/45 net: unix: fix sending fds in multiple buffers
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Miklos Szeredi <[email protected]>
commit 8ba69ba6a324b13e1190fc31e41954d190fd4f1d upstream.
Kalle Olavi Niemitalo reported that:
"..., when one process calls sendmsg once to send 43804 bytes of data and one file descriptor, and another process then calls recvmsg three times to receive the 16032+16032+11740 bytes, each of those recvmsg calls returns the file descriptor in the ancillary data. I confirmed this with strace. The behaviour differs from Linux 2.6.26, where reportedly only one of those recvmsg calls (I think the first one) returned the file descriptor."
This bug was introduced by a patch from me titled "net: unix: fix inflight counting bug in garbage collector", commit 6209344f5.
And the reason is, quoting Kalle:
"Before your patch, unix_attach_fds() would set scm->fp = NULL, so that if the loop in unix_stream_sendmsg() ran multiple iterations, it could not call unix_attach_fds() again. But now, unix_attach_fds() leaves scm->fp unchanged, and I think this causes it to be called multiple times and duplicate the same file descriptors to each struct sk_buff."
Fix this by introducing a flag that is cleared at the start and set when the fds attached to the first buffer. The resulting code should work equivalently to the one on 2.6.26.
--- net/unix/af_unix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/unix/af_unix.c +4 -1
@@ -1491,6 +1491,7 @@ static int unix_stream_sendmsg(struct kistruct sk_buff *skb;int sent=0 ;struct scm_cookie tmp_scm; +bool fds_sent = false;if (NULL == siocb->scm) siocb->scm = &tmp_scm;
@@ -1552,12 +1553,14 @@ static int unix_stream_sendmsg(struct ki size =min_t (int, size,skb_tailroom (skb));memcpy (UNIXCREDS (skb), &siocb->scm->creds,sizeof (struct ucred )); -if (siocb->scm->fp) { +/* Only send the fds in the first buffer */ +if (siocb->scm->fp && !fds_sent) { err =unix_attach_fds (siocb->scm, skb);if (err) {kfree_skb (skb); goto out_err; } + fds_sent = true; }if ((err =memcpy_fromiovec (skb_put (skb,size), msg->msg_iov, size)) !=0 ) {
PATCH 13/45 sit: fix off-by-one in ipip6_tunnel_get_prl
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sascha Hlusiak <[email protected]>
commit 298bf12ddb25841804f26234a43b89da1b1c0e21 upstream.
When requesting all prl entries (kprl.addr == INADDR_ANY) and there are more prl entries than there is space passed from userspace, the existing code would always copy cmax+1 entries, which is more than can be handled.
This patch makes the kernel copy only exactly cmax entries.
--- net/ipv6/sit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/sit.c +1 -1
@@ -260,7 +260,7 @@ static int ipip6_tunnel_get_prl(struct i c =0 ;for (prl = t->prl; prl; prl = prl->next) { -if (c > cmax) +if (c >= cmax)break ;if (kprl.addr !=htonl (INADDR_ANY ) && prl->addr != kprl.addr)continue ;
PATCH 14/45 tcp: fix CONFIG_TCP_MD5SIG + CONFIG_PREEMPT timer BUG()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Robert Varga <[email protected]>
commit 657e9649e745b06675aa5063c84430986cdc3afa upstream.
I have recently came across a preemption imbalance detected by:
<4>huh, entered ffffffff80644630 with preempt_count 00000102, exited with 00000101? <0>------------[ cut here ]------------
<2>kernel BUG at /usr/src/linux/kernel/timer.c:664!
<0>invalid opcode: 0000 [1] PREEMPT SMP
with ffffffff80644630 being inet_twdr_hangman().
This appeared after I enabled CONFIG_TCP_MD5SIG and played with it a bit, so I looked at what might have caused it.
One thing that struck me as strange is tcp_twsk_destructor(), as it calls tcp_put_md5sig_pool() -- which entails a put_cpu(), causing the detected imbalance. Found on 2.6.23.9, but 2.6.31 is affected as well, as far as I can tell.
--- net/ipv4/tcp_minisocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_minisocks.c +1 -1
@@ -362,7 +362,7 @@ void tcp_twsk_destructor(struct sock *sk#ifdef CONFIG_TCP_MD5SIG struct tcp_timewait_sock *twsk =tcp_twsk (sk);if (twsk->tw_md5_keylen) -tcp_put_md5sig_pool (); +tcp_free_md5sig_pool ();#endif }
PATCH 15/45 x86: fix csum_ipv6_magic asm memory clobber
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Samuel Thibault <[email protected]>
commit 392d814daf460a9564d29b2cebc51e1ea34e0504 upstream.
Just like ip_fast_csum, the assembly snippet in csum_ipv6_magic needs a memory clobber, as it is only passed the address of the buffer, not a memory reference to the buffer itself.
This caused failures in Hurd's pfinetv4 when we tried to compile it with gcc-4.3 (bogus checksums).
--- include/asm-x86/checksum_32.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/asm-x86/checksum_32.h +2 -1
@@ -161,7 +161,8 @@ static inline __sum16 csum_ipv6_magic(co "adcl $0, %0 ;\n" : "=&r" (sum) : "r" (saddr), "r" (daddr), - "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)); + "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) + : "memory");return csum_fold (sum); }
PATCH 16/45 sky2: Set SKY2_HW_RAM_BUFFER in sky2_init
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike McCormack <[email protected]>
commit 74a61ebf653c6abe459f228eb40e9f24f7ef1fb7 upstream.
The SKY2_HW_RAM_BUFFER bit in hw->flags was checked in sky2_mac_init(),
before being set later in sky2_up().
Setting SKY2_HW_RAM_BUFFER in sky2_init() where other hw->flags are set
should avoid this problem recurring.
--- drivers/net/sky2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/sky2.c +3 -1
@@ -1438,7 +1438,6 @@ static int sky2_up(struct net_device *deif (ramsize >0 ) {u32 rxspace; - hw->flags |=SKY2_HW_RAM_BUFFER ;pr_debug (PFX "%s: ram buffer %dK\n" , dev->name, ramsize);if (ramsize <16 ) rxspace = ramsize /2 ;
@@ -2846,6 +2845,9 @@ static int __devinit sky2_init(struct sk ++hw->ports; } +if (sky2_read8 (hw,B2_E_0 )) + hw->flags |=SKY2_HW_RAM_BUFFER ; +return 0 ; }
PATCH 17/45 sched: fine-tune SD_MC_INIT
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike Galbraith <[email protected]>
commit 14800984706bf6936bbec5187f736e928be5c218 upstream.
Tune SD_MC_INIT the same way as SD_CPU_INIT:
unset SD_BALANCE_NEWIDLE, and set SD_WAKE_BALANCE.
This improves vmark by 5%:
vmark 132102 125968 125497 messages/sec avg 127855.66 .984 vmark 139404 131719 131272 messages/sec avg 134131.66 1.033
--- include/linux/topology.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/topology.h +1 -1
@@ -120,10 +120,10 @@ void arch_update_cpu_topology(void); .wake_idx = 1, \ .forkexec_idx = 1, \ .flags =SD_LOAD_BALANCE \ - |SD_BALANCE_NEWIDLE \ |SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ + |SD_WAKE_BALANCE \ |SD_SHARE_PKG_RESOURCES \ | BALANCE_FOR_MC_POWER, \ .last_balance = jiffies, \
PATCH 18/45 sched: fine-tune SD_SIBLING_INIT
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ingo Molnar <[email protected]>
commit 52c642f33b14bfa1b00ef2b68296effb34a573f3 upstream.
fine-tune the HT sched-domains parameters as well.
On a HT capable box, this increases lat_ctx performance from 23.87 usecs to 1.49 usecs:
# before
$ ./lat_ctx -s 0 2
"size=0k ovr=1.89
2 23.87
# after
$ ./lat_ctx -s 0 2
"size=0k ovr=1.84
2 1.49
--- include/linux/topology.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/topology.h +1 -1
@@ -99,7 +99,7 @@ void arch_update_cpu_topology(void); | SD_BALANCE_FORK \ |SD_BALANCE_EXEC \ |SD_WAKE_AFFINE \ - |SD_WAKE_IDLE \ + |SD_WAKE_BALANCE \ | SD_SHARE_CPUPOWER, \ .last_balance = jiffies, \ .balance_interval = 1, \
PATCH 19/45 sched: wakeup preempt when small overlap
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <[email protected]>
commit 15afe09bf496ae10c989e1a375a6b5da7bd3e16e upstream.
Lin Ming reported a 10% OLTP regression against 2.6.27-rc4.
The difference seems to come from different preemption agressiveness, which affects the cache footprint of the workload and its effective cache trashing.
Aggresively preempt a task if its avg overlap is very small, this should avoid the task going to sleep and find it still running when we schedule back to it - saving a wakeup.
--- include/linux/sched.h | 2 +- kernel/sched.c | 12 ++++++------ kernel/sched_fair.c | 13 ++++++++++--- kernel/sched_features.h | 1 + kernel/sched_idletask.c | 6 +++--- kernel/sched_rt.c | 2 +- 6 files changed, 22 insertions(+), 14 deletions(-)
include/linux/sched.h +1 -1
@@ -901,7 +901,7 @@ struct sched_class {void (*yield_task) (struct rq *rq);int (*select_task_rq)(struct task_struct *p,int sync); -void (*check_preempt_curr) (struct rq *rq,struct task_struct *p); +void (*check_preempt_curr) (struct rq *rq,struct task_struct *p,int sync);struct task_struct * (*pick_next_task) (struct rq *rq);void (*put_prev_task) (struct rq *rq,struct task_struct *p);
kernel/sched.c +6 -6
@@ -604,9 +604,9 @@ struct rq { static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); -static inline void check_preempt_curr (struct rq *rq,struct task_struct *p) +static inline void check_preempt_curr (struct rq *rq,struct task_struct *p,int sync) { - rq->curr->sched_class->check_preempt_curr (rq, p); + rq->curr->sched_class->check_preempt_curr (rq, p, sync); }static inline int cpu_of (struct rq *rq)
@@ -2285,7 +2285,7 @@ out_running:trace_mark (kernel_sched_wakeup,"pid %d state %ld ## rq %p task %p rq->curr %p" , p->pid, p->state, rq, p, rq->curr); -check_preempt_curr (rq, p); +check_preempt_curr (rq, p, sync); p->state =TASK_RUNNING ;#ifdef CONFIG_SMP
@@ -2420,7 +2420,7 @@ void wake_up_new_task(struct task_structtrace_mark (kernel_sched_wakeup_new,"pid %d state %ld ## rq %p task %p rq->curr %p" , p->pid, p->state, rq, p, rq->curr); -check_preempt_curr (rq, p); +check_preempt_curr (rq, p,0 );#ifdef CONFIG_SMP if (p->sched_class->task_wake_up) p->sched_class->task_wake_up (rq, p);
@@ -2880,7 +2880,7 @@ static void pull_task(struct rq *src_rq,* Note that idle threads have a prio of MAX_PRIO, for this test * to be always true for them. */ -check_preempt_curr (this_rq, p); +check_preempt_curr (this_rq, p,0 ); }/*
@@ -5957,7 +5957,7 @@ static int __migrate_task(struct task_stset_task_cpu (p, dest_cpu);if (on_rq) {activate_task (rq_dest, p,0 ); -check_preempt_curr (rq_dest, p); +check_preempt_curr (rq_dest, p,0 ); } done: ret =1 ;
kernel/sched_fair.c +10 -3
@@ -1331,7 +1331,7 @@ static inline int depth_se(struct sched_/* * Preempt the current task with a newly woken task if needed: */ -static void check_preempt_wakeup (struct rq *rq,struct task_struct *p) +static void check_preempt_wakeup (struct rq *rq,struct task_struct *p,int sync) {struct task_struct *curr = rq->curr;struct cfs_rq *cfs_rq =task_cfs_rq (curr);
@@ -1360,6 +1360,13 @@ static void check_preempt_wakeup(structif (!sched_feat (WAKEUP_PREEMPT ))return ; +if (sched_feat (WAKEUP_OVERLAP ) && sync && + se->avg_overlap < sysctl_sched_migration_cost && + pse->avg_overlap < sysctl_sched_migration_cost) { +resched_task (curr); +return ; + } +/* * preemption test can be made between sibling entities who are in the * same cfs_rq i.e who have a common parent. Walk up the hierarchy of
@@ -1642,7 +1649,7 @@ static void prio_changed_fair(struct rqif (p->prio > oldprio)resched_task (rq->curr); }else -check_preempt_curr (rq, p); +check_preempt_curr (rq, p,0 ); }/*
@@ -1659,7 +1666,7 @@ static void switched_to_fair(struct rq *if (running)resched_task (rq->curr);else -check_preempt_curr (rq, p); +check_preempt_curr (rq, p,0 ); }/* Account for a task changing its policy or group.
kernel/sched_features.h +1 -0
@@ -11,3 +11,4 @@ SCHED_FEAT(ASYM_GRAN, 1) SCHED_FEAT(LB_BIAS, 1) SCHED_FEAT(LB_WAKEUP_UPDATE, 1) SCHED_FEAT(ASYM_EFF_LOAD, 1) +SCHED_FEAT (WAKEUP_OVERLAP ,1 )
kernel/sched_idletask.c +3 -3
@@ -14,7 +14,7 @@ static int select_task_rq_idle(struct ta/* * Idle tasks are unconditionally rescheduled: */ -static void check_preempt_curr_idle (struct rq *rq,struct task_struct *p) +static void check_preempt_curr_idle (struct rq *rq,struct task_struct *p,int sync) {resched_task (rq->idle); }
@@ -76,7 +76,7 @@ static void switched_to_idle(struct rq *if (running)resched_task (rq->curr);else -check_preempt_curr (rq, p); +check_preempt_curr (rq, p,0 ); } static void prio_changed_idle(struct rq *rq, struct task_struct *p,
@@ -93,7 +93,7 @@ static void prio_changed_idle(struct rqif (p->prio > oldprio)resched_task (rq->curr); }else -check_preempt_curr (rq, p); +check_preempt_curr (rq, p,0 ); }/*
kernel/sched_rt.c +1 -1
@@ -784,7 +784,7 @@ static void check_preempt_equal_prio(str/* * Preempt the current task with a newly woken task if needed: */ -static void check_preempt_curr_rt (struct rq *rq,struct task_struct *p) +static void check_preempt_curr_rt (struct rq *rq,struct task_struct *p,int sync) {if (p->prio < rq->curr->prio) {resched_task (rq->curr);
PATCH 20/45 drivers/char/mem.c: avoid OOM lockup during large reads from /dev/zero
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Salman Qazi <[email protected]>
commit 730c586ad5228c339949b2eb4e72b80ae167abc4 upstream.
While running 20 parallel instances of dd as follows:
#!/bin/bash
for i in seq 1 20; do
dd if=/dev/zero of=/export/hda3/dd_$i bs=1073741824 count=1 &
done
wait
on a 16G machine, we noticed that rather than just killing the processes, the entire kernel went down. Stracing dd reveals that it first does an mmap2, which makes 1GB worth of zero page mappings. Then it performs a read on those pages from /dev/zero, and finally it performs a write.
The machine died during the reads. Looking at the code, it was noticed that /dev/zero's read operation had been changed by 557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") from giving zero page mappings to actually zeroing the page.
The zeroing of the pages causes physical pages to be allocated to the process. But, when the process exhausts all the memory that it can, the kernel cannot kill it, as it is still in the kernel mode allocating more memory. Consequently, the kernel eventually crashes.
To fix this, I propose that when a fatal signal is pending during /dev/zero read operation, we simply return and let the user process die.
--- drivers/char/mem.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/char/mem.c +3 -0
@@ -724,6 +724,9 @@ static ssize_t read_zero(struct file * f written += chunk - unwritten;if (unwritten)break ; +/* Consider changing this to just 'signal_pending()' with lots of testing */ +if (fatal_signal_pending (current)) +return written ? written : -EINTR ; buf += chunk; count -= chunk;cond_resched ();
PATCH 21/45 i2c: Do not use device name after device_unregister
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
In Linus' tree:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c556752109794a5ff199b80a1673336b4df8433a
dev_dbg outputs dev_name, which is released with device_unregister. This bug resulted in output like this:
i2c Xy2�0: adapter [SMBus I801 adapter at 1880] unregistered
The right output would be:
i2c i2c-0: adapter [SMBus I801 adapter at 1880] unregistered
--- drivers/i2c/i2c-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core.c +3 -2
@@ -644,6 +644,9 @@ int i2c_del_adapter(struct i2c_adapter * } } +/* device name is gone after device_unregister */ +dev_dbg (&adap->dev,"adapter [%s] unregistered\n" , adap->name); +/* clean up the sysfs representation */ init_completion (&adap->dev_released);device_unregister (&adap->dev);
@@ -654,8 +657,6 @@ int i2c_del_adapter(struct i2c_adapter */* free bus id */ idr_remove (&i2c_adapter_idr, adap->nr); -dev_dbg (&adap->dev,"adapter [%s] unregistered\n" , adap->name); -/* Clear the device structure in case this adapter is ever going to be added again */ memset (&adap->dev,0 ,sizeof (adap->dev));
PATCH 22/45 serial: 8250: add serial transmitter fully empty test
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dick Hollenbeck <[email protected]>
commit bca476139d2ded86be146dae09b06e22548b67f3 upstream.
When controlling an industrial radio modem it can be necessary to manipulate the handshake lines in order to control the radio modem's transmitter, from userspace.
The transmitter should not be turned off before all characters have been transmitted. serial8250_tx_empty() was reporting that all characters were transmitted before they actually were.
===
Discovered in parallel with more testing and analysis by Kees Schoenmakers as follows:
I ran into an NetMos 9835 serial pci board which behaves a little different than the standard. This type of expansion board is very common.
"Standard" 8250 compatible devices clear the 'UART_LST_TEMT" bit together with the "UART_LSR_THRE" bit when writing data to the device.
The NetMos device does it slightly different
I believe that the TEMT bit is coupled to the shift register. The problem is that after writing data to the device and very quickly after that one does call serial8250_tx_empty, it returns the wrong information.
My patch makes the test more robust (and solves the problem) and it does not affect the already correct devices.
Alan:
We may yet need to quirk this but now we know which chips we have a way to do that should we find this breaks some other 8250 clone with dodgy THRE.
--- drivers/serial/8250.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/serial/8250.c +4 -3
@@ -70,6 +70,9 @@ static unsigned int nr_uarts = CONFIG_SE#define PASS_LIMIT 256 +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +/* * We default to IRQ0 for the "no irq" hack. Some * machine types want others as well - they're free
@@ -1656,7 +1659,7 @@ static unsigned int serial8250_tx_empty( up->lsr_saved_flags |= lsr &LSR_SAVE_FLAGS ;spin_unlock_irqrestore (&up->port.lock, flags); -return lsr &UART_LSR_TEMT ?TIOCSER_TEMT :0 ; +return (lsr &BOTH_EMPTY ) ==BOTH_EMPTY ?TIOCSER_TEMT :0 ; }static unsigned int serial8250_get_mctrl (struct uart_port *port)
@@ -1714,8 +1717,6 @@ static void serial8250_break_ctl(structspin_unlock_irqrestore (&up->port.lock, flags); } -#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) -/* * Wait for transmitter & holding register to empty */
PATCH 23/45 USB: usbfs: only copy the actual data received
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Greg KH <[email protected]>
commit d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6 upstream.
We need to only copy the data received by the device to userspace, not the whole kernel buffer, which can contain "stale" data.
Thanks to Marcus Meissner for pointing this out and testing the fix.
--- drivers/usb/core/devio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/core/devio.c +4 -4
@@ -1224,9 +1224,9 @@ static int processcompl(struct async *asvoid __user *addr = as->userurb;unsigned int i; -if (as->userbuffer) +if (as->userbuffer && urb->actual_length)if (copy_to_user (as->userbuffer, urb->transfer_buffer, - urb->transfer_buffer_length)) + urb->actual_length)) goto err_out;if (put_user (as->status, &userurb->status)) goto err_out;
@@ -1347,9 +1347,9 @@ static int processcompl_compat(struct asvoid __user *addr = as->userurb;unsigned int i; -if (as->userbuffer) +if (as->userbuffer && urb->actual_length)if (copy_to_user (as->userbuffer, urb->transfer_buffer, - urb->transfer_buffer_length)) + urb->actual_length))return -EFAULT ;if (put_user (as->status, &userurb->status))return -EFAULT ;
PATCH 24/45 USB: usbfs: properly clean up the as structure on error paths
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit ddeee0b2eec2a51b0712b04de4b39e7bec892a53 upstream.
I notice that the processcompl_compat() function seems to be leaking the 'struct async *as' in the error paths.
I think that the calling convention is fundamentally buggered. The caller is the one that did the "reap_as()" to get the as thing, the caller should be the one to free it too.
Freeing it in the caller also means that it very clearly always gets freed, and avoids the need for any "free in the error case too".
From: Linus Torvalds <[email protected]>
--- drivers/usb/core/devio.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-)
drivers/usb/core/devio.c +26 -14
@@ -1246,14 +1246,11 @@ static int processcompl(struct async *as } } -free_async (as); -if (put_user (addr, (void __user *__user *)arg))return -EFAULT ;return 0 ; err_out: -free_async (as);return -EFAULT ; }
@@ -1283,8 +1280,11 @@ static struct async *reap_as(struct dev_static int proc_reapurb (struct dev_state *ps,void __user *arg) {struct async *as =reap_as (ps); -if (as) -return processcompl (as, (void __user *__user *)arg); +if (as) { +int retval =processcompl (as, (void __user *__user *)arg); +free_async (as); +return retval; + }if (signal_pending (current))return -EINTR ;return -EIO ;
@@ -1292,11 +1292,16 @@ static int proc_reapurb(struct dev_statestatic int proc_reapurbnonblock (struct dev_state *ps,void __user *arg) { +int retval;struct async *as; -if (!(as =async_getcompleted (ps))) -return -EAGAIN ; -return processcompl (as, (void __user *__user *)arg); + as =async_getcompleted (ps); + retval = -EAGAIN ; +if (as) { + retval =processcompl (as, (void __user *__user *)arg); +free_async (as); + } +return retval; }#ifdef CONFIG_COMPAT
@@ -1369,7 +1374,6 @@ static int processcompl_compat(struct as } } -free_async (as);if (put_user (ptr_to_compat (addr), (u32 __user *)arg))return -EFAULT ;return 0 ;
@@ -1378,8 +1382,11 @@ static int processcompl_compat(struct asstatic int proc_reapurb_compat (struct dev_state *ps,void __user *arg) {struct async *as =reap_as (ps); -if (as) -return processcompl_compat (as, (void __user *__user *)arg); +if (as) { +int retval =processcompl_compat (as, (void __user *__user *)arg); +free_async (as); +return retval; + }if (signal_pending (current))return -EINTR ;return -EIO ;
@@ -1387,11 +1394,16 @@ static int proc_reapurb_compat(struct destatic int proc_reapurbnonblock_compat (struct dev_state *ps,void __user *arg) { +int retval;struct async *as; -if (!(as =async_getcompleted (ps))) -return -EAGAIN ; -return processcompl_compat (as, (void __user *__user *)arg); + retval = -EAGAIN ; + as =async_getcompleted (ps); +if (as) { + retval =processcompl_compat (as, (void __user *__user *)arg); +free_async (as); + } +return retval; }#endif
PATCH 25/45 USB: EHCI: fix counting of transaction error retries
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit ef4638f955f2c4a667c8af20769d03f5ed3781ca upstream.
This patch (as1274) simplifies the counting of transaction-error retries. Now we will count up from 0 to QH_XACTERR_MAX instead of down from QH_XACTERR_MAX to 0.
The patch also fixes a small bug: qh->xacterr was not getting initialized for interrupt endpoints.
--- drivers/usb/host/ehci-q.c | 11 +++++------ drivers/usb/host/ehci-sched.c | 1 + 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/usb/host/ehci-q.c +5 -6
@@ -346,12 +346,11 @@ qh_completions (struct ehci_hcd *ehci, s*/ if ((token &QTD_STS_XACT ) &&QTD_CERR (token) ==0 && - --qh->xacterrs >0 && + ++qh->xacterrs <QH_XACTERR_MAX && !urb->unlinked) {ehci_dbg (ehci, -"detected XactErr len %d/%d retry %d\n" , - qtd->length -QTD_LENGTH (token), qtd->length, -QH_XACTERR_MAX - qh->xacterrs); +"detected XactErr len %zu/%zu retry %d\n" , + qtd->length -QTD_LENGTH (token), qtd->length, qh->xacterrs);/* reset the token in the qtd and the * qh overlay (which still contains
@@ -451,7 +450,7 @@ halt: last = qtd;/* reinit the xacterr counter for the next qtd */ - qh->xacterrs =QH_XACTERR_MAX ; + qh->xacterrs =0 ; }/* last urb's completion might still need calling */
@@ -898,7 +897,7 @@ static void qh_link_async (struct ehci_h head->qh_next.qh = qh; head->hw_next = dma; - qh->xacterrs =QH_XACTERR_MAX ; + qh->xacterrs =0 ; qh->qh_state =QH_STATE_LINKED ;/* qtd completions reported later by interrupt */ }
drivers/usb/host/ehci-sched.c +1 -0
@@ -542,6 +542,7 @@ static int qh_link_periodic (struct ehci } } qh->qh_state =QH_STATE_LINKED ; + qh->xacterrs =0 ;qh_get (qh);/* update per-qh bandwidth for usbfs */
PATCH 26/45 KVM: x86 emulator: limit instructions to 15 bytes
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
commit eb3c79e64a70fb8f7473e30fa07e89c1ecc2c9bb upstream
[ <[email protected]>: backport to 2.6.27 ]
While we are never normally passed an instruction that exceeds 15 bytes, smp games can cause us to attempt to interpret one, which will cause large latencies in non-preempt hosts.
--- arch/x86/kvm/x86_emulate.c | 5 ++++- include/asm-x86/kvm_x86_emulate.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
arch/x86/kvm/x86_emulate.c +4 -1
@@ -581,6 +581,9 @@ static int do_insn_fetch(struct x86_emul {int rc =0 ; +/* x86 instructions are limited to 15 bytes. */ +if (eip + size - ctxt->decode.eip_orig >15 ) +return X86EMUL_UNHANDLEABLE ; eip += ctxt->cs_base;while (size--) { rc =do_fetch_insn_byte (ctxt, ops, eip++, dest++);
@@ -839,7 +842,7 @@ x86_decode_insn(struct x86_emulate_ctxt/* Shadow copy of register state. Committed on successful emulation. */ memset (c,0 ,sizeof (struct decode_cache )); - c->eip = ctxt->vcpu->arch.rip; + c->eip = c->eip_orig = ctxt->vcpu->arch.rip; ctxt->cs_base =seg_base (ctxt,VCPU_SREG_CS );memcpy (c->regs, ctxt->vcpu->arch.regs,sizeof c->regs);
include/asm-x86/kvm_x86_emulate.h +1 -1
@@ -128,7 +128,7 @@ struct decode_cache {u8 seg_override;unsigned int d;unsigned long regs[NR_VCPU_REGS ]; -unsigned long eip; +unsigned long eip, eip_orig;/* modrm */ u8 modrm;u8 modrm_mod;
PATCH 27/45 ext4: Avoid null pointer dereference when decoding EROFS w/o a journal
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Theodore Ts'o <[email protected]>
commit 78f1ddbb498283c2445c11b0dfa666424c301803 upstream.
We need to check to make sure a journal is present before checking the journal flags in ext4_decode_error().
--- fs/ext4/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/super.c +2 -1
@@ -254,7 +254,8 @@ static const char *ext4_decode_error(str errstr ="Out of memory" ;break ;case -EROFS : -if (!sb ||EXT4_SB (sb)->s_journal->j_flags &JBD2_ABORT ) +if (!sb || (EXT4_SB (sb)->s_journal && +EXT4_SB (sb)->s_journal->j_flags &JBD2_ABORT )) errstr ="Journal has aborted" ;else errstr ="Readonly filesystem" ;
PATCH 28/45 KVM: VMX: Check cpl before emulating debug register access
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Avi Kivity <[email protected]>
commit 0a79b009525b160081d75cef5dbf45817956acf2 upstream.
Debug registers may only be accessed from cpl 0. Unfortunately, vmx will code to emulate the instruction even though it was issued from guest userspace, possibly leading to an unexpected trap later.
--- arch/x86/kvm/vmx.c | 3 +++ arch/x86/kvm/x86.c | 13 +++++++++++++ include/asm-x86/kvm_host.h | 1 + 3 files changed, 17 insertions(+)
arch/x86/kvm/vmx.c +3 -0
@@ -2464,6 +2464,9 @@ static int handle_dr(struct kvm_vcpu *vcunsigned long val;int dr, reg; +if (!kvm_require_cpl (vcpu,0 )) +return 1 ; +/* * FIXME: this code assumes the host is debugging the guest. * need to deal with guest debugging itself too.
arch/x86/kvm/x86.c +13 -0
@@ -198,6 +198,19 @@ static void __queue_exception(struct kvm }/* +* Checks if cpl <= required_cpl; if true, return true. Otherwise queue +* a #GP and return false. +*/ +bool kvm_require_cpl (struct kvm_vcpu *vcpu,int required_cpl) +{ +if (kvm_x86_ops->get_cpl (vcpu) <= required_cpl) +return true; +kvm_queue_exception_e (vcpu,GP_VECTOR ,0 ); +return false; +} +EXPORT_SYMBOL_GPL (kvm_require_cpl); + +/* * Load the pae pdptrs. Return true is they are all valid. */ int load_pdptrs (struct kvm_vcpu *vcpu,unsigned long cr3)
include/asm-x86/kvm_host.h +1 -0
@@ -537,6 +537,7 @@ void kvm_queue_exception(struct kvm_vcpuvoid kvm_queue_exception_e (struct kvm_vcpu *vcpu,unsigned nr,u32 error_code);void kvm_inject_page_fault (struct kvm_vcpu *vcpu,unsigned long cr2,u32 error_code); +bool kvm_require_cpl (struct kvm_vcpu *vcpu,int required_cpl);void kvm_inject_nmi (struct kvm_vcpu *vcpu);
PATCH 29/45 drm/r128: Add test for initialisation to all ioctls that require it
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit 7dc482dfeeeefcfd000d4271c4626937406756d7 upstream.
Almost all r128's private ioctls require that the CCE state has already been initialised. However, most do not test that this has been done, and will proceed to dereference a null pointer. This may result in a security vulnerability, since some ioctls are unprivileged.
This adds a macro for the common initialisation test and changes all ioctl implementations that require prior initialisation to use that macro.
Also, r128_do_init_cce() does not test that the CCE state has not been initialised already. Repeated initialisation may lead to a crash or resource leak. This adds that test.
--- drivers/gpu/drm/r128/r128_cce.c | 18 ++++++++++++++---- drivers/gpu/drm/r128/r128_drv.h | 8 ++++++++ drivers/gpu/drm/r128/r128_state.c | 36 +++++++++++++++++++----------------- 3 files changed, 41 insertions(+), 21 deletions(-)
drivers/gpu/drm/r128/r128_cce.c +14 -4
@@ -353,6 +353,11 @@ static int r128_do_init_cce(struct drm_dDRM_DEBUG ("\n" ); +if (dev->dev_private) { +DRM_DEBUG ("called when already initialized\n" ); +return -EINVAL ; + } + dev_priv =drm_alloc (sizeof (drm_r128_private_t),DRM_MEM_DRIVER );if (dev_priv ==NULL )return -ENOMEM ;
@@ -651,6 +656,8 @@ int r128_cce_start(struct drm_device *deLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +if (dev_priv->cce_running || dev_priv->cce_mode ==R128_PM4_NONPM4 ) {DRM_DEBUG ("while CCE running\n" );return 0 ;
@@ -673,6 +680,8 @@ int r128_cce_stop(struct drm_device *devLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +/* Flush any pending CCE commands. This ensures any outstanding * commands are exectuted by the engine before we turn it off. */
@@ -710,10 +719,7 @@ int r128_cce_reset(struct drm_device *deLOCK_TEST_WITH_RETURN (dev, file_priv); -if (!dev_priv) { -DRM_DEBUG ("called before init done\n" ); -return -EINVAL ; - } +DEV_INIT_TEST_WITH_RETURN (dev_priv);r128_do_cce_reset (dev_priv);
@@ -730,6 +736,8 @@ int r128_cce_idle(struct drm_device *devLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +if (dev_priv->cce_running) {r128_do_cce_flush (dev_priv); }
@@ -743,6 +751,8 @@ int r128_engine_reset(struct drm_deviceLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev->dev_private); +return r128_do_engine_reset (dev); }
drivers/gpu/drm/r128/r128_drv.h +8 -0
@@ -418,6 +418,14 @@ static __inline__ void r128_update_ring_* Misc helper macros */ +#define DEV_INIT_TEST_WITH_RETURN (_dev_priv) \ +do { \ + if (!_dev_priv) { \ + DRM_ERROR("called with no initialization\n"); \ + return -EINVAL; \ + } \ +} while (0) +#define RING_SPACE_TEST_WITH_RETURN ( dev_priv ) \ do { \ drm_r128_ring_buffer_t *ring = &dev_priv->ring; int i; \
drivers/gpu/drm/r128/r128_state.c +19 -17
@@ -1244,14 +1244,18 @@ static void r128_cce_dispatch_stipple(ststatic int r128_cce_clear (struct drm_device *dev,void *data,struct drm_file *file_priv) {drm_r128_private_t *dev_priv = dev->dev_private; -drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; +drm_r128_sarea_t *sarea_priv;drm_r128_clear_t *clear = data;DRM_DEBUG ("\n" );LOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +RING_SPACE_TEST_WITH_RETURN (dev_priv); + sarea_priv = dev_priv->sarea_priv; +if (sarea_priv->nbox >R128_NR_SAREA_CLIPRECTS ) sarea_priv->nbox =R128_NR_SAREA_CLIPRECTS ;
@@ -1312,6 +1316,8 @@ static int r128_cce_flip(struct drm_deviLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +RING_SPACE_TEST_WITH_RETURN (dev_priv);if (!dev_priv->page_flipping)
@@ -1331,6 +1337,8 @@ static int r128_cce_swap(struct drm_deviLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +RING_SPACE_TEST_WITH_RETURN (dev_priv);if (sarea_priv->nbox >R128_NR_SAREA_CLIPRECTS )
@@ -1354,10 +1362,7 @@ static int r128_cce_vertex(struct drm_deLOCK_TEST_WITH_RETURN (dev, file_priv); -if (!dev_priv) { -DRM_ERROR ("called with no initialization\n" ); -return -EINVAL ; - } +DEV_INIT_TEST_WITH_RETURN (dev_priv);DRM_DEBUG ("pid=%d index=%d count=%d discard=%d\n" ,DRM_CURRENTPID , vertex->idx, vertex->count, vertex->discard);
@@ -1410,10 +1415,7 @@ static int r128_cce_indices(struct drm_dLOCK_TEST_WITH_RETURN (dev, file_priv); -if (!dev_priv) { -DRM_ERROR ("called with no initialization\n" ); -return -EINVAL ; - } +DEV_INIT_TEST_WITH_RETURN (dev_priv);DRM_DEBUG ("pid=%d buf=%d s=%d e=%d d=%d\n" ,DRM_CURRENTPID , elts->idx, elts->start, elts->end, elts->discard);
@@ -1476,6 +1478,8 @@ static int r128_cce_blit(struct drm_deviLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +DRM_DEBUG ("pid=%d index=%d\n" ,DRM_CURRENTPID , blit->idx);if (blit->idx <0 || blit->idx >= dma->buf_count) {
@@ -1501,6 +1505,8 @@ static int r128_cce_depth(struct drm_devLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +RING_SPACE_TEST_WITH_RETURN (dev_priv); ret = -EINVAL ;
@@ -1531,6 +1537,8 @@ static int r128_cce_stipple(struct drm_dLOCK_TEST_WITH_RETURN (dev, file_priv); +DEV_INIT_TEST_WITH_RETURN (dev_priv); +if (DRM_COPY_FROM_USER (&mask, stipple->mask,32 *sizeof (u32)))return -EFAULT ;
@@ -1555,10 +1563,7 @@ static int r128_cce_indirect(struct drm_LOCK_TEST_WITH_RETURN (dev, file_priv); -if (!dev_priv) { -DRM_ERROR ("called with no initialization\n" ); -return -EINVAL ; - } +DEV_INIT_TEST_WITH_RETURN (dev_priv); DRM_DEBUG("idx=%d s=%d e=%d d=%d\n", indirect->idx, indirect->start, indirect->end,
@@ -1620,10 +1625,7 @@ static int r128_getparam(struct drm_devidrm_r128_getparam_t *param = data;int value; -if (!dev_priv) { -DRM_ERROR ("called with no initialization\n" ); -return -EINVAL ; - } +DEV_INIT_TEST_WITH_RETURN (dev_priv);DRM_DEBUG ("pid=%d\n" ,DRM_CURRENTPID );
PATCH 30/45 tc: Fix unitialized kernel memory leak
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
commit 16ebb5e0b36ceadc8186f71d68b0c4fa4b6e781b upstream.
Three bytes of uninitialized kernel memory are currently leaked to user
--- net/sched/sch_api.c | 2 ++ 1 file changed, 2 insertions(+)
net/sched/sch_api.c +2 -0
@@ -1453,6 +1453,8 @@ static int tc_fill_tclass(struct sk_buff nlh =NLMSG_NEW (skb, pid, seq, event,sizeof (*tcm), flags); tcm =NLMSG_DATA (nlh); tcm->tcm_family =AF_UNSPEC ; + tcm->tcm__pad1 =0 ; + tcm->tcm__pad2 =0 ; tcm->tcm_ifindex =qdisc_dev (q)->ifindex; tcm->tcm_parent = q->handle; tcm->tcm_handle = q->handle;
PATCH 31/45 parisc: isa-eeprom - Fix loff_t usage
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Buesch <[email protected]>
commit 6b4dbcd86a9d464057fcc7abe4d0574093071fcc upstream.
loff_t is a signed type. If userspace passes a negative ppos, the "count" range check is weakened. "count"s bigger than HPEE_MAX_LENGTH will pass the check. Also, if ppos is negative, the readb(eisa_eeprom_addr + *ppos) will poke in random memory.
--- drivers/parisc/eisa_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/eisa_eeprom.c +1 -1
@@ -55,7 +55,7 @@ static ssize_t eisa_eeprom_read(struct fssize_t ret;int i; -if (*ppos >=HPEE_MAX_LENGTH ) +if (*ppos <0 || *ppos >=HPEE_MAX_LENGTH )return 0 ; count = *ppos + count <HPEE_MAX_LENGTH ? count :HPEE_MAX_LENGTH - *ppos;
PATCH 32/45 KVM: x86: check for cr3 validity in ioctl_set_sregs
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marcelo Tosatti <[email protected]>
commit 59839dfff5eabca01cc4e20b45797a60a80af8cb upstream.
Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity checking for the new cr3 value:
"Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to the kernel. This will trigger a NULL pointer access in gfn_to_rmap() when userspace next tries to call KVM_RUN on the affected VCPU and kvm attempts to activate the new non-existent page table root.
This happens since kvm only validates that cr3 points to a valid guest physical memory page when code *inside* the guest sets cr3. However, kvm currently trusts the userspace caller (e.g. QEMU) on the host machine to always supply a valid page table root, rather than properly validating it along with the rest of the reloaded guest state."
http://sourceforge.net/tracker/?func=detail&atid=893831&aid=2687641&group_id=180599
Check for a valid cr3 address in kvm_arch_vcpu_ioctl_set_sregs, triple fault in case of failure.
--- arch/x86/kvm/x86.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/x86/kvm/x86.c +7 -1
@@ -3658,7 +3658,13 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct vcpu->arch.cr2 = sregs->cr2; mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3; - vcpu->arch.cr3 = sregs->cr3; + +down_read (&vcpu->kvm->slots_lock); +if (gfn_to_memslot (vcpu->kvm, sregs->cr3 >>PAGE_SHIFT )) + vcpu->arch.cr3 = sregs->cr3; +else +set_bit (KVM_REQ_TRIPLE_FAULT , &vcpu->requests); +up_read (&vcpu->kvm->slots_lock);kvm_set_cr8 (vcpu, sregs->cr8);
PATCH 33/45 fix LOOKUP_FOLLOW on automount "symlinks"
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Al Viro <[email protected]>
commit ac278a9c505092dd82077a2446af8f9fc0d9c095 upstream.
Make sure that automount "symlinks" are followed regardless of LOOKUP_FOLLOW; it should have no effect on them.
--- fs/namei.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
fs/namei.c +12 -2
@@ -841,6 +841,17 @@ fail: }/* +* This is a temporary kludge to deal with "automount" symlinks; proper +* solution is to trigger them on follow_mount(), so that do_lookup() +* would DTRT. To be killed before 2.6.34-final. +*/ +static inline int follow_on_final (struct inode *inode,unsigned lookup_flags) +{ +return inode &&unlikely (inode->i_op->follow_link) && + ((lookup_flags &LOOKUP_FOLLOW ) ||S_ISDIR (inode->i_mode)); +} + +/* * Name resolution. * This is the basic name resolution function, turning a pathname into * the final dentry. We expect 'base' to be positive and a directory.
@@ -984,8 +995,7 @@ last_component:if (err)break ; inode = next.dentry->d_inode; -if ((lookup_flags &LOOKUP_FOLLOW ) - && inode && inode->i_op && inode->i_op->follow_link) { +if (follow_on_final (inode, lookup_flags)) { err =do_follow_link (&next, nd);if (err) goto return_err;
PATCH 34/45 x86, ia32_aout: do not kill argument mapping
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit 318f6b228ba88a394ef560efc1bfe028ad5ae6b6 upstream.
Do not set current->mm->mmap to NULL in 32-bit emulation on 64-bit load_aout_binary after flush_old_exec as it would destroy already set brpm mapping with arguments.
Introduced by b6a2fea39318e43fee84fa7b0b90d68bed92d2ba
mm: variable length argument support
where the argument mapping in bprm was added.
[ hpa: this is a regression from 2.6.22... time to kill a.out? ]
LKML-Reference: <[email protected]>
--- arch/x86/ia32/ia32_aout.c | 1 - 1 file changed, 1 deletion(-)
arch/x86/ia32/ia32_aout.c +0 -1
@@ -324,7 +324,6 @@ static int load_aout_binary(struct linux current->mm->free_area_cache =TASK_UNMAPPED_BASE ; current->mm->cached_hole_size =0 ; - current->mm->mmap =NULL ;compute_creds (bprm); current->flags &= ~PF_FORKNOEXEC ;
PATCH 35/45 coredump: suppress uid comparison test if core output files are pipes
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Neil Horman <[email protected]>
commit 76595f79d76fbe6267a51b3a866a028d150f06d4 upstream.
Modify uid check in do_coredump so as to not apply it in the case of pipes.
This just got noticed in testing. The end of do_coredump validates the uid of the inode for the created file against the uid of the crashing process to ensure that no one can pre-create a core file with different ownership and grab the information contained in the core when they shouldn' tbe able to. This causes failures when using pipes for a core dumps if the crashing process is not root, which is the uid of the pipe when it is created.
The fix is simple. Since the check for matching uid's isn't relevant for pipes (a process can't create a pipe that the uermodehelper code will open anyway), we can just just skip it in the event ispipe is non-zero
Reverts a pipe-affecting change which was accidentally made in
: commit c46f739dd39db3b07ab5deb4e3ec81e1c04a91af
: Author: Ingo Molnar <[email protected]>
: AuthorDate: Wed Nov 28 13:59:18 2007 +0100
: Commit: Linus Torvalds <[email protected]>
: CommitDate: Wed Nov 28 10:58:01 2007 -0800
:
: vfs: coredumping fix
--- fs/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/exec.c +2 -1
@@ -1826,8 +1826,9 @@ int do_coredump(long signr, int exit_cod/* * Dont allow local users get cute and trick others to coredump * into their pre-created files: +* Note, this is not relevant for pipes */ -if (inode->i_uid != current->fsuid) +if (!ispipe && (inode->i_uid != current->fsuid)) goto close_fail;if (!file->f_op) goto close_fail;
PATCH 36/45 bonding: ignore updelay param when there is no active slave
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Pirko <[email protected]>
commit 41f8910040639eb106b1a5b5301aab79ecde4940 upstream.
Pointed out by Sean E. Millichamp.
Quote from Documentation/networking/bonding.txt:
"Note that when a bonding interface has no active links, the driver will immediately reuse the first link that goes up, even if the updelay parameter has been specified (the updelay is ignored in this case). If there are slave interfaces waiting for the updelay timeout to expire, the interface that first went into that state will be immediately reused. This reduces down time of the network if the value of updelay has been overestimated, and since this occurs only in cases with no connectivity, there is no additional penalty for ignoring the updelay."
This patch actually changes the behaviour in this way.
--- drivers/net/bonding/bond_main.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/bonding/bond_main.c +8 -0
@@ -2228,6 +2228,9 @@ static int bond_miimon_inspect(struct bo {struct slave *slave;int i, link_state, commit =0 ; +bool ignore_updelay; + + ignore_updelay = !bond->curr_active_slave ? true : false;bond_for_each_slave (bond, slave, i) { slave->new_link =BOND_LINK_NOCHANGE ;
@@ -2292,6 +2295,7 @@ static int bond_miimon_inspect(struct bo": %s: link status up for " "interface %s, enabling it in %d ms.\n" , bond->dev->name, slave->dev->name, + ignore_updelay ?0 : bond->params.updelay * bond->params.miimon); }
@@ -2310,9 +2314,13 @@ static int bond_miimon_inspect(struct bocontinue ; } +if (ignore_updelay) + slave->delay =0 ; +if (slave->delay <=0 ) { slave->new_link =BOND_LINK_UP ; commit++; + ignore_updelay = false;continue ; }
PATCH 37/45 V4L/DVB (13961): em28xx-dvb: fix memleak in dvb_fini()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Francesco Lavra <[email protected]>
commit 19f48cb105b7fa18d0dcab435919a3a29b7a7c4c upstream.
this patch fixes a memory leak which occurs when an em28xx card with DVB extension is unplugged or its DVB extension driver is unloaded. In dvb_fini(), dev->dvb must be freed before being set to NULL, as is done in dvb_init() in case of error.
Note that this bug is also present in the latest stable kernel release.
--- drivers/media/video/em28xx/em28xx-dvb.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/video/em28xx/em28xx-dvb.c +1 -0
@@ -501,6 +501,7 @@ static int dvb_fini(struct em28xx *dev)if (dev->dvb) {unregister_dvb (dev->dvb); +kfree (dev->dvb); dev->dvb =NULL ; }
PATCH 38/45 b44 WOL setup: one-bit-off stack corruption kernel panic fix
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stanislav Brabec <[email protected]>
commit e0188829cb724e7d12a2d4e343b368ff1d6e1471 upstream.
About 50% of shutdowns of b44 Ethernet adapter ends by kernel panic with kernels compiled with stack-protector.
Checking b44_magic_pattern() return values, one call of b44_magic_pattern() returns 127. It means, that set_bit(128, pmask) was called on line 1509. It means that bit 0 of 17th byte of pmask was overwritten. But pmask has only 16 bytes. Stack corruption happens.
It seems that set_bit() on line 1509 always writes one bit off.
The fix does not only solve the stack corruption, but also makes Wake On LAN working on my onboard B44 on Asus A7V-333X mainboard.
It seems that this problem affects all kernel versions since commit 725ad800 ([PATCH] b44: add wol for old nic) on 2006-06-20.
--- drivers/net/b44.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/b44.c +1 -2
@@ -1502,8 +1502,7 @@ static int b44_magic_pattern(u8 *macaddrfor (k =0 ; k< ethaddr_bytes; k++) { ppattern[offset + magicsync + (j *ETH_ALEN ) + k] = macaddr[k]; - len++; -set_bit (len, (unsigned long *) pmask); +set_bit (len++, (unsigned long *) pmask); } }return len -1 ;
PATCH 39/45 tmpfs: fix oops on mounts with mpol=default
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ravikiran G Thirumalai <[email protected]>
commit 413b43deab8377819aba1dbad2abf0c15d59b491 upstream.
Fix an 'oops' when a tmpfs mount point is mounted with the mpol=default mempolicy.
Upon remounting a tmpfs mount point with 'mpol=default' option, the mount code crashed with a null pointer dereference. The initial problem report was on 2.6.27, but the problem exists in mainline 2.6.34-rc as well. On examining the code, we see that mpol_new returns NULL if default mempolicy was requested. This 'NULL' mempolicy is accessed to store the node mask resulting in oops.
The following patch fixes it.
--- mm/mempolicy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
mm/mempolicy.c +7 -2
@@ -2049,10 +2049,15 @@ int mpol_parse_str(char *str, struct mem goto out; mode =MPOL_PREFERRED ;break ; - +case MPOL_DEFAULT : +/* +* Insist on a empty nodelist +*/ +if (!nodelist) + err =0 ; + goto out;/* * case MPOL_BIND: mpol_new() enforces non-empty nodemask. -* case MPOL_DEFAULT: mpol_new() enforces empty nodemask, ignores flags. */ }
PATCH 40/45 tmpfs: mpol=bind:0 dont cause mount error.
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit d69b2e63e9172afb4d07c305601b79a55509ac4c upstream.
Currently, following mount operation cause mount error.
% mount -t tmpfs -ompol=bind:0 none /tmp
Because commit 71fe804b6d5 (mempolicy: use struct mempolicy pointer in shmem_sb_info) corrupted MPOL_BIND parse code.
This patch restore the needed one.
--- mm/mempolicy.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
mm/mempolicy.c +7 -3
@@ -2056,9 +2056,13 @@ int mpol_parse_str(char *str, struct memif (!nodelist) err =0 ; goto out; -/* -* case MPOL_BIND: mpol_new() enforces non-empty nodemask. -*/ +case MPOL_BIND : +/* +* Insist on a nodelist +*/ +if (!nodelist) + goto out; + err =0 ; } mode_flags =0 ;
PATCH 41/45 tmpfs: handle MPOL_LOCAL mount option properly
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 12821f5fb942e795f8009ece14bde868893bd811 upstream.
commit 71fe804b6d5 (mempolicy: use struct mempolicy pointer in shmem_sb_info) added mpol=local mount option. but its feature is broken since it was born. because such code always return 1 (i.e. mount failure).
This patch fixes it.
--- mm/mempolicy.c | 1 + 1 file changed, 1 insertion(+)
mm/mempolicy.c +1 -0
@@ -2048,6 +2048,7 @@ int mpol_parse_str(char *str, struct memif (nodelist) goto out; mode =MPOL_PREFERRED ; + err =0 ;break ;case MPOL_DEFAULT :/*
PATCH 42/45 doc: add the documentation for mpol=local
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 5574169613b40b85d6f4c67208fa4846b897a0a1 upstream.
commit 3f226aa1c (mempolicy: support mpol=local tmpfs mount option) added new mpol=local mount option. but it didn't add a documentation.
This patch does it.
--- Documentation/filesystems/tmpfs.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/filesystems/tmpfs.txt +5 -1
@@ -82,11 +82,13 @@ tmpfs has a mount option to set the NUMA all files in that instance (if CONFIG_NUMA is enabled) - which can be adjusted on the fly via 'mount -o remount ...' -mpol=default prefers to allocate memory from the local node +mpol=default use the process allocation policy + (see set_mempolicy(2)) mpol=prefer:Node prefers to allocate memory from the given Node mpol=bind:NodeList allocates memory only from nodes in NodeList mpol=interleave prefers to allocate from each node in turn mpol=interleave:NodeList allocates from each node of NodeList in turn +mpol=local prefers to allocate memory from the local node NodeList format is a comma-separated list of decimal numbers and ranges, a range being two hyphen-separated decimal numbers, the smallest and
@@ -134,3 +136,5 @@ Author: Christoph Rohland <[email protected]>, 1.12.01 Updated: Hugh Dickins <[email protected]>, 4 June 2007 +Updated: + KOSAKI Motohiro, 16 Mar 2010
PATCH 43/45 tmpfs: cleanup mpol_parse_str()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 926f2ae04f183098cf9a30521776fb2759c8afeb upstream.
mpol_parse_str() made lots 'err' variable related bug. Because it is ugly and reviewing unfriendly.
This patch simplifies it.
--- mm/mempolicy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
mm/mempolicy.c +9 -9
@@ -2029,8 +2029,8 @@ int mpol_parse_str(char *str, struct memchar *rest = nodelist;while (isdigit (*rest)) rest++; -if (!*rest) - err =0 ; +if (*rest) + goto out; }break ;case MPOL_INTERLEAVE :
@@ -2039,7 +2039,6 @@ int mpol_parse_str(char *str, struct mem*/ if (!nodelist) nodes = node_states[N_HIGH_MEMORY ]; - err =0 ;break ;case MPOL_LOCAL :/*
@@ -2048,7 +2047,6 @@ int mpol_parse_str(char *str, struct memif (nodelist) goto out; mode =MPOL_PREFERRED ; - err =0 ;break ;case MPOL_DEFAULT :/*
@@ -2063,7 +2061,6 @@ int mpol_parse_str(char *str, struct mem*/ if (!nodelist) goto out; - err =0 ; } mode_flags =0 ;
@@ -2077,14 +2074,17 @@ int mpol_parse_str(char *str, struct memelse if (!strcmp (flags,"relative" )) mode_flags |=MPOL_F_RELATIVE_NODES ;else - err =1 ; + goto out; } new =mpol_new (mode, mode_flags, &nodes);if (IS_ERR (new)) - err =1 ; -else if (no_context) - new->w.user_nodemask = nodes;/* save for contextualization */ + goto out; + err =0 ; +if (no_context) { +/* save for contextualization */ + new->w.user_nodemask = nodes; + } out:/* Restore string for error message */
PATCH 44/45 USB: fix usbfs regression
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 7152b592593b9d48b33f8997b1dfd6df9143f7ec upstream.
This patch (as1352) fixes a bug in the way isochronous input data is returned to userspace for usbfs transfers. The entire buffer must be copied, not just the first actual_length bytes, because the individual packets will be discontiguous if any of them are short.
--- drivers/usb/core/devio.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/usb/core/devio.c +14 -3
@@ -1123,6 +1123,13 @@ static int proc_do_submiturb(struct dev_free_async (as);return -ENOMEM ; } +/* Isochronous input data may end up being discontiguous +* if some of the packets are short. Clear the buffer so +* that the gaps don't leak kernel data to userspace. +*/ +if (is_in && uurb->type ==USBDEVFS_URB_TYPE_ISO ) +memset (as->urb->transfer_buffer,0 , + uurb->buffer_length); } as->urb->dev = ps->dev; as->urb->pipe = (uurb->type << 30) |
@@ -1224,10 +1231,14 @@ static int processcompl(struct async *asvoid __user *addr = as->userurb;unsigned int i; -if (as->userbuffer && urb->actual_length) -if (copy_to_user (as->userbuffer, urb->transfer_buffer, - urb->actual_length)) +if (as->userbuffer && urb->actual_length) { +if (urb->number_of_packets >0 )/* Isochronous */ + i = urb->transfer_buffer_length; +else /* Non-Isoc */ + i = urb->actual_length; +if (copy_to_user (as->userbuffer, urb->transfer_buffer, i)) goto err_out; + }if (put_user (as->status, &userurb->status)) goto err_out;if (put_user (urb->actual_length, &userurb->actual_length))
PATCH 45/45 hwmon: (coretemp) Add missing newline to dev_warn() message
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dean Nelson <[email protected]>
commit 4d7a5644e4adfafe76c2bd8ee168e3f3b5dae3a8 upstream.
Add missing newline to dev_warn() message string. This is more of an issue with older kernels that don't automatically add a newline if it was missing from the end of the previous line.
--- drivers/hwmon/coretemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/coretemp.c +1 -1
@@ -191,7 +191,7 @@ static int __devinit adjust_tjmax(structif (err) {dev_warn (dev,"Unable to access MSR 0xEE, for Tjmax, left" -" at default" ); +" at default\n" ); }else if (eax &0x40000000 ) { tjmax =85000 ; }
Quoted 10 lines · Greg KH
Hi all,
Well, I up and moved cities and caused a bunch of stable patches to be backlogged. I've caught up with all of the ones that were marked as being wished to be applied to the stable trees, and still have a bunch of pending requests still queued up in my mailbox.
But, due to the number of the current patches already applied, it is time to just let these go and work on the other pending stuff after this.
Greg, I send a series of 19 patches for XFS updates to [email protected] back on the 12th March for 2.6.32 (subject was "[PATCH 0/19] xfs:
2.6.32.y stable tree updates").
The patches were cc'd to the XFS list and they made it there:
http://oss.sgi.com/archives/xfs/2010-03/msg00125.html
so I'm wondering if you've got them queued up or not or whether I need to resend them to you....
Quoted 4 lines
So don't worry, if anyone has asked for some patches to be applied to some stable trees, and you don't see it here, just give it some time, I'm still catching up on things (hey, I'm just happy I have an internet connection again...)
I sent these prior to the last stable release that had this same comment, so I didn't get worried that they had been missed. Now they are missing from the next stable release, I'm getting worried. :/
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 23 lines · Dave Chinner
Quoted 10 lines · Greg KH
Hi all,
Well, I up and moved cities and caused a bunch of stable patches to be backlogged. I've caught up with all of the ones that were marked as being wished to be applied to the stable trees, and still have a bunch of pending requests still queued up in my mailbox.
But, due to the number of the current patches already applied, it is time to just let these go and work on the other pending stuff after this.
Greg, I send a series of 19 patches for XFS updates to [email protected] back on the 12th March for 2.6.32 (subject was "[PATCH 0/19] xfs:
2.6.32.y stable tree updates").The patches were cc'd to the XFS list and they made it there:
http://oss.sgi.com/archives/xfs/2010-03/msg00125.html
so I'm wondering if you've got them queued up or not or whether I need to resend them to you....
Quoted 8 lines
Quoted 4 lines
So don't worry, if anyone has asked for some patches to be applied to some stable trees, and you don't see it here, just give it some time, I'm still catching up on things (hey, I'm just happy I have an internet connection again...)
I sent these prior to the last stable release that had this same comment, so I didn't get worried that they had been missed. Now they are missing from the next stable release, I'm getting worried. :/
Yes, they are still in my "to-apply" queue. I also have a series of ext4 and kvm patches as well as a mess of wireless patches to wade through, so you are in good company.
The issue is that applying individual patches like this is more "difficult" than just handling patches that are already marked in Linus's kernel tree as to be added to the stable queues. So it takes a bit more time and effort to get to those patches, while still keeping up with the series like you, and other developers, sent.
Combine that with packing up my house and moving a few hundred miles away, loosing internet access for over a week, and trying to catch up with the patches that accumulated during that time, and we ended up with these already-large stable releases that I figured was better to get out now, than wait a few days to add a few hundred more patches to them.
So I will get to these patches, don't worry, hopefully my self-inflicted mess of moving will calm down soon and I will catch up with the backlog.
thanks,
greg k-h
Quoted 29 lines · Greg KH
Quoted 28 lines · Dave Chinner
Quoted 10 lines · Greg KH
Hi all,
Well, I up and moved cities and caused a bunch of stable patches to be backlogged. I've caught up with all of the ones that were marked as being wished to be applied to the stable trees, and still have a bunch of pending requests still queued up in my mailbox.
But, due to the number of the current patches already applied, it is time to just let these go and work on the other pending stuff after this.
Greg, I send a series of 19 patches for XFS updates to [email protected] back on the 12th March for 2.6.32 (subject was "[PATCH 0/19] xfs:
2.6.32.y stable tree updates").The patches were cc'd to the XFS list and they made it there:
http://oss.sgi.com/archives/xfs/2010-03/msg00125.html
so I'm wondering if you've got them queued up or not or whether I need to resend them to you....
Quoted 4 lines
So don't worry, if anyone has asked for some patches to be applied to some stable trees, and you don't see it here, just give it some time, I'm still catching up on things (hey, I'm just happy I have an internet connection again...)
Quoted 7 lines
Quoted 3 lines
I sent these prior to the last stable release that had this same comment, so I didn't get worried that they had been missed. Now they are missing from the next stable release, I'm getting worried. :/
Yes, they are still in my "to-apply" queue. I also have a series of ext4 and kvm patches as well as a mess of wireless patches to wade through, so you are in good company.
Ok, I just wanted to make sure they were in the queue and not some bit bucket somewhere.
Quoted 6 lines
The issue is that applying individual patches like this is more "difficult" than just handling patches that are already marked in Linus's kernel tree as to be added to the stable queues. So it takes a bit more time and effort to get to those patches, while still keeping up with the series like you, and other developers, sent.
Understood. Would providing a git tree to pull from for large series like the XFS one make this easier for you in future? I can do that bit of extra work if that makes things easier for you...
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 48 lines · Dave Chinner
Quoted 29 lines · Greg KH
Quoted 28 lines · Dave Chinner
Quoted 10 lines · Greg KH
Hi all,
Well, I up and moved cities and caused a bunch of stable patches to be backlogged. I've caught up with all of the ones that were marked as being wished to be applied to the stable trees, and still have a bunch of pending requests still queued up in my mailbox.
But, due to the number of the current patches already applied, it is time to just let these go and work on the other pending stuff after this.
Greg, I send a series of 19 patches for XFS updates to [email protected] back on the 12th March for 2.6.32 (subject was "[PATCH 0/19] xfs:
2.6.32.y stable tree updates").The patches were cc'd to the XFS list and they made it there:
http://oss.sgi.com/archives/xfs/2010-03/msg00125.html
so I'm wondering if you've got them queued up or not or whether I need to resend them to you....
Quoted 4 lines
So don't worry, if anyone has asked for some patches to be applied to some stable trees, and you don't see it here, just give it some time, I'm still catching up on things (hey, I'm just happy I have an internet connection again...)
Quoted 7 lines
Quoted 3 lines
I sent these prior to the last stable release that had this same comment, so I didn't get worried that they had been missed. Now they are missing from the next stable release, I'm getting worried. :/
Yes, they are still in my "to-apply" queue. I also have a series of ext4 and kvm patches as well as a mess of wireless patches to wade through, so you are in good company.
Ok, I just wanted to make sure they were in the queue and not some bit bucket somewhere.
Quoted 6 lines
The issue is that applying individual patches like this is more "difficult" than just handling patches that are already marked in Linus's kernel tree as to be added to the stable queues. So it takes a bit more time and effort to get to those patches, while still keeping up with the series like you, and other developers, sent.
Quoted 3 lines
Understood. Would providing a git tree to pull from for large series like the XFS one make this easier for you in future? I can do that bit of extra work if that makes things easier for you...
No, patches are still easier, I would have to convert the git tree to patches anyway, so for now, this is fine.
thanks,
greg k-h
Quoted 9 lines · Greg KH
Quoted 8 lines · Dave Chinner
Quoted 6 lines · Greg KH
The issue is that applying individual patches like this is more "difficult" than just handling patches that are already marked in Linus's kernel tree as to be added to the stable queues. So it takes a bit more time and effort to get to those patches, while still keeping up with the series like you, and other developers, sent.
Quoted 6 lines
Quoted 3 lines
Understood. Would providing a git tree to pull from for large series like the XFS one make this easier for you in future? I can do that bit of extra work if that makes things easier for you...
No, patches are still easier, I would have to convert the git tree to patches anyway, so for now, this is fine.
I don't know for you, Greg, but one thing that I find time consuming when merging fixes that I'm not backporting is to try to find the commit ID of the equivalent mainline fix. And it's not specific to the kernel, I also have the same issue with other projects.
For this reason, IMHO it helps when submitters can indicate in each patch the mainline equivalent ID, or alternatively that it's pointless to look for it because the fix is much different.
Just my 2 cents,
Willy
David Miller
maintainerFrom: Willy Tarreau <[email protected]>
Date: Thu, 1 Apr 2010 06:40:48 +0200
Quoted 3 lines
For this reason, IMHO it helps when submitters can indicate in each patch the mainline equivalent ID, or alternatively that it's pointless to look for it because the fix is much different.
I put this at the top of every networking/ide/sparc commit message for -stable submissions I make.
In fact I thought that was a requirement for -stable submissions?
Quoted 11 lines · David Miller
From: Willy Tarreau <[email protected]>
Date: Thu, 1 Apr 2010 06:40:48 +0200Quoted 3 lines
For this reason, IMHO it helps when submitters can indicate in each patch the mainline equivalent ID, or alternatively that it's pointless to look for it because the fix is much different.
I put this at the top of every networking/ide/sparc commit message for -stable submissions I make.
In fact I thought that was a requirement for -stable submissions?
It is a documented requirement, perhaps not very clearly worded in The Submitter's Guide To Stable...
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=46cdf871d9970b9252469531f9efd4a17243bb0b
Signature · 3 lines
Stefan Richter -=====-==-=- -=-- ----= http://arcgraph.de/sr/
Quoted 8 lines · Stefan Richter
Quoted 7 lines · David Miller
From: Willy Tarreau <[email protected]>
Date: Thu, 1 Apr 2010 06:40:48 +0200Quoted 3 lines
For this reason, IMHO it helps when submitters can indicate in each patch the mainline equivalent ID, or alternatively that it's pointless to look for it because the fix is much different.
Quoted 8 lines
Quoted 4 lines
I put this at the top of every networking/ide/sparc commit message for -stable submissions I make.
In fact I thought that was a requirement for -stable submissions?
It is a documented requirement, perhaps not very clearly worded in The Submitter's Guide To Stable...
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=46cdf871d9970b9252469531f9efd4a17243bb0b
Patches always welcome to make that file easier to understand.
thanks,
greg k-h
PATCH 1/1 Documentation: -stable rules: upstream commit ID requirement reworded
It is a hard requirement to include the upstream commit ID in the changelog of a -stable submission, not just a courtesy to the stable team. This concerns only mail submission though, which is no longer the only way into stable. (Also, fix a double "the".)
--- Documentation/stable_kernel_rules.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Documentation/stable_kernel_rules.txt +4 -5
@@ -18,16 +18,15 @@ Rules on what kind of patches are accept - It cannot contain any "trivial" fixes in it (spelling changes, whitespace cleanups, etc). - It must follow the Documentation/SubmittingPatches rules. - - It or an equivalent fix must already exist in Linus' tree. Quote the - respective commit ID in Linus' tree in your patch submission to -stable. + - It or an equivalent fix must already exist in Linus' tree (upstream). Procedure for submitting patches to the -stable tree: - Send the patch, after verifying that it follows the above rules, to - [email protected]. - - To have the patch automatically included in the stable tree, add the - the tag + [email protected]. You must note the upstream commit ID in the changelog + of your submission. + - To have the patch automatically included in the stable tree, add the tag Cc: [email protected] in the sign-off area. Once the patch is merged it will be applied to the stable tree without anything else needing to be done by the author
Signature · 3 lines
Stefan Richter -=====-==-=- -=-- ----= http://arcgraph.de/sr/
Re: [PATCH] Documentation: -stable rules: upstream commit ID requirement reworded
Quoted 6 lines · On Thu, 1 Apr 2010 22:01:52 +0200 (CEST) Stefan Richter wrote:
It is a hard requirement to include the upstream commit ID in the changelog of a -stable submission, not just a courtesy to the stable team. This concerns only mail submission though, which is no longer the only way into stable. (Also, fix a double "the".)
Signed-off-by Stefan Richter <[email protected]>
Looks good to me. Thanks.
Quoted 19 lines
--- Documentation/stable_kernel_rules.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)Index:
b/Documentation/stable_kernel_rules.txt
===================================================================Documentation/stable_kernel_rules.txt +1
-2@@ -18,16 +18,15 @@ Rules on what kind of patches are accept - It cannot contain any "trivial" fixes in it (spelling changes, whitespace cleanups, etc). - It must follow the Documentation/SubmittingPatches rules. - - It or an equivalent fix must already exist in Linus' tree. Quote the - respective commit ID in Linus' tree in your patch submission to -stable. + - It or an equivalent fix must already exist in Linus' tree (upstream). Procedure for submitting patches to the -stable tree:
Documentation/stable_kernel_rules.txt Rules on what kind of patches are accept · line 32
Quoted 10 lines
Documentation/stable_kernel_rules.txt +3
-3- Send the patch, after verifying that it follows the above rules, to - [email protected]. - - To have the patch automatically included in the stable tree, add the - the tag + [email protected]. You must note the upstream commit ID in the changelog + of your submission. + - To have the patch automatically included in the stable tree, add the tag Cc: [email protected] in the sign-off area. Once the patch is merged it will be applied to the stable tree without anything else needing to be done by the author
---
~Randy
Quoted 11 lines · David Miller
From: Willy Tarreau <[email protected]>
Date: Thu, 1 Apr 2010 06:40:48 +0200Quoted 3 lines
For this reason, IMHO it helps when submitters can indicate in each patch the mainline equivalent ID, or alternatively that it's pointless to look for it because the fix is much different.
I put this at the top of every networking/ide/sparc commit message for -stable submissions I make.
In fact I thought that was a requirement for -stable submissions?
It is. Unfortunatly not everyone remembers it, and I have to go dig through the git tree to find the commit ids, which slows down the ability for their patches to get accepted.
The patches that include the git commit ids are trivial to get added to the tree, almost no extra work on my part.
thanks,
greg k-h