* [001/102] USB: serial: add IDs for WinChipHead USB->RS232 adapter
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [002/102] mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency Greg KH
` (100 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Wolfgang Denk
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wolfgang Denk <wd@denx.de>
commit 026dfaf18973404a01f488d6aa556a8c466e06a4 upstream.
Add ID 4348:5523 for WinChipHead USB->RS 232 adapter with
Prolifec PL2303 chipset
Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/serial/pl2303.c | 1 +
drivers/usb/serial/pl2303.h | 4 ++++
2 files changed, 5 insertions(+)
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -91,6 +91,7 @@ static const struct usb_device_id id_tab
{ USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
{ USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
{ USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
+ { USB_DEVICE(WINCHIPHEAD_VENDOR_ID, WINCHIPHEAD_USBSER_PRODUCT_ID) },
{ } /* Terminating entry */
};
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -144,3 +144,7 @@
/* ADLINK ND-6530 RS232,RS485 and RS422 adapter */
#define ADLINK_VENDOR_ID 0x0b63
#define ADLINK_ND6530_PRODUCT_ID 0x6530
+
+/* WinChipHead USB->RS 232 adapter */
+#define WINCHIPHEAD_VENDOR_ID 0x4348
+#define WINCHIPHEAD_USBSER_PRODUCT_ID 0x5523
^ permalink raw reply [flat|nested] 103+ messages in thread
* [002/102] mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
2011-08-03 22:00 ` [001/102] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [003/102] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get cleared Greg KH
` (99 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Manoj Iyer, Koji Matsumuro,
Jesse Barnes, Chris Ball
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Manoj Iyer <manoj.iyer@canonical.com>
commit 15bed0f2fa8e1d7db201692532c210a7823d2d21 upstream.
Ricoh 1180:e823 does not recognize certain types of SD/MMC cards,
as reported at http://launchpad.net/bugs/773524. Lowering the SD
base clock frequency from 200Mhz to 50Mhz fixes this issue. This
solution was suggest by Koji Matsumuro, Ricoh Company, Ltd.
This change has no negative performance effect on standard SD
cards, though it's quite possible that there will be one on
UHS-1 cards.
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Tested-by: Daniel Manrique <daniel.manrique@canonical.com>
Cc: Koji Matsumuro <matsumur@nts.ricoh.co.jp>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/pci/quirks.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2758,6 +2758,29 @@ static void ricoh_mmc_fixup_r5c832(struc
dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n");
dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n");
+
+ /*
+ * RICOH 0xe823 SD/MMC card reader fails to recognize
+ * certain types of SD/MMC cards. Lowering the SD base
+ * clock frequency from 200Mhz to 50Mhz fixes this issue.
+ *
+ * 0x150 - SD2.0 mode enable for changing base clock
+ * frequency to 50Mhz
+ * 0xe1 - Base clock frequency
+ * 0x32 - 50Mhz new clock frequency
+ * 0xf9 - Key register for 0x150
+ * 0xfc - key register for 0xe1
+ */
+ if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
+ pci_write_config_byte(dev, 0xf9, 0xfc);
+ pci_write_config_byte(dev, 0x150, 0x10);
+ pci_write_config_byte(dev, 0xf9, 0x00);
+ pci_write_config_byte(dev, 0xfc, 0x01);
+ pci_write_config_byte(dev, 0xe1, 0x32);
+ pci_write_config_byte(dev, 0xfc, 0x00);
+
+ dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.\n");
+ }
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [003/102] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get cleared
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
2011-08-03 22:00 ` [001/102] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
2011-08-03 22:00 ` [002/102] mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [004/102] bridge: send proper message_age in config BPDU Greg KH
` (98 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Shawn Guo, Wolfram Sang,
Chris Ball
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shawn Guo <shawn.guo@linaro.org>
commit 803862a6f7de4939e0a557214e5e4b37e36f87ff upstream.
The function esdhc_readl_le intends to clear bit SDHCI_CARD_PRESENT,
when the card detect gpio tells there is no card. But it does not
clear the bit actually. The patch gives a fix on that.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -74,7 +74,7 @@ static u32 esdhc_readl_le(struct sdhci_h
if (boarddata && gpio_is_valid(boarddata->cd_gpio)
&& gpio_get_value(boarddata->cd_gpio))
/* no card, if a valid gpio says so... */
- val &= SDHCI_CARD_PRESENT;
+ val &= ~SDHCI_CARD_PRESENT;
else
/* ... in all other cases assume card is present */
val |= SDHCI_CARD_PRESENT;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [004/102] bridge: send proper message_age in config BPDU
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (2 preceding siblings ...)
2011-08-03 22:00 ` [003/102] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get cleared Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [005/102] gro: Only reset frag0 when skb can be pulled Greg KH
` (97 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Stephen Hemminger,
David S. Miller
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: stephen hemminger <shemminger@vyatta.com>
commit 0c03150e7ea8f7fcd03cfef29385e0010b22ee92 upstream.
A bridge topology with three systems:
+------+ +------+
| A(2) |--| B(1) |
+------+ +------+
\ /
+------+
| C(3) |
+------+
What is supposed to happen:
* bridge with the lowest ID is elected root (for example: B)
* C detects that A->C is higher cost path and puts in blocking state
What happens. Bridge with lowest id (B) is elected correctly as
root and things start out fine initially. But then config BPDU
doesn't get transmitted from A -> C. Because of that
the link from A-C is transistioned to the forwarding state.
The root cause of this is that the configuration messages
is generated with bogus message age, and dropped before
sending.
In the standardmessage_age is supposed to be:
the time since the generation of the Configuration BPDU by
the Root that instigated the generation of this Configuration BPDU.
Reimplement this by recording the timestamp (age + jiffies) when
recording config information. The old code incorrectly used the time
elapsed on the ageing timer which was incorrect.
See also:
https://bugzilla.vyatta.com/show_bug.cgi?id=7164
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/bridge/br_private.h | 1 +
net/bridge/br_stp.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -124,6 +124,7 @@ struct net_bridge_port
bridge_id designated_bridge;
u32 path_cost;
u32 designated_cost;
+ unsigned long designated_age;
struct timer_list forward_delay_timer;
struct timer_list hold_timer;
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -164,8 +164,7 @@ void br_transmit_config(struct net_bridg
else {
struct net_bridge_port *root
= br_get_port(br, br->root_port);
- bpdu.message_age = br->max_age
- - (root->message_age_timer.expires - jiffies)
+ bpdu.message_age = (jiffies - root->designated_age)
+ MESSAGE_AGE_INCR;
}
bpdu.max_age = br->max_age;
@@ -189,6 +188,7 @@ static inline void br_record_config_info
p->designated_cost = bpdu->root_path_cost;
p->designated_bridge = bpdu->bridge_id;
p->designated_port = bpdu->port_id;
+ p->designated_age = jiffies + bpdu->message_age;
mod_timer(&p->message_age_timer, jiffies
+ (p->br->max_age - bpdu->message_age));
^ permalink raw reply [flat|nested] 103+ messages in thread
* [005/102] gro: Only reset frag0 when skb can be pulled
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (3 preceding siblings ...)
2011-08-03 22:00 ` [004/102] bridge: send proper message_age in config BPDU Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [006/102] Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread Greg KH
` (96 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Herbert Xu, David S. Miller
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 17dd759c67f21e34f2156abcf415e1f60605a188 upstream.
Currently skb_gro_header_slow unconditionally resets frag0 and
frag0_len. However, when we can't pull on the skb this leaves
the GRO fields in an inconsistent state.
This patch fixes this by only resetting those fields after the
pskb_may_pull test.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/linux/netdevice.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1688,9 +1688,12 @@ static inline int skb_gro_header_hard(st
static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
unsigned int offset)
{
+ if (!pskb_may_pull(skb, hlen))
+ return NULL;
+
NAPI_GRO_CB(skb)->frag0 = NULL;
NAPI_GRO_CB(skb)->frag0_len = 0;
- return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL;
+ return skb->data + offset;
}
static inline void *skb_gro_mac_header(struct sk_buff *skb)
^ permalink raw reply [flat|nested] 103+ messages in thread
* [006/102] Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (4 preceding siblings ...)
2011-08-03 22:00 ` [005/102] gro: Only reset frag0 when skb can be pulled Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [007/102] staging: r8192e_pci: Handle duplicate PCI ID 0x10ec:0x8192 conflict with rtl8192se Greg KH
` (95 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Tobias Klauser
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tobias Klauser <tklauser@distanz.ch>
commit 8547d4cc2b616e4f1dafebe2c673fc986422b506 upstream.
When unbinding a device on the host which was still attached on the
client, I got a NULL pointer dereference on the client. This turned out
to be due to kthread_stop() being called on an already dead kthread.
Here is how I was able to reproduce the problem:
server:# usbip bind -b 1-2
client:# usbip attach -h server -b 1-2
server:# usbip unbind -b 1-2
This patch fixes the problem by checking the kthread before attempting
to kill it, as it is done on the opposite side in
stub_shutdown_connection().
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/usbip/vhci_hcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -846,9 +846,9 @@ static void vhci_shutdown_connection(str
}
/* kill threads related to this sdev, if v.c. exists */
- if (vdev->ud.tcp_rx)
+ if (vdev->ud.tcp_rx && !task_is_dead(vdev->ud.tcp_rx))
kthread_stop(vdev->ud.tcp_rx);
- if (vdev->ud.tcp_tx)
+ if (vdev->ud.tcp_tx && !task_is_dead(vdev->ud.tcp_tx))
kthread_stop(vdev->ud.tcp_tx);
pr_info("stop threads\n");
^ permalink raw reply [flat|nested] 103+ messages in thread
* [007/102] staging: r8192e_pci: Handle duplicate PCI ID 0x10ec:0x8192 conflict with rtl8192se
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (5 preceding siblings ...)
2011-08-03 22:00 ` [006/102] Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [008/102] staging: comedi: fix infoleak to userspace Greg KH
` (94 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Larry Finger
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 1c50bf7e415cf6ce9545dbecc2ac0d89d3916c53 upstream.
There are two devices with PCI ID 0x10ec:0x8192, namely RTL8192E and
RTL8192SE. The method of distinguishing them is by the revision ID
at offset 0x8 of the PCI configuration space. If the value is 0x10,
then the device uses rtl8192se for a driver.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/rtl8192e/r8192E_core.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -4532,6 +4532,7 @@ static int __devinit rtl8192_pci_probe(s
u8 unit = 0;
int ret = -ENODEV;
unsigned long pmem_start, pmem_len, pmem_flags;
+ u8 revisionid;
RT_TRACE(COMP_INIT,"Configuring chip resources\n");
@@ -4592,6 +4593,11 @@ static int __devinit rtl8192_pci_probe(s
pci_write_config_byte(pdev, 0x41, 0x00);
+ pci_read_config_byte(pdev, 0x08, &revisionid);
+ /* If the revisionid is 0x10, the device uses rtl8192se. */
+ if (pdev->device == 0x8192 && revisionid == 0x10)
+ goto fail1;
+
pci_read_config_byte(pdev, 0x05, &unit);
pci_write_config_byte(pdev, 0x05, unit & (~0x04));
^ permalink raw reply [flat|nested] 103+ messages in thread
* [008/102] staging: comedi: fix infoleak to userspace
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (6 preceding siblings ...)
2011-08-03 22:00 ` [007/102] staging: r8192e_pci: Handle duplicate PCI ID 0x10ec:0x8192 conflict with rtl8192se Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [009/102] Staging: hv: storvsc: Increase the timeout value in the storvsc driver Greg KH
` (93 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Vasiliy Kulikov
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vasiliy Kulikov <segoon@openwall.com>
commit 819cbb120eaec7e014e5abd029260db1ca8c5735 upstream.
driver_name and board_name are pointers to strings, not buffers of size
COMEDI_NAMELEN. Copying COMEDI_NAMELEN bytes of a string containing
less than COMEDI_NAMELEN-1 bytes would leak some unrelated bytes.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/comedi/comedi_fops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -383,8 +383,8 @@ static int do_devinfo_ioctl(struct comed
/* fill devinfo structure */
devinfo.version_code = COMEDI_VERSION_CODE;
devinfo.n_subdevs = dev->n_subdevices;
- memcpy(devinfo.driver_name, dev->driver->driver_name, COMEDI_NAMELEN);
- memcpy(devinfo.board_name, dev->board_name, COMEDI_NAMELEN);
+ strlcpy(devinfo.driver_name, dev->driver->driver_name, COMEDI_NAMELEN);
+ strlcpy(devinfo.board_name, dev->board_name, COMEDI_NAMELEN);
if (read_subdev)
devinfo.read_subdevice = read_subdev - dev->subdevices;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [009/102] Staging: hv: storvsc: Increase the timeout value in the storvsc driver
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (7 preceding siblings ...)
2011-08-03 22:00 ` [008/102] staging: comedi: fix infoleak to userspace Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [010/102] Staging: hv: vmbus: Increase the timeout value in the vmbus driver Greg KH
` (92 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, K. Y. Srinivasan,
Haiyang Zhang, Hank Janssen
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "K. Y. Srinivasan" <kys@microsoft.com>
commit 46d2eb6d82ef44be58ae192c35e8cd52485f02eb upstream.
On some loaded windows hosts, we have discovered that the host may not
respond to guest requests within the specified time (one second)
as evidenced by the guest timing out. Fix this problem by increasing
the timeout to 5 seconds.
It may be useful to apply this patch to the 3.0 kernel as well.
the 3.0 kernel as well.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/hv/storvsc.c | 8 ++++----
drivers/staging/hv/storvsc_drv.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -135,7 +135,7 @@ static int storvsc_channel_init(struct h
if (ret != 0)
goto cleanup;
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
goto cleanup;
@@ -163,7 +163,7 @@ static int storvsc_channel_init(struct h
if (ret != 0)
goto cleanup;
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
goto cleanup;
@@ -192,7 +192,7 @@ static int storvsc_channel_init(struct h
if (ret != 0)
goto cleanup;
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
goto cleanup;
@@ -222,7 +222,7 @@ static int storvsc_channel_init(struct h
if (ret != 0)
goto cleanup;
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
goto cleanup;
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -393,7 +393,7 @@ static int storvsc_host_reset(struct hv_
if (ret != 0)
goto cleanup;
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
goto cleanup;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [010/102] Staging: hv: vmbus: Increase the timeout value in the vmbus driver
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (8 preceding siblings ...)
2011-08-03 22:00 ` [009/102] Staging: hv: storvsc: Increase the timeout value in the storvsc driver Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [011/102] Staging: hv: netvsc: Increase the timeout value in the netvsc driver Greg KH
` (91 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, K. Y. Srinivasan,
Haiyang Zhang, Hank Janssen
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "K. Y. Srinivasan" <kys@microsoft.com>
commit 2dfde9644fe8c4a77f9c73f95b25d6300ca23b5d upstream.
On some loaded windows hosts, we have discovered that the host may not
respond to guest requests within the specified time (one second)
as evidenced by the guest timing out. Fix this problem by increasing
the timeout to 5 seconds.
It may be useful to apply this patch to the 3.0 kernel as well.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/hv/channel.c | 2 +-
drivers/staging/hv/channel_mgmt.c | 2 +-
drivers/staging/hv/connection.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -212,7 +212,7 @@ int vmbus_open(struct vmbus_channel *new
if (ret != 0)
goto Cleanup;
- t = wait_for_completion_timeout(&openInfo->waitevent, HZ);
+ t = wait_for_completion_timeout(&openInfo->waitevent, 5*HZ);
if (t == 0) {
err = -ETIMEDOUT;
goto errorout;
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -773,7 +773,7 @@ int vmbus_request_offers(void)
goto cleanup;
}
- t = wait_for_completion_timeout(&msginfo->waitevent, HZ);
+ t = wait_for_completion_timeout(&msginfo->waitevent, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
goto cleanup;
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -135,7 +135,7 @@ int vmbus_connect(void)
}
/* Wait for the connection response */
- t = wait_for_completion_timeout(&msginfo->waitevent, HZ);
+ t = wait_for_completion_timeout(&msginfo->waitevent, 5*HZ);
if (t == 0) {
spin_lock_irqsave(&vmbus_connection.channelmsg_lock,
flags);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [011/102] Staging: hv: netvsc: Increase the timeout value in the netvsc driver
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (9 preceding siblings ...)
2011-08-03 22:00 ` [010/102] Staging: hv: vmbus: Increase the timeout value in the vmbus driver Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [012/102] USB: OHCI: fix another regression for NVIDIA controllers Greg KH
` (90 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, K. Y. Srinivasan,
Haiyang Zhang, Hank Janssen
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "K. Y. Srinivasan" <kys@microsoft.com>
commit 5c5781b3f88567211ecaaada13431af15c8c6003 upstream.
On some loaded windows hosts, we have discovered that the host may not
respond to guest requests within the specified time (one second)
as evidenced by the guest timing out. Fix this problem by increasing
the timeout to 5 seconds.
It may be useful to apply this patch to the 3.0 kernel as well.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/hv/netvsc.c | 4 ++--
drivers/staging/hv/rndis_filter.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -270,7 +270,7 @@ static int netvsc_init_recv_buf(struct h
goto cleanup;
}
- t = wait_for_completion_timeout(&net_device->channel_init_wait, HZ);
+ t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
BUG_ON(t == 0);
@@ -513,7 +513,7 @@ static int netvsc_connect_vsp(struct hv_
if (ret != 0)
goto cleanup;
- t = wait_for_completion_timeout(&net_device->channel_init_wait, HZ);
+ t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -467,7 +467,7 @@ static int rndis_filter_query_device(str
if (ret != 0)
goto Cleanup;
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
goto Cleanup;
@@ -543,7 +543,7 @@ static int rndis_filter_set_packet_filte
if (ret != 0)
goto Cleanup;
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -1;
@@ -600,7 +600,7 @@ static int rndis_filter_init_device(stru
}
- t = wait_for_completion_timeout(&request->wait_event, HZ);
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [012/102] USB: OHCI: fix another regression for NVIDIA controllers
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (10 preceding siblings ...)
2011-08-03 22:00 ` [011/102] Staging: hv: netvsc: Increase the timeout value in the netvsc driver Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [013/102] USB: EHCI: go back to using the system clock for QH unlinks Greg KH
` (89 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit 6ea12a04d295235ed67010a09fdea58c949e3eb0 upstream.
The NVIDIA series of OHCI controllers continues to be troublesome. A
few people using the MCP67 chipset have reported that even with the
most recent kernels, the OHCI controller fails to handle new
connections and spams the system log with "unable to enumerate USB
port" messages. This is different from the other problems previously
reported for NVIDIA OHCI controllers, although it is probably related.
It turns out that the MCP67 controller does not like to be kept in the
RESET state very long. After only a few seconds, it decides not to
work any more. This patch (as1479) changes the PCI initialization
quirk code so that NVIDIA controllers are switched into the SUSPEND
state after 50 ms of RESET. With no interrupts enabled and all the
downstream devices reset, and thus unable to send wakeup requests,
this should be perfectly safe (even for non-NVIDIA hardware).
The removal code in ohci-hcd hasn't been changed; it will still leave
the controller in the RESET state. As a result, if someone unloads
ohci-hcd and then reloads it, the controller won't work again until
the system is rebooted. If anybody complains about this, the removal
code can be updated similarly.
This fixes Bugzilla #22052.
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/host/pci-quirks.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -35,6 +35,8 @@
#define OHCI_INTRSTATUS 0x0c
#define OHCI_INTRENABLE 0x10
#define OHCI_INTRDISABLE 0x14
+#define OHCI_FMINTERVAL 0x34
+#define OHCI_HCR (1 << 0) /* host controller reset */
#define OHCI_OCR (1 << 3) /* ownership change request */
#define OHCI_CTRL_RWC (1 << 9) /* remote wakeup connected */
#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */
@@ -497,6 +499,32 @@ static void __devinit quirk_usb_handoff_
/* reset controller, preserving RWC (and possibly IR) */
writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL);
+ readl(base + OHCI_CONTROL);
+
+ /* Some NVIDIA controllers stop working if kept in RESET for too long */
+ if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) {
+ u32 fminterval;
+ int cnt;
+
+ /* drive reset for at least 50 ms (7.1.7.5) */
+ msleep(50);
+
+ /* software reset of the controller, preserving HcFmInterval */
+ fminterval = readl(base + OHCI_FMINTERVAL);
+ writel(OHCI_HCR, base + OHCI_CMDSTATUS);
+
+ /* reset requires max 10 us delay */
+ for (cnt = 30; cnt > 0; --cnt) { /* ... allow extra time */
+ if ((readl(base + OHCI_CMDSTATUS) & OHCI_HCR) == 0)
+ break;
+ udelay(1);
+ }
+ writel(fminterval, base + OHCI_FMINTERVAL);
+
+ /* Now we're in the SUSPEND state with all devices reset
+ * and wakeups and interrupts disabled
+ */
+ }
/*
* disable interrupts
^ permalink raw reply [flat|nested] 103+ messages in thread
* [013/102] USB: EHCI: go back to using the system clock for QH unlinks
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (11 preceding siblings ...)
2011-08-03 22:00 ` [012/102] USB: OHCI: fix another regression for NVIDIA controllers Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [014/102] usb: musb: restore INDEX register in resume path Greg KH
` (88 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit 004c19682884d4f40000ce1ded53f4a1d0b18206 upstream.
This patch (as1477) fixes a problem affecting a few types of EHCI
controller. Contrary to what one might expect, these controllers
automatically stop their internal frame counter when no ports are
enabled. Since ehci-hcd currently relies on the frame counter for
determining when it should unlink QHs from the async schedule, those
controllers run into trouble: The frame counter stops and the QHs
never get unlinked.
Some systems have also experienced other problems traced back to
commit b963801164618e25fbdc0cd452ce49c3628b46c8 (USB: ehci-hcd unlink
speedups), which made the original switch from using the system clock
to using the frame counter. It never became clear what the reason was
for these problems, but evidently it is related to use of the frame
counter.
To fix all these problems, this patch more or less reverts that commit
and goes back to using the system clock. But this can't be done
cleanly because other changes have since been made to the scan_async()
subroutine. One of these changes involved the tricky logic that tries
to avoid rescanning QHs that have already been seen when the scanning
loop is restarted, which happens whenever an URB is given back.
Switching back to clock-based unlinks would make this logic even more
complicated.
Therefore the new code doesn't rescan the entire async list whenever a
giveback occurs. Instead it rescans only the current QH and continues
on from there. This requires the use of a separate pointer to keep
track of the next QH to scan, since the current QH may be unlinked
while the scanning is in progress. That new pointer must be global,
so that it can be adjusted forward whenever the _next_ QH gets
unlinked. (uhci-hcd uses this same trick.)
Simplification of the scanning loop removes a level of indentation,
which accounts for the size of the patch. The amount of code changed
is relatively small, and it isn't exactly a reversion of the
b963801164 commit.
This fixes Bugzilla #32432.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Matej Kenda <matejken@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/host/ehci-hcd.c | 8 +---
drivers/usb/host/ehci-q.c | 86 +++++++++++++++++++++-----------------------
drivers/usb/host/ehci.h | 3 +
3 files changed, 47 insertions(+), 50 deletions(-)
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -94,7 +94,8 @@ static const char hcd_name [] = "ehci_hc
#define EHCI_IAA_MSECS 10 /* arbitrary */
#define EHCI_IO_JIFFIES (HZ/10) /* io watchdog > irq_thresh */
#define EHCI_ASYNC_JIFFIES (HZ/20) /* async idle timeout */
-#define EHCI_SHRINK_FRAMES 5 /* async qh unlink delay */
+#define EHCI_SHRINK_JIFFIES (DIV_ROUND_UP(HZ, 200) + 1)
+ /* 200-ms async qh unlink delay */
/* Initial IRQ latency: faster than hw default */
static int log2_irq_thresh = 0; // 0 to 6
@@ -152,10 +153,7 @@ timer_action(struct ehci_hcd *ehci, enum
break;
/* case TIMER_ASYNC_SHRINK: */
default:
- /* add a jiffie since we synch against the
- * 8 KHz uframe counter.
- */
- t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1;
+ t = EHCI_SHRINK_JIFFIES;
break;
}
mod_timer(&ehci->watchdog, t + jiffies);
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1231,6 +1231,8 @@ static void start_unlink_async (struct e
prev->hw->hw_next = qh->hw->hw_next;
prev->qh_next = qh->qh_next;
+ if (ehci->qh_scan_next == qh)
+ ehci->qh_scan_next = qh->qh_next.qh;
wmb ();
/* If the controller isn't running, we don't have to wait for it */
@@ -1256,53 +1258,49 @@ static void scan_async (struct ehci_hcd
struct ehci_qh *qh;
enum ehci_timer_action action = TIMER_IO_WATCHDOG;
- ehci->stamp = ehci_readl(ehci, &ehci->regs->frame_index);
timer_action_done (ehci, TIMER_ASYNC_SHRINK);
-rescan:
stopped = !HC_IS_RUNNING(ehci_to_hcd(ehci)->state);
- qh = ehci->async->qh_next.qh;
- if (likely (qh != NULL)) {
- do {
- /* clean any finished work for this qh */
- if (!list_empty(&qh->qtd_list) && (stopped ||
- qh->stamp != ehci->stamp)) {
- int temp;
-
- /* unlinks could happen here; completion
- * reporting drops the lock. rescan using
- * the latest schedule, but don't rescan
- * qhs we already finished (no looping)
- * unless the controller is stopped.
- */
- qh = qh_get (qh);
- qh->stamp = ehci->stamp;
- temp = qh_completions (ehci, qh);
- if (qh->needs_rescan)
- unlink_async(ehci, qh);
- qh_put (qh);
- if (temp != 0) {
- goto rescan;
- }
- }
-
- /* unlink idle entries, reducing DMA usage as well
- * as HCD schedule-scanning costs. delay for any qh
- * we just scanned, there's a not-unusual case that it
- * doesn't stay idle for long.
- * (plus, avoids some kind of re-activation race.)
- */
- if (list_empty(&qh->qtd_list)
- && qh->qh_state == QH_STATE_LINKED) {
- if (!ehci->reclaim && (stopped ||
- ((ehci->stamp - qh->stamp) & 0x1fff)
- >= EHCI_SHRINK_FRAMES * 8))
- start_unlink_async(ehci, qh);
- else
- action = TIMER_ASYNC_SHRINK;
- }
- qh = qh->qh_next.qh;
- } while (qh);
+ ehci->qh_scan_next = ehci->async->qh_next.qh;
+ while (ehci->qh_scan_next) {
+ qh = ehci->qh_scan_next;
+ ehci->qh_scan_next = qh->qh_next.qh;
+ rescan:
+ /* clean any finished work for this qh */
+ if (!list_empty(&qh->qtd_list)) {
+ int temp;
+
+ /*
+ * Unlinks could happen here; completion reporting
+ * drops the lock. That's why ehci->qh_scan_next
+ * always holds the next qh to scan; if the next qh
+ * gets unlinked then ehci->qh_scan_next is adjusted
+ * in start_unlink_async().
+ */
+ qh = qh_get(qh);
+ temp = qh_completions(ehci, qh);
+ if (qh->needs_rescan)
+ unlink_async(ehci, qh);
+ qh->unlink_time = jiffies + EHCI_SHRINK_JIFFIES;
+ qh_put(qh);
+ if (temp != 0)
+ goto rescan;
+ }
+
+ /* unlink idle entries, reducing DMA usage as well
+ * as HCD schedule-scanning costs. delay for any qh
+ * we just scanned, there's a not-unusual case that it
+ * doesn't stay idle for long.
+ * (plus, avoids some kind of re-activation race.)
+ */
+ if (list_empty(&qh->qtd_list)
+ && qh->qh_state == QH_STATE_LINKED) {
+ if (!ehci->reclaim && (stopped ||
+ time_after_eq(jiffies, qh->unlink_time)))
+ start_unlink_async(ehci, qh);
+ else
+ action = TIMER_ASYNC_SHRINK;
+ }
}
if (action == TIMER_ASYNC_SHRINK)
timer_action (ehci, TIMER_ASYNC_SHRINK);
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -75,6 +75,7 @@ struct ehci_hcd { /* one per controlle
struct ehci_qh *async;
struct ehci_qh *dummy; /* For AMD quirk use */
struct ehci_qh *reclaim;
+ struct ehci_qh *qh_scan_next;
unsigned scanning : 1;
/* periodic schedule support */
@@ -117,7 +118,6 @@ struct ehci_hcd { /* one per controlle
struct timer_list iaa_watchdog;
struct timer_list watchdog;
unsigned long actions;
- unsigned stamp;
unsigned periodic_stamp;
unsigned random_frame;
unsigned long next_statechange;
@@ -343,6 +343,7 @@ struct ehci_qh {
struct ehci_qh *reclaim; /* next to reclaim */
struct ehci_hcd *ehci;
+ unsigned long unlink_time;
/*
* Do NOT use atomic operations for QH refcounting. On some CPUs
^ permalink raw reply [flat|nested] 103+ messages in thread
* [014/102] usb: musb: restore INDEX register in resume path
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (12 preceding siblings ...)
2011-08-03 22:00 ` [013/102] USB: EHCI: go back to using the system clock for QH unlinks Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [015/102] rtc: handle errors correctly in rtc_irq_set_state() Greg KH
` (87 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Anand Gadiyar,
Ajay Kumar Gupta, Felipe Balbi
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ajay Kumar Gupta <ajay.gupta@ti.com>
commit 3c5fec75e121b21a2eb35e5a6b44291509abba6f upstream.
Restoring the missing INDEX register value in musb_restore_context().
Without this suspend resume functionality is broken with offmode
enabled.
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/musb/musb_core.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2329,6 +2329,7 @@ static void musb_restore_context(struct
musb->context.index_regs[i].rxhubport);
}
}
+ musb_writeb(musb_base, MUSB_INDEX, musb->context.index);
}
static int musb_suspend(struct device *dev)
^ permalink raw reply [flat|nested] 103+ messages in thread
* [015/102] rtc: handle errors correctly in rtc_irq_set_state()
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (13 preceding siblings ...)
2011-08-03 22:00 ` [014/102] usb: musb: restore INDEX register in resume path Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [016/102] rtc: fix hrtimer deadlock Greg KH
` (86 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Thomas Gleixner, John Stultz,
Ingo Molnar, Ben Greear
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit 2c4f57d12df7696d65b0247bfd57fd082a7719e6 upstream.
The code checks the correctness of the parameters, but unconditionally
arms/disarms the hrtimer.
The result is that a random task might arm/disarm rtc timer and surprise
the real owner by either generating events or by stopping them.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/rtc/interface.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -656,6 +656,8 @@ int rtc_irq_set_state(struct rtc_device
err = -EBUSY;
if (rtc->irq_task != task)
err = -EACCES;
+ if (err)
+ goto out;
if (enabled) {
ktime_t period = ktime_set(0, NSEC_PER_SEC/rtc->irq_freq);
@@ -664,6 +666,7 @@ int rtc_irq_set_state(struct rtc_device
hrtimer_cancel(&rtc->pie_timer);
}
rtc->pie_enabled = enabled;
+out:
spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
return err;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [016/102] rtc: fix hrtimer deadlock
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (14 preceding siblings ...)
2011-08-03 22:00 ` [015/102] rtc: handle errors correctly in rtc_irq_set_state() Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [017/102] rtc: limit frequency Greg KH
` (85 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Thomas Gleixner, John Stultz,
Ingo Molnar
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5 upstream.
Ben reported a lockup related to rtc. The lockup happens due to:
CPU0 CPU1
rtc_irq_set_state() __run_hrtimer()
spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq();
spin_lock(&rtc->irq_task_lock);
hrtimer_cancel()
while (callback_running);
So the running callback never finishes as it's blocked on
rtc->irq_task_lock.
Use hrtimer_try_to_cancel() instead and drop rtc->irq_task_lock while
waiting for the callback. Fix this for both rtc_irq_set_state() and
rtc_irq_set_freq().
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Ben Greear <greearb@candelatech.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/rtc/interface.c | 56 +++++++++++++++++++++++++++++++-----------------
1 file changed, 37 insertions(+), 19 deletions(-)
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -636,6 +636,29 @@ void rtc_irq_unregister(struct rtc_devic
}
EXPORT_SYMBOL_GPL(rtc_irq_unregister);
+static int rtc_update_hrtimer(struct rtc_device *rtc, int enabled)
+{
+ /*
+ * We unconditionally cancel the timer here, because otherwise
+ * we could run into BUG_ON(timer->state != HRTIMER_STATE_CALLBACK);
+ * when we manage to start the timer before the callback
+ * returns HRTIMER_RESTART.
+ *
+ * We cannot use hrtimer_cancel() here as a running callback
+ * could be blocked on rtc->irq_task_lock and hrtimer_cancel()
+ * would spin forever.
+ */
+ if (hrtimer_try_to_cancel(&rtc->pie_timer) < 0)
+ return -1;
+
+ if (enabled) {
+ ktime_t period = ktime_set(0, NSEC_PER_SEC / rtc->irq_freq);
+
+ hrtimer_start(&rtc->pie_timer, period, HRTIMER_MODE_REL);
+ }
+ return 0;
+}
+
/**
* rtc_irq_set_state - enable/disable 2^N Hz periodic IRQs
* @rtc: the rtc device
@@ -651,24 +674,21 @@ int rtc_irq_set_state(struct rtc_device
int err = 0;
unsigned long flags;
+retry:
spin_lock_irqsave(&rtc->irq_task_lock, flags);
if (rtc->irq_task != NULL && task == NULL)
err = -EBUSY;
if (rtc->irq_task != task)
err = -EACCES;
- if (err)
- goto out;
-
- if (enabled) {
- ktime_t period = ktime_set(0, NSEC_PER_SEC/rtc->irq_freq);
- hrtimer_start(&rtc->pie_timer, period, HRTIMER_MODE_REL);
- } else {
- hrtimer_cancel(&rtc->pie_timer);
+ if (!err) {
+ if (rtc_update_hrtimer(rtc, enabled) < 0) {
+ spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
+ cpu_relax();
+ goto retry;
+ }
+ rtc->pie_enabled = enabled;
}
- rtc->pie_enabled = enabled;
-out:
spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
-
return err;
}
EXPORT_SYMBOL_GPL(rtc_irq_set_state);
@@ -690,20 +710,18 @@ int rtc_irq_set_freq(struct rtc_device *
if (freq <= 0)
return -EINVAL;
-
+retry:
spin_lock_irqsave(&rtc->irq_task_lock, flags);
if (rtc->irq_task != NULL && task == NULL)
err = -EBUSY;
if (rtc->irq_task != task)
err = -EACCES;
- if (err == 0) {
+ if (!err) {
rtc->irq_freq = freq;
- if (rtc->pie_enabled) {
- ktime_t period;
- hrtimer_cancel(&rtc->pie_timer);
- period = ktime_set(0, NSEC_PER_SEC/rtc->irq_freq);
- hrtimer_start(&rtc->pie_timer, period,
- HRTIMER_MODE_REL);
+ if (rtc->pie_enabled && rtc_update_hrtimer(rtc, 1) < 0) {
+ spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
+ cpu_relax();
+ goto retry;
}
}
spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [017/102] rtc: limit frequency
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (15 preceding siblings ...)
2011-08-03 22:00 ` [016/102] rtc: fix hrtimer deadlock Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [018/102] drivers/rtc/rtc-tegra.c: properly initialize spinlock Greg KH
` (84 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Thomas Gleixner, John Stultz,
Ingo Molnar, Ben Greear
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit 431e2bcc371016824f419baa745f82388258f3ee upstream.
Due to the hrtimer self rearming mode a user can DoS the machine simply
because it's starved by hrtimer events.
The RTC hrtimer is self rearming. We really need to limit the frequency
to something sensible.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/rtc/interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -708,7 +708,7 @@ int rtc_irq_set_freq(struct rtc_device *
int err = 0;
unsigned long flags;
- if (freq <= 0)
+ if (freq <= 0 || freq > 5000)
return -EINVAL;
retry:
spin_lock_irqsave(&rtc->irq_task_lock, flags);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [018/102] drivers/rtc/rtc-tegra.c: properly initialize spinlock
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (16 preceding siblings ...)
2011-08-03 22:00 ` [017/102] rtc: limit frequency Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [019/102] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
` (83 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Uwe Kleine-König,
Andrew Chew
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
commit e57ee01750c4954fd0b5e3c6109cd4b870880eb9 upstream.
Using __SPIN_LOCK_UNLOCKED for a dynamically allocated lock is wrong and
breaks the build with PREEMPT_RT_FULL.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Andrew Chew <achew@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/rtc/rtc-tegra.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -343,7 +343,7 @@ static int __devinit tegra_rtc_probe(str
/* set context info. */
info->pdev = pdev;
- info->tegra_rtc_lock = __SPIN_LOCK_UNLOCKED(info->tegra_rtc_lock);
+ spin_lock_init(&info->tegra_rtc_lock);
platform_set_drvdata(pdev, info);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [019/102] ARM: pxa/cm-x300: fix V3020 RTC functionality
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (17 preceding siblings ...)
2011-08-03 22:00 ` [018/102] drivers/rtc/rtc-tegra.c: properly initialize spinlock Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [020/102] ASoC: davinci: add missing break statement Greg KH
` (82 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Igor Grinberg, Eric Miao
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Igor Grinberg <grinberg@compulab.co.il>
commit 6c7b3ea52e345ab614edb91d3f0e9f3bb3713871 upstream.
While in sleep mode the CS# and other V3020 RTC GPIOs must be driven
high, otherwise V3020 RTC fails to keep the right time in sleep mode.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/arm/mach-pxa/cm-x300.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -161,10 +161,10 @@ static mfp_cfg_t cm_x3xx_mfp_cfg[] __ini
GPIO99_GPIO, /* Ethernet IRQ */
/* RTC GPIOs */
- GPIO95_GPIO, /* RTC CS */
- GPIO96_GPIO, /* RTC WR */
- GPIO97_GPIO, /* RTC RD */
- GPIO98_GPIO, /* RTC IO */
+ GPIO95_GPIO | MFP_LPM_DRIVE_HIGH, /* RTC CS */
+ GPIO96_GPIO | MFP_LPM_DRIVE_HIGH, /* RTC WR */
+ GPIO97_GPIO | MFP_LPM_DRIVE_HIGH, /* RTC RD */
+ GPIO98_GPIO, /* RTC IO */
/* Standard I2C */
GPIO21_I2C_SCL,
^ permalink raw reply [flat|nested] 103+ messages in thread
* [020/102] ASoC: davinci: add missing break statement
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (18 preceding siblings ...)
2011-08-03 22:00 ` [019/102] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [021/102] ASoC: davinci: fix codec start and stop functions Greg KH
` (81 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sudhakar Rajashekhara,
Liam Girdwood, Mark Brown
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
commit 82d1d521036eb3f5aae48b847f939d99a44c18bb upstream.
In davinci_vcif_trigger() function, a break() statement was missing
causing the davinci_vcif_stop() function to be called as a fallback
after calling davinci_vcif_start().
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/soc/davinci/davinci-vcif.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -159,6 +159,7 @@ static int davinci_vcif_trigger(struct s
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
davinci_vcif_start(substream);
+ break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
^ permalink raw reply [flat|nested] 103+ messages in thread
* [021/102] ASoC: davinci: fix codec start and stop functions
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (19 preceding siblings ...)
2011-08-03 22:00 ` [020/102] ASoC: davinci: add missing break statement Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [022/102] ASoC: Mark cache as dirty when suspending Greg KH
` (80 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sudhakar Rajashekhara,
Liam Girdwood, Mark Brown
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
commit 3012f43eaf7592d8121426918e43e3b5db013aff upstream.
According to DM365 voice codec data sheet at [1], before starting
recording or playback, ADC/DAC modules should follow a reset and
enable cycle. Writing a 1 to the ADC/DAC bit in the register resets
the module and clearing the bit to 0 will enable the module. But the
driver seems to be doing the reverse of it.
[1] http://focus.ti.com/lit/ug/sprufi9b/sprufi9b.pdf
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/soc/davinci/davinci-vcif.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -62,9 +62,9 @@ static void davinci_vcif_start(struct sn
w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
+ MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
else
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);
+ MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);
writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
}
@@ -80,9 +80,9 @@ static void davinci_vcif_stop(struct snd
/* Reset transmitter/receiver and sample rate/frame sync generators */
w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
+ MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
else
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);
+ MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);
writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [022/102] ASoC: Mark cache as dirty when suspending
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (20 preceding siblings ...)
2011-08-03 22:00 ` [021/102] ASoC: davinci: fix codec start and stop functions Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [023/102] ath6kl: cache firmware Greg KH
` (79 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Mark Brown, Liam Girdwood
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
commit 7be4ba24a3ea53bc8ade841635e4d4a59e98ceb5 upstream.
Since quite a few drivers are not managing to flag the cache as needing
to be resynced after suspend and it's a reasonable thing to do flag the
cache as needing sync automatically when suspending.
The expectation is that systems will mainly only keep the CODEC powered
when doing audio through the CODEC so we won't actually suspend the
device anyway; drivers which want to can override this behaviour when
they resume.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/soc/soc-core.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1124,6 +1124,7 @@ int snd_soc_suspend(struct device *dev)
case SND_SOC_BIAS_OFF:
codec->driver->suspend(codec, PMSG_SUSPEND);
codec->suspended = 1;
+ codec->cache_sync = 1;
break;
default:
dev_dbg(codec->dev, "CODEC is on over suspend\n");
^ permalink raw reply [flat|nested] 103+ messages in thread
* [023/102] ath6kl: cache firmware
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (21 preceding siblings ...)
2011-08-03 22:00 ` [022/102] ASoC: Mark cache as dirty when suspending Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [024/102] ath6kl: fix crash when interface is closed but scan is ongoing Greg KH
` (78 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Kalle Valo
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kalle Valo <kvalo@qca.qualcomm.com>
commit b42a7b1bc7c0f535dfe35b2c934f239c60bb8d30 upstream.
Drivers should not request firmware during resume. Fix ath6kl to
cache the firmware instead.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 49 +++++++++++++------
drivers/staging/ath6kl/os/linux/include/ar6000_drv.h | 9 +++
2 files changed, 43 insertions(+), 15 deletions(-)
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -954,9 +954,13 @@ ar6000_transfer_bin_file(struct ar6_soft
const char *filename;
const struct firmware *fw_entry;
u32 fw_entry_size;
+ u8 **buf;
+ size_t *buf_len;
switch (file) {
case AR6K_OTP_FILE:
+ buf = &ar->fw_otp;
+ buf_len = &ar->fw_otp_len;
if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
filename = AR6003_REV1_OTP_FILE;
} else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
@@ -970,6 +974,8 @@ ar6000_transfer_bin_file(struct ar6_soft
break;
case AR6K_FIRMWARE_FILE:
+ buf = &ar->fw;
+ buf_len = &ar->fw_len;
if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
filename = AR6003_REV1_FIRMWARE_FILE;
} else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
@@ -1028,6 +1034,8 @@ ar6000_transfer_bin_file(struct ar6_soft
break;
case AR6K_PATCH_FILE:
+ buf = &ar->fw_patch;
+ buf_len = &ar->fw_patch_len;
if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
filename = AR6003_REV1_PATCH_FILE;
} else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
@@ -1041,6 +1049,8 @@ ar6000_transfer_bin_file(struct ar6_soft
break;
case AR6K_BOARD_DATA_FILE:
+ buf = &ar->fw_data;
+ buf_len = &ar->fw_data_len;
if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
filename = AR6003_REV1_BOARD_DATA_FILE;
} else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
@@ -1057,23 +1067,29 @@ ar6000_transfer_bin_file(struct ar6_soft
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown file type: %d\n", file));
return A_ERROR;
}
- if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0)
- {
- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename));
- return A_ENOENT;
+
+ if (*buf == NULL) {
+ if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) {
+ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename));
+ return A_ENOENT;
+ }
+
+ *buf = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
+ *buf_len = fw_entry->size;
+ A_RELEASE_FIRMWARE(fw_entry);
}
#ifdef SOFTMAC_FILE_USED
- if (file==AR6K_BOARD_DATA_FILE && fw_entry->data) {
- ar6000_softmac_update(ar, (u8 *)fw_entry->data, fw_entry->size);
+ if (file==AR6K_BOARD_DATA_FILE && *buf_len) {
+ ar6000_softmac_update(ar, *buf, *buf_len);
}
#endif
- fw_entry_size = fw_entry->size;
+ fw_entry_size = *buf_len;
/* Load extended board data for AR6003 */
- if ((file==AR6K_BOARD_DATA_FILE) && (fw_entry->data)) {
+ if ((file==AR6K_BOARD_DATA_FILE) && *buf) {
u32 board_ext_address;
u32 board_ext_data_size;
u32 board_data_size;
@@ -1089,14 +1105,13 @@ ar6000_transfer_bin_file(struct ar6_soft
AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("Board extended Data download address: 0x%x\n", board_ext_address));
/* check whether the target has allocated memory for extended board data and file contains extended board data */
- if ((board_ext_address) && (fw_entry->size == (board_data_size + board_ext_data_size))) {
+ if ((board_ext_address) && (*buf_len == (board_data_size + board_ext_data_size))) {
u32 param;
- status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (u8 *)(fw_entry->data + board_data_size), board_ext_data_size);
+ status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (u8 *)(*buf + board_data_size), board_ext_data_size);
if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
- A_RELEASE_FIRMWARE(fw_entry);
return A_ERROR;
}
@@ -1110,17 +1125,16 @@ ar6000_transfer_bin_file(struct ar6_soft
}
if (compressed) {
- status = BMIFastDownload(ar->arHifDevice, address, (u8 *)fw_entry->data, fw_entry_size);
+ status = BMIFastDownload(ar->arHifDevice, address, *buf, fw_entry_size);
} else {
- status = BMIWriteMemory(ar->arHifDevice, address, (u8 *)fw_entry->data, fw_entry_size);
+ status = BMIWriteMemory(ar->arHifDevice, address, *buf, fw_entry_size);
}
if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
- A_RELEASE_FIRMWARE(fw_entry);
return A_ERROR;
}
- A_RELEASE_FIRMWARE(fw_entry);
+
return 0;
}
@@ -2088,6 +2102,11 @@ ar6000_destroy(struct net_device *dev, u
ar6000_remove_ap_interface();
#endif /*CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */
+ kfree(ar->fw_otp);
+ kfree(ar->fw);
+ kfree(ar->fw_patch);
+ kfree(ar->fw_data);
+
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("-ar6000_destroy \n"));
}
--- a/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
+++ b/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
@@ -651,6 +651,15 @@ struct ar6_softc {
void *arApDev;
#endif
u8 arAutoAuthStage;
+
+ u8 *fw_otp;
+ size_t fw_otp_len;
+ u8 *fw;
+ size_t fw_len;
+ u8 *fw_patch;
+ size_t fw_patch_len;
+ u8 *fw_data;
+ size_t fw_data_len;
};
#ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT
^ permalink raw reply [flat|nested] 103+ messages in thread
* [024/102] ath6kl: fix crash when interface is closed but scan is ongoing
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (22 preceding siblings ...)
2011-08-03 22:00 ` [023/102] ath6kl: cache firmware Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [025/102] ath9k_hw: Fix incorrect key_miss handling Greg KH
` (77 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Kalle Valo
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kalle Valo <kvalo@qca.qualcomm.com>
commit 98ab5c7755b5cc9e1a8f2a57ccb22eac5e13ec50 upstream.
When ath6kl module was resumed while a scan was ongoing, for example during
suspend, the driver would crash in ar6k_cfg80211_scanComplete_event():
[26581.586440] Call Trace:
[26581.586440] [<f99ffeda>] ? ar6k_cfg80211_scanComplete_event+0xaa/0xaa [ath6kl]
[26581.586440] [<f9a0a020>] wmi_iterate_nodes+0xb/0xd [ath6kl]
[26581.586440] [<f99ffe78>] ar6k_cfg80211_scanComplete_event+0x48/0xaa [ath6kl]
[26581.586440] [<f9a038ae>] ar6000_close+0x77/0x7e [ath6kl]
[26581.586440] [<c139c25d>] __dev_close_many+0x87/0xab
[26581.586440] [<c139c30a>] dev_close_many+0x54/0xab
[26581.586440] [<c139c437>] rollback_registered_many+0xa5/0x19e
[26581.586440] [<c139c595>] rollback_registered+0x23/0x2f
[26581.586440] [<c139c5ed>] unregister_netdevice_queue+0x4c/0x69
[26581.586440] [<c139c6b2>] unregister_netdev+0x18/0x1f
[26581.586440] [<f9a00d4c>] ar6000_destroy+0xf8/0x115 [ath6kl]
[26581.586440] [<f9a0c765>] ar6k_cleanup_module+0x20/0x29 [ath6kl]
[26581.586440] [<c1062843>] sys_delete_module+0x181/0x1d9
[26581.586440] [<c105876b>] ? lock_release_holdtime+0x2b/0xcd
[26581.586440] [<c10b55dc>] ? sys_munmap+0x3b/0x42
[26581.586440] [<c14a99dc>] ? restore_all+0xf/0xf
[26581.586440] [<c14aeb6c>] sysenter_do_call+0x12/0x32
[26581.586440] Code: 89 53 6c 75 07 89 d8 e8 c0 ff ff ff 89 f0 e8 2c f2 a9 c7 5b 5e 5d c3 55 89 e5 57 56 53 89 c3 83 ec 08 89 55 f0 8d 78 04 89 4d ec <8b> b0 b8 00 00 00 46 89 b0 b8 00 00 00 89 f8 e8 ae ed a9 c7 8b
Fix the function not to iterate nodes when the scan is aborted. The nodes
are already freed when the module is being unloaded. Patch "ath6kl: Fix a
kernel panic furing suspend/resume" tried to fix this already but it wasn't
enough as a pointer was still used even after the null check. This patch
removes the null check entirely as the wmi structure is not accessed anymore
during module unload.
Also fix a bug where the status was checked as a bitfield with '&' operator.
But it's not a bitfield, just a regular (enum like) value.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/ath6kl/os/linux/cfg80211.c | 31 ++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
--- a/drivers/staging/ath6kl/os/linux/cfg80211.c
+++ b/drivers/staging/ath6kl/os/linux/cfg80211.c
@@ -867,26 +867,31 @@ ar6k_cfg80211_scanComplete_event(struct
AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: status %d\n", __func__, status));
- if(ar->scan_request)
- {
- /* Translate data to cfg80211 mgmt format */
- if (ar->arWmi)
- wmi_iterate_nodes(ar->arWmi, ar6k_cfg80211_scan_node, ar->wdev->wiphy);
+ if (!ar->scan_request)
+ return;
- cfg80211_scan_done(ar->scan_request,
- ((status & A_ECANCELED) || (status & A_EBUSY)) ? true : false);
+ if ((status == A_ECANCELED) || (status == A_EBUSY)) {
+ cfg80211_scan_done(ar->scan_request, true);
+ goto out;
+ }
+
+ /* Translate data to cfg80211 mgmt format */
+ wmi_iterate_nodes(ar->arWmi, ar6k_cfg80211_scan_node, ar->wdev->wiphy);
- if(ar->scan_request->n_ssids &&
- ar->scan_request->ssids[0].ssid_len) {
+ cfg80211_scan_done(ar->scan_request, false);
+
+ if(ar->scan_request->n_ssids &&
+ ar->scan_request->ssids[0].ssid_len) {
u8 i;
for (i = 0; i < ar->scan_request->n_ssids; i++) {
- wmi_probedSsid_cmd(ar->arWmi, i+1, DISABLE_SSID_FLAG,
- 0, NULL);
+ wmi_probedSsid_cmd(ar->arWmi, i+1, DISABLE_SSID_FLAG,
+ 0, NULL);
}
- }
- ar->scan_request = NULL;
}
+
+out:
+ ar->scan_request = NULL;
}
static int
^ permalink raw reply [flat|nested] 103+ messages in thread
* [025/102] ath9k_hw: Fix incorrect key_miss handling
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (23 preceding siblings ...)
2011-08-03 22:00 ` [024/102] ath6kl: fix crash when interface is closed but scan is ongoing Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [026/102] CIFS: Fix oops while mounting with prefixpath Greg KH
` (76 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Senthil Balasubramanian,
John W. Linville
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
commit 0472ade031b5c0c69c21cf96acf64c50eb9ba3c2 upstream.
Decryping frames on key_miss handling shouldn't be done for Michael
MIC failed frames as h/w would have already decrypted such frames
successfully anyway.
Also leaving CRC and PHY error(where the frame is going to be dropped
anyway), we are left to prcoess Decrypt error for which s/w decrypt is
selected anway and so having key_miss as a separate check doesn't serve
anything. So making key_miss handling mutually exlusive with other RX
status handling makes much more sense.
This patch addresses an issue with STA not reporting MIC failure events
resulting in STA being disconnected immediately.
Signed-off-by: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 3 +--
drivers/net/wireless/ath/ath9k/mac.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -629,8 +629,7 @@ int ath9k_hw_process_rxdesc_edma(struct
rxs->rs_status |= ATH9K_RXERR_DECRYPT;
else if (rxsp->status11 & AR_MichaelErr)
rxs->rs_status |= ATH9K_RXERR_MIC;
-
- if (rxsp->status11 & AR_KeyMiss)
+ else if (rxsp->status11 & AR_KeyMiss)
rxs->rs_status |= ATH9K_RXERR_DECRYPT;
}
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -645,8 +645,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
rs->rs_status |= ATH9K_RXERR_DECRYPT;
else if (ads.ds_rxstatus8 & AR_MichaelErr)
rs->rs_status |= ATH9K_RXERR_MIC;
-
- if (ads.ds_rxstatus8 & AR_KeyMiss)
+ else if (ads.ds_rxstatus8 & AR_KeyMiss)
rs->rs_status |= ATH9K_RXERR_DECRYPT;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [026/102] CIFS: Fix oops while mounting with prefixpath
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (24 preceding siblings ...)
2011-08-03 22:00 ` [025/102] ath9k_hw: Fix incorrect key_miss handling Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [027/102] staging: brcm80211: fix for reported log spam problem Greg KH
` (75 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Pavel Shilovsky,
Steve French
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pavel Shilovsky <piastryyy@gmail.com>
commit f5bc1e755d23d022bf948904386337fc3e5e29a8 upstream.
commit fec11dd9a0109fe52fd631e5c510778d6cbff6cc caused
a regression when we have already mounted //server/share/a
and want to mount //server/share/a/b.
The problem is that lookup_one_len calls __lookup_hash
with nd pointer as NULL. Then __lookup_hash calls
do_revalidate in the case when dentry exists and we end
up with NULL pointer deference in cifs_d_revalidate:
if (nd->flags & LOOKUP_RCU)
return -ECHILD;
Fix this by checking nd for NULL.
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/cifs/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -641,7 +641,7 @@ lookup_out:
static int
cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
{
- if (nd->flags & LOOKUP_RCU)
+ if (nd && (nd->flags & LOOKUP_RCU))
return -ECHILD;
if (direntry->d_inode) {
^ permalink raw reply [flat|nested] 103+ messages in thread
* [027/102] staging: brcm80211: fix for reported log spam problem
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (25 preceding siblings ...)
2011-08-03 22:00 ` [026/102] CIFS: Fix oops while mounting with prefixpath Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [028/102] jme: Fix unmap error (Causing system freeze) Greg KH
` (74 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Roland Vossen,
Stefan Lippers-Hollmann
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roland Vossen <rvossen@broadcom.com>
commit 37c962d195005d009e130e65a9e55960996c3cab upstream.
Every few minutes, this message would appear in syslog:
ieee80211 ph0: wl_ops_bss_info_changed: BSS idle: true (implement)
The message has been deleted, the driver requires no special action on this
particular event (). See: https://bugzilla.kernel.org/show_bug.cgi?id=38162
Reported-by: David Hill <hilld@binarystorm.net>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
---
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c | 5 -----
1 file changed, 5 deletions(-)
--- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
+++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
@@ -449,11 +449,6 @@ wl_ops_bss_info_changed(struct ieee80211
wiphy_err(wiphy, "%s: qos enabled: %s (implement)\n", __func__,
info->qos ? "true" : "false");
}
- if (changed & BSS_CHANGED_IDLE) {
- /* Idle changed for this BSS/interface */
- wiphy_err(wiphy, "%s: BSS idle: %s (implement)\n", __func__,
- info->idle ? "true" : "false");
- }
return;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [028/102] jme: Fix unmap error (Causing system freeze)
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (26 preceding siblings ...)
2011-08-03 22:00 ` [027/102] staging: brcm80211: fix for reported log spam problem Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [029/102] ethtool: Allow zero-length register dumps again Greg KH
` (73 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Guo-Fu Tseng, Chris Wright,
David S. Miller
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guo-Fu Tseng <cooldavid@cooldavid.org>
commit 94c5b41b327e08de0ddf563237855f55080652a1 upstream.
This patch add the missing dma_unmap().
Which solved the critical issue of system freeze on heavy load.
Michal Miroslaw's rejected patch:
[PATCH v2 10/46] net: jme: convert to generic DMA API
Pointed out the issue also, thank you Michal.
But the fix was incorrect. It would unmap needed address
when low memory.
Got lots of feedback from End user and Gentoo Bugzilla.
https://bugs.gentoo.org/show_bug.cgi?id=373109
Thank you all. :)
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/jme.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -753,20 +753,28 @@ jme_make_new_rx_buf(struct jme_adapter *
struct jme_ring *rxring = &(jme->rxring[0]);
struct jme_buffer_info *rxbi = rxring->bufinf + i;
struct sk_buff *skb;
+ dma_addr_t mapping;
skb = netdev_alloc_skb(jme->dev,
jme->dev->mtu + RX_EXTRA_LEN);
if (unlikely(!skb))
return -ENOMEM;
+ mapping = pci_map_page(jme->pdev, virt_to_page(skb->data),
+ offset_in_page(skb->data), skb_tailroom(skb),
+ PCI_DMA_FROMDEVICE);
+ if (unlikely(pci_dma_mapping_error(jme->pdev, mapping))) {
+ dev_kfree_skb(skb);
+ return -ENOMEM;
+ }
+
+ if (likely(rxbi->mapping))
+ pci_unmap_page(jme->pdev, rxbi->mapping,
+ rxbi->len, PCI_DMA_FROMDEVICE);
+
rxbi->skb = skb;
rxbi->len = skb_tailroom(skb);
- rxbi->mapping = pci_map_page(jme->pdev,
- virt_to_page(skb->data),
- offset_in_page(skb->data),
- rxbi->len,
- PCI_DMA_FROMDEVICE);
-
+ rxbi->mapping = mapping;
return 0;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [029/102] ethtool: Allow zero-length register dumps again
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (27 preceding siblings ...)
2011-08-03 22:00 ` [028/102] jme: Fix unmap error (Causing system freeze) Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [030/102] firewire: cdev: return -ENOTTY for unimplemented ioctls, not -EINVAL Greg KH
` (72 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Ben Hutchings,
David S. Miller
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <bhutchings@solarflare.com>
commit 67ae7cf1eeda777f79259c4c6cb17a0bd28dee71 upstream.
Some drivers (ab)use the ethtool_ops::get_regs operation to expose
only a hardware revision ID. Commit
a77f5db361ed9953b5b749353ea2c7fed2bf8d93 ('ethtool: Allocate register
dump buffer with vmalloc()') had the side-effect of breaking these, as
vmalloc() returns a null pointer for size=0 whereas kmalloc() did not.
For backward-compatibility, allow zero-length dumps again.
Reported-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/core/ethtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1227,7 +1227,7 @@ static int ethtool_get_regs(struct net_d
regs.len = reglen;
regbuf = vzalloc(reglen);
- if (!regbuf)
+ if (reglen && !regbuf)
return -ENOMEM;
ops->get_regs(dev, ®s, regbuf);
@@ -1236,7 +1236,7 @@ static int ethtool_get_regs(struct net_d
if (copy_to_user(useraddr, ®s, sizeof(regs)))
goto out;
useraddr += offsetof(struct ethtool_regs, data);
- if (copy_to_user(useraddr, regbuf, regs.len))
+ if (regbuf && copy_to_user(useraddr, regbuf, regs.len))
goto out;
ret = 0;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [030/102] firewire: cdev: return -ENOTTY for unimplemented ioctls, not -EINVAL
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (28 preceding siblings ...)
2011-08-03 22:00 ` [029/102] ethtool: Allow zero-length register dumps again Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [031/102] firewire: cdev: prevent race between first get_info ioctl and bus reset event queuing Greg KH
` (71 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Stefan Richter
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
commit d873d794235efa590ab3c94d5ee22bb1fab19ac4 upstream.
On Jun 27 Linus Torvalds wrote:
> The correct error code for "I don't understand this ioctl" is ENOTTY.
> The naming may be odd, but you should think of that error value as a
> "unrecognized ioctl number, you're feeding me random numbers that I
> don't understand and I assume for historical reasons that you tried to
> do some tty operation on me".
[...]
> The EINVAL thing goes way back, and is a disaster. It predates Linux
> itself, as far as I can tell. You'll find lots of man-pages that have
> this line in it:
>
> EINVAL Request or argp is not valid.
>
> and it shows up in POSIX etc. And sadly, it generally shows up
> _before_ the line that says
>
> ENOTTY The specified request does not apply to the kind of object
> that the descriptor d references.
>
> so a lot of people get to the EINVAL, and never even notice the ENOTTY.
[...]
> At least glibc (and hopefully other C libraries) use a _string_ that
> makes much more sense: strerror(ENOTTY) is "Inappropriate ioctl for
> device"
So let's correct this in the <linux/firewire-cdev.h> ABI while it is
still young, relative to distributor adoption.
Side note: We return -ENOTTY not only on _IOC_TYPE or _IOC_NR mismatch,
but also on _IOC_SIZE mismatch. An ioctl with an unsupported size of
argument structure can be seen as an unsupported version of that ioctl.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/firewire/core-cdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1583,7 +1583,7 @@ static int dispatch_ioctl(struct client
if (_IOC_TYPE(cmd) != '#' ||
_IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers) ||
_IOC_SIZE(cmd) > sizeof(buffer))
- return -EINVAL;
+ return -ENOTTY;
if (_IOC_DIR(cmd) == _IOC_READ)
memset(&buffer, 0, _IOC_SIZE(cmd));
^ permalink raw reply [flat|nested] 103+ messages in thread
* [031/102] firewire: cdev: prevent race between first get_info ioctl and bus reset event queuing
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (29 preceding siblings ...)
2011-08-03 22:00 ` [030/102] firewire: cdev: return -ENOTTY for unimplemented ioctls, not -EINVAL Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [032/102] IB/srp: Avoid duplicate devices from LUN scan Greg KH
` (70 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Stefan Richter
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
commit 93b37905f70083d6143f5f4dba0a45cc64379a62 upstream.
Between open(2) of a /dev/fw* and the first FW_CDEV_IOC_GET_INFO
ioctl(2) on it, the kernel already queues FW_CDEV_EVENT_BUS_RESET events
to be read(2) by the client. The get_info ioctl is practically always
issued right away after open, hence this condition only occurs if the
client opens during a bus reset, especially during a rapid series of bus
resets.
The problem with this condition is twofold:
- These bus reset events carry the (as yet undocumented) @closure
value of 0. But it is not the kernel's place to choose closures;
they are privat to the client. E.g., this 0 value forced from the
kernel makes it unsafe for clients to dereference it as a pointer to
a closure object without NULL pointer check.
- It is impossible for clients to determine the relative order of bus
reset events from get_info ioctl(2) versus those from read(2),
except in one way: By comparison of closure values. Again, such a
procedure imposes complexity on clients and reduces freedom in use
of the bus reset closure.
So, change the ABI to suppress queuing of bus reset events before the
first FW_CDEV_IOC_GET_INFO ioctl was issued by the client.
Note, this ABI change cannot be version-controlled. The kernel cannot
distinguish old from new clients before the first FW_CDEV_IOC_GET_INFO
ioctl.
We will try to back-merge this change into currently maintained stable/
longterm series, and we only document the new behaviour. The old
behavior is now considered a kernel bug, which it basically is.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: <stable@kernel.org>
---
drivers/firewire/core-cdev.c | 18 ++++++++++--------
include/linux/firewire-cdev.h | 3 +++
2 files changed, 13 insertions(+), 8 deletions(-)
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -253,14 +253,11 @@ static int fw_device_op_open(struct inod
init_waitqueue_head(&client->wait);
init_waitqueue_head(&client->tx_flush_wait);
INIT_LIST_HEAD(&client->phy_receiver_link);
+ INIT_LIST_HEAD(&client->link);
kref_init(&client->kref);
file->private_data = client;
- mutex_lock(&device->client_list_mutex);
- list_add_tail(&client->link, &device->client_list);
- mutex_unlock(&device->client_list_mutex);
-
return nonseekable_open(inode, file);
}
@@ -451,15 +448,20 @@ static int ioctl_get_info(struct client
if (ret != 0)
return -EFAULT;
+ mutex_lock(&client->device->client_list_mutex);
+
client->bus_reset_closure = a->bus_reset_closure;
if (a->bus_reset != 0) {
fill_bus_reset_event(&bus_reset, client);
- if (copy_to_user(u64_to_uptr(a->bus_reset),
- &bus_reset, sizeof(bus_reset)))
- return -EFAULT;
+ ret = copy_to_user(u64_to_uptr(a->bus_reset),
+ &bus_reset, sizeof(bus_reset));
}
+ if (ret == 0 && list_empty(&client->link))
+ list_add_tail(&client->link, &client->device->client_list);
- return 0;
+ mutex_unlock(&client->device->client_list_mutex);
+
+ return ret ? -EFAULT : 0;
}
static int add_client_resource(struct client *client,
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -475,6 +475,9 @@ union fw_cdev_event {
* of the bus. This does not cause a bus reset to happen.
* @bus_reset_closure: Value of &closure in this and subsequent bus reset events
* @card: The index of the card this device belongs to
+ *
+ * As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2)
+ * is started by this ioctl.
*/
struct fw_cdev_get_info {
__u32 version;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [032/102] IB/srp: Avoid duplicate devices from LUN scan
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (30 preceding siblings ...)
2011-08-03 22:00 ` [031/102] firewire: cdev: prevent race between first get_info ioctl and bus reset event queuing Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [033/102] [SCSI] libsas: remove expander from dev list on error Greg KH
` (69 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Bart Van Assche,
David Dillow, Roland Dreier
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bart Van Assche <bvanassche@acm.org>
commit fd1b6c4a693c9cac59375ffb36ffe5d7c079037c upstream.
SCSI scanning of a channel:id:lun triplet in Linux works as follows
(function scsi_scan_target() in drivers/scsi/scsi_scan.c):
- If lun == SCAN_WILD_CARD, send a REPORT LUNS command to the target
and process the result.
- If lun != SCAN_WILD_CARD, send an INQUIRY command to the LUN
corresponding to the specified channel:id:lun triplet to verify
whether the LUN exists.
So a SCSI driver must either take the channel and target id values in
account in its quecommand() function or it should declare that it only
supports one channel and one target id.
Currently the ib_srp driver does neither. As a result scanning the
SCSI bus via e.g. rescan-scsi-bus.sh causes many duplicate SCSI
devices to be created. For each 0:0:L device, several duplicates are
created with the same LUN number and with (C:I) != (0:0). Fix this by
declaring that the ib_srp driver only supports one channel and one
target id.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/infiniband/ulp/srp/ib_srp.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2127,6 +2127,8 @@ static ssize_t srp_create_target(struct
return -ENOMEM;
target_host->transportt = ib_srp_transport_template;
+ target_host->max_channel = 0;
+ target_host->max_id = 1;
target_host->max_lun = SRP_MAX_LUN;
target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [033/102] [SCSI] libsas: remove expander from dev list on error
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (31 preceding siblings ...)
2011-08-03 22:00 ` [032/102] IB/srp: Avoid duplicate devices from LUN scan Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [034/102] rtlwifi: rtl8192cu: Fix duplicate if test Greg KH
` (68 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Luben Tuikov,
James Bottomley
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luben Tuikov <ltuikov@yahoo.com>
commit 5911e963d3718e306bcac387b83e259aa4228896 upstream.
If expander discovery fails (sas_discover_expander()), remove the
expander from the port device list (sas_ex_discover_expander()),
before freeing it. Else the list is corrupted and, e.g., when we
attempt to send SMP commands to other devices, the kernel oopses.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Reviewed-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/libsas/sas_expander.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -849,6 +849,9 @@ static struct domain_device *sas_ex_disc
res = sas_discover_expander(child);
if (res) {
+ spin_lock_irq(&parent->port->dev_list_lock);
+ list_del(&child->dev_list_node);
+ spin_unlock_irq(&parent->port->dev_list_lock);
kfree(child);
return NULL;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [034/102] rtlwifi: rtl8192cu: Fix duplicate if test
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (32 preceding siblings ...)
2011-08-03 22:00 ` [033/102] [SCSI] libsas: remove expander from dev list on error Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [035/102] mac80211: Restart STA timers only on associated state Greg KH
` (67 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Larry Finger,
John W. Linville
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 1288aa4e80145d9f4196df32f717b4c1cf6aab61 upstream.
A typo causes routine rtl92cu_phy_rf6052_set_cck_txpower() to test the
same condition twice. The problem was found using cppcheck-1.49, and the
proper fix was verified against the pre-mac80211 version of the code.
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
@@ -104,7 +104,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(
tx_agc[RF90_PATH_A] = 0x10101010;
tx_agc[RF90_PATH_B] = 0x10101010;
} else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
- TXHIGHPWRLEVEL_LEVEL1) {
+ TXHIGHPWRLEVEL_LEVEL2) {
tx_agc[RF90_PATH_A] = 0x00000000;
tx_agc[RF90_PATH_B] = 0x00000000;
} else{
^ permalink raw reply [flat|nested] 103+ messages in thread
* [035/102] mac80211: Restart STA timers only on associated state
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (33 preceding siblings ...)
2011-08-03 22:00 ` [034/102] rtlwifi: rtl8192cu: Fix duplicate if test Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [036/102] irq_work, ppc: Fix up arch hooks Greg KH
` (66 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Rajkumar Manoharan,
John W. Linville
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
commit 676b58c27475a9defccc025fea1cbd2b141ee539 upstream.
A panic was observed when the device is failed to resume properly,
and there are no running interfaces. ieee80211_reconfig tries
to restart STA timers on unassociated state.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/mac80211/mlme.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2200,6 +2200,9 @@ void ieee80211_sta_restart(struct ieee80
{
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+ if (!ifmgd->associated)
+ return;
+
if (test_and_clear_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running))
add_timer(&ifmgd->timer);
if (test_and_clear_bit(TMR_RUNNING_CHANSW, &ifmgd->timers_running))
^ permalink raw reply [flat|nested] 103+ messages in thread
* [036/102] irq_work, ppc: Fix up arch hooks
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (34 preceding siblings ...)
2011-08-03 22:00 ` [035/102] mac80211: Restart STA timers only on associated state Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [037/102] perf tools, x86: Fix 32-bit compile on 64-bit system Greg KH
` (65 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Huang Ying,
Benjamin Herrenschmidt, Anton Blanchard, Eric B Munson,
Peter Zijlstra, Ingo Molnar
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
commit 4f8b50bbbe63ae4ec6bea28a90a9a603c745ea71 upstream.
Commit e360adbe29 ("irq_work: Add generic hardirq context
callbacks") fouled up the ppc bit, not properly naming the
arch specific function that raises the 'self-IPI'.
Cc: Huang Ying <ying.huang@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: Eric B Munson <emunson@mgebm.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-eg0aqien8p1aqvzu9dft6dtv@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/powerpc/kernel/time.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -544,7 +544,7 @@ DEFINE_PER_CPU(u8, irq_work_pending);
#endif /* 32 vs 64 bit */
-void set_irq_work_pending(void)
+void arch_irq_work_raise(void)
{
preempt_disable();
set_irq_work_pending_flag();
^ permalink raw reply [flat|nested] 103+ messages in thread
* [037/102] perf tools, x86: Fix 32-bit compile on 64-bit system
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (35 preceding siblings ...)
2011-08-03 22:00 ` [036/102] irq_work, ppc: Fix up arch hooks Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [038/102] perf tools: Fix endian conversion reading event attr from file header Greg KH
` (64 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, David Ahern,
Frederic Weisbecker, Peter Zijlstra, Ingo Molnar
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Ahern <dsahern@gmail.com>
commit 08a4a43fc407d780bdde36d98f89c0dbb2a6be6b upstream.
Builds for 32-bit perf binaries on a 64-bit host currently fail
with this error:
[...]
bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi'
bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs'
bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi'
bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi'
...
The problem is the detection of the host arch without considering passed in
flags. This change fixes 32-bit builds via:
make EXTRA_CFLAGS=-m32
and 64-bit builds still reference the memcpy_64.S.
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1310420304-21452-1-git-send-email-dsahern@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
tools/perf/Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -52,7 +52,10 @@ ifeq ($(ARCH),i386)
endif
ifeq ($(ARCH),x86_64)
ARCH := x86
- IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
+ IS_X86_64 := 0
+ ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
+ IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
+ endif
ifeq (${IS_X86_64}, 1)
RAW_ARCH := x86_64
ARCH_CFLAGS := -DARCH_X86_64
^ permalink raw reply [flat|nested] 103+ messages in thread
* [038/102] perf tools: Fix endian conversion reading event attr from file header
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (36 preceding siblings ...)
2011-08-03 22:00 ` [037/102] perf tools, x86: Fix 32-bit compile on 64-bit system Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:00 ` [039/102] x86, intel, power: Initialize MSR_IA32_ENERGY_PERF_BIAS Greg KH
` (63 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, David Ahern,
Frederic Weisbecker, acme, peterz, paulus, Ingo Molnar
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Ahern <dsahern@gmail.com>
commit eda3913bb70ecebac13adccffe1e7f96e93cee02 upstream.
The perf_event_attr struct has two __u32's at the top and
they need to be swapped individually.
With this change I was able to analyze a perf.data collected in a
32-bit PPC VM on an x86 system. I tested both 32-bit and 64-bit
binaries for the Intel analysis side; both read the PPC perf.data
file correctly.
-v2:
- changed the existing perf_event__attr_swap() to swap only elements
of perf_event_attr and exported it for use in swapping the
attributes in the file header
- updated swap_ops used for processing events
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: acme@ghostprotocols.net
Cc: peterz@infradead.org
Cc: paulus@samba.org
Link: http://lkml.kernel.org/r/1310754849-12474-1-git-send-email-dsahern@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
tools/perf/util/header.c | 5 ++++-
tools/perf/util/session.c | 30 ++++++++++++++++++------------
tools/perf/util/session.h | 1 +
3 files changed, 23 insertions(+), 13 deletions(-)
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -877,9 +877,12 @@ int perf_session__read_header(struct per
struct perf_evsel *evsel;
off_t tmp;
- if (perf_header__getbuffer64(header, fd, &f_attr, sizeof(f_attr)))
+ if (readn(fd, &f_attr, sizeof(f_attr)) <= 0)
goto out_errno;
+ if (header->needs_swap)
+ perf_event__attr_swap(&f_attr.attr);
+
tmp = lseek(fd, 0, SEEK_CUR);
evsel = perf_evsel__new(&f_attr.attr, i);
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -407,20 +407,26 @@ static void perf_event__read_swap(union
event->read.id = bswap_64(event->read.id);
}
-static void perf_event__attr_swap(union perf_event *event)
+/* exported for swapping attributes in file header */
+void perf_event__attr_swap(struct perf_event_attr *attr)
+{
+ attr->type = bswap_32(attr->type);
+ attr->size = bswap_32(attr->size);
+ attr->config = bswap_64(attr->config);
+ attr->sample_period = bswap_64(attr->sample_period);
+ attr->sample_type = bswap_64(attr->sample_type);
+ attr->read_format = bswap_64(attr->read_format);
+ attr->wakeup_events = bswap_32(attr->wakeup_events);
+ attr->bp_type = bswap_32(attr->bp_type);
+ attr->bp_addr = bswap_64(attr->bp_addr);
+ attr->bp_len = bswap_64(attr->bp_len);
+}
+
+static void perf_event__hdr_attr_swap(union perf_event *event)
{
size_t size;
- event->attr.attr.type = bswap_32(event->attr.attr.type);
- event->attr.attr.size = bswap_32(event->attr.attr.size);
- event->attr.attr.config = bswap_64(event->attr.attr.config);
- event->attr.attr.sample_period = bswap_64(event->attr.attr.sample_period);
- event->attr.attr.sample_type = bswap_64(event->attr.attr.sample_type);
- event->attr.attr.read_format = bswap_64(event->attr.attr.read_format);
- event->attr.attr.wakeup_events = bswap_32(event->attr.attr.wakeup_events);
- event->attr.attr.bp_type = bswap_32(event->attr.attr.bp_type);
- event->attr.attr.bp_addr = bswap_64(event->attr.attr.bp_addr);
- event->attr.attr.bp_len = bswap_64(event->attr.attr.bp_len);
+ perf_event__attr_swap(&event->attr.attr);
size = event->header.size;
size -= (void *)&event->attr.id - (void *)event;
@@ -448,7 +454,7 @@ static perf_event__swap_op perf_event__s
[PERF_RECORD_LOST] = perf_event__all64_swap,
[PERF_RECORD_READ] = perf_event__read_swap,
[PERF_RECORD_SAMPLE] = perf_event__all64_swap,
- [PERF_RECORD_HEADER_ATTR] = perf_event__attr_swap,
+ [PERF_RECORD_HEADER_ATTR] = perf_event__hdr_attr_swap,
[PERF_RECORD_HEADER_EVENT_TYPE] = perf_event__event_type_swap,
[PERF_RECORD_HEADER_TRACING_DATA] = perf_event__tracing_data_swap,
[PERF_RECORD_HEADER_BUILD_ID] = NULL,
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -112,6 +112,7 @@ int perf_session__set_kallsyms_ref_reloc
u64 addr);
void mem_bswap_64(void *src, int byte_size);
+void perf_event__attr_swap(struct perf_event_attr *attr);
int perf_session__create_kernel_maps(struct perf_session *self);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [039/102] x86, intel, power: Initialize MSR_IA32_ENERGY_PERF_BIAS
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (37 preceding siblings ...)
2011-08-03 22:00 ` [038/102] perf tools: Fix endian conversion reading event attr from file header Greg KH
@ 2011-08-03 22:00 ` Greg KH
2011-08-03 22:01 ` [040/102] perf: Fix software event overflow Greg KH
` (62 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:00 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Len Brown, Rafael J. Wysocki,
H. Peter Anvin
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Len Brown <len.brown@intel.com>
commit abe48b108247e9b90b4c6739662a2e5c765ed114 upstream.
Since 2.6.36 (23016bf0d25), Linux prints the existence of "epb" in /proc/cpuinfo,
Since 2.6.38 (d5532ee7b40), the x86_energy_perf_policy(8) utility has
been available in-tree to update MSR_IA32_ENERGY_PERF_BIAS.
However, the typical BIOS fails to initialize the MSR, presumably
because this is handled by high-volume shrink-wrap operating systems...
Linux distros, on the other hand, do not yet invoke x86_energy_perf_policy(8).
As a result, WSM-EP, SNB, and later hardware from Intel will run in its
default hardware power-on state (performance), which assumes that users
care for performance at all costs and not for energy efficiency.
While that is fine for performance benchmarks, the hardware's intended default
operating point is "normal" mode...
Initialize the MSR to the "normal" by default during kernel boot.
x86_energy_perf_policy(8) is available to change the default after boot,
should the user have a different preference.
Signed-off-by: Len Brown <len.brown@intel.com>
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1107140051020.18606@x980
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/include/asm/msr-index.h | 3 +++
arch/x86/kernel/cpu/intel.c | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -259,6 +259,9 @@
#define MSR_IA32_TEMPERATURE_TARGET 0x000001a2
#define MSR_IA32_ENERGY_PERF_BIAS 0x000001b0
+#define ENERGY_PERF_BIAS_PERFORMANCE 0
+#define ENERGY_PERF_BIAS_NORMAL 6
+#define ENERGY_PERF_BIAS_POWERSWAVE 15
#define MSR_IA32_PACKAGE_THERM_STATUS 0x000001b1
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -456,6 +456,24 @@ static void __cpuinit init_intel(struct
if (cpu_has(c, X86_FEATURE_VMX))
detect_vmx_virtcap(c);
+
+ /*
+ * Initialize MSR_IA32_ENERGY_PERF_BIAS if BIOS did not.
+ * x86_energy_perf_policy(8) is available to change it at run-time
+ */
+ if (cpu_has(c, X86_FEATURE_EPB)) {
+ u64 epb;
+
+ rdmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
+ if ((epb & 0xF) == 0) {
+ printk_once(KERN_WARNING, "x86: updated energy_perf_bias"
+ " to 'normal' from 'performance'\n"
+ "You can view and update epb via utility,"
+ " such as x86_energy_perf_policy(8)\n");
+ epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL;
+ wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
+ }
+ }
}
#ifdef CONFIG_X86_32
^ permalink raw reply [flat|nested] 103+ messages in thread
* [040/102] perf: Fix software event overflow
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (38 preceding siblings ...)
2011-08-03 22:00 ` [039/102] x86, intel, power: Initialize MSR_IA32_ENERGY_PERF_BIAS Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [041/102] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
` (61 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable, Vince Weaver
Cc: stable-review, torvalds, akpm, alan, Ingo Molnar, Paul Mackerras,
Arnaldo Carvalho de Melo, Peter Zijlstra
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
The below patch is for -stable only, upstream has a much larger patch
that contains the below hunk in commit a8b0ca17b80e92faab46ee7179ba9e99ccb61233
Vince found that under certain circumstances software event overflows
go wrong and deadlock. Avoid trying to delete a timer from the timer
callback.
Reported-by: Vince Weaver <vweaver1@eecs.utk.edu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/events/core.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5016,11 +5016,8 @@ static int __perf_event_overflow(struct
if (events && atomic_dec_and_test(&event->event_limit)) {
ret = 1;
event->pending_kill = POLL_HUP;
- if (nmi) {
- event->pending_disable = 1;
- irq_work_queue(&event->pending);
- } else
- perf_event_disable(event);
+ event->pending_disable = 1;
+ irq_work_queue(&event->pending);
}
if (event->overflow_handler)
^ permalink raw reply [flat|nested] 103+ messages in thread
* [041/102] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups.
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (39 preceding siblings ...)
2011-08-03 22:01 ` [040/102] perf: Fix software event overflow Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [042/102] [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise Greg KH
` (60 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Werner Fink, Ankit Jain,
James Bottomley
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Werner Fink <werner@novell.com>
commit 82103978189e9731658cd32da5eb85ab7b8542b8 upstream.
This patch resulted from the discussion at
https://bugzilla.novell.com/show_bug.cgi?id=679277,
https://bugzilla.novell.com/show_bug.cgi?id=681840 .
Signed-off-by: Werner Fink <werner@novell.com>
Signed-off-by: Ankit Jain <jankit@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/scsi_devinfo.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -197,6 +197,7 @@ static struct {
{"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"IBM", "2105", NULL, BLIST_RETRY_HWERROR},
{"iomega", "jaz 1GB", "J.86", BLIST_NOTQ | BLIST_NOLUN},
+ {"IOMEGA", "ZIP", NULL, BLIST_NOTQ | BLIST_NOLUN},
{"IOMEGA", "Io20S *F", NULL, BLIST_KEY},
{"INSITE", "Floptical F*8I", NULL, BLIST_KEY},
{"INSITE", "I325VM", NULL, BLIST_KEY},
@@ -243,6 +244,7 @@ static struct {
{"Tornado-", "F4", "*", BLIST_NOREPORTLUN},
{"TOSHIBA", "CDROM", NULL, BLIST_ISROM},
{"TOSHIBA", "CD-ROM", NULL, BLIST_ISROM},
+ {"Traxdata", "CDR4120", NULL, BLIST_NOLUN}, /* locks up */
{"USB2.0", "SMARTMEDIA/XD", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36},
{"WangDAT", "Model 2600", "01.7", BLIST_SELECT_NO_ATN},
{"WangDAT", "Model 3200", "02.2", BLIST_SELECT_NO_ATN},
^ permalink raw reply [flat|nested] 103+ messages in thread
* [042/102] [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (40 preceding siblings ...)
2011-08-03 22:01 ` [041/102] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [043/102] [SCSI] ses: requesting a fault indication Greg KH
` (59 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Kay Sievers, Tejun Heo,
James Bottomley
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kay Sievers <kay.sievers@vrfy.org>
commit 79b9677d885d1a792bc103f2febb06f91f92de43 upstream.
Some broken devices indicates that media has changed on every
GET_EVENT_STATUS_NOTIFICATION. This translates into MEDIA_CHANGE
uevent on every open() which lets udev run into a loop.
Verify GET_EVENT result against TUR and if it generates spurious
events for several times in a row, ignore the GET_EVENT events, and
trust only the TUR status.
This is the log of a USB stick with a (broken) fake CDROM drive:
scsi 5:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 8.02 PQ: 0 ANSI: 0 CCS
sd 5:0:0:0: Attached scsi generic sg3 type 0
scsi 5:0:0:1: CD-ROM SanDisk U3 Cruzer Micro 8.02 PQ: 0 ANSI: 0
sd 5:0:0:0: [sdb] Attached SCSI removable disk
sr2: scsi3-mmc drive: 48x/48x tray
sr 5:0:0:1: Attached scsi CD-ROM sr2
sr 5:0:0:1: Attached scsi generic sg4 type 5
sr2: GET_EVENT and TUR disagree continuously, suppress GET_EVENT events
sd 5:0:0:0: [sdb] 31777279 512-byte logical blocks: (16.2 GB/15.1 GiB)
sd 5:0:0:0: [sdb] No Caching mode page present
sd 5:0:0:0: [sdb] Assuming drive cache: write through
sd 5:0:0:0: [sdb] No Caching mode page present
sd 5:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1
-tj: Updated to consider only spurious GET_EVENT events among
different types of disagreement and allow using TUR for kernel
event polling after GET_EVENT is ignored.
Reported-By: Markus Rathgeb maggu2810@googlemail.com
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/sr.c | 46 ++++++++++++++++++++++++++++++++++++++++++----
drivers/scsi/sr.h | 7 +++++++
2 files changed, 49 insertions(+), 4 deletions(-)
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -221,14 +221,33 @@ static unsigned int sr_check_events(stru
return 0;
events = sr_get_events(cd->device);
+ cd->get_event_changed |= events & DISK_EVENT_MEDIA_CHANGE;
+
+ /*
+ * If earlier GET_EVENT_STATUS_NOTIFICATION and TUR did not agree
+ * for several times in a row. We rely on TUR only for this likely
+ * broken device, to prevent generating incorrect media changed
+ * events for every open().
+ */
+ if (cd->ignore_get_event) {
+ events &= ~DISK_EVENT_MEDIA_CHANGE;
+ goto do_tur;
+ }
+
/*
* GET_EVENT_STATUS_NOTIFICATION is enough unless MEDIA_CHANGE
* is being cleared. Note that there are devices which hang
* if asked to execute TUR repeatedly.
*/
- if (!(clearing & DISK_EVENT_MEDIA_CHANGE))
- goto skip_tur;
+ if (cd->device->changed) {
+ events |= DISK_EVENT_MEDIA_CHANGE;
+ cd->device->changed = 0;
+ cd->tur_changed = true;
+ }
+ if (!(clearing & DISK_EVENT_MEDIA_CHANGE))
+ return events;
+do_tur:
/* let's see whether the media is there with TUR */
last_present = cd->media_present;
ret = scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr);
@@ -242,12 +261,31 @@ static unsigned int sr_check_events(stru
(scsi_sense_valid(&sshdr) && sshdr.asc != 0x3a);
if (last_present != cd->media_present)
- events |= DISK_EVENT_MEDIA_CHANGE;
-skip_tur:
+ cd->device->changed = 1;
+
if (cd->device->changed) {
events |= DISK_EVENT_MEDIA_CHANGE;
cd->device->changed = 0;
+ cd->tur_changed = true;
+ }
+
+ if (cd->ignore_get_event)
+ return events;
+
+ /* check whether GET_EVENT is reporting spurious MEDIA_CHANGE */
+ if (!cd->tur_changed) {
+ if (cd->get_event_changed) {
+ if (cd->tur_mismatch++ > 8) {
+ sdev_printk(KERN_WARNING, cd->device,
+ "GET_EVENT and TUR disagree continuously, suppress GET_EVENT events\n");
+ cd->ignore_get_event = true;
+ }
+ } else {
+ cd->tur_mismatch = 0;
+ }
}
+ cd->tur_changed = false;
+ cd->get_event_changed = false;
return events;
}
--- a/drivers/scsi/sr.h
+++ b/drivers/scsi/sr.h
@@ -41,6 +41,13 @@ typedef struct scsi_cd {
unsigned readcd_known:1; /* drive supports READ_CD (0xbe) */
unsigned readcd_cdda:1; /* reading audio data using READ_CD */
unsigned media_present:1; /* media is present */
+
+ /* GET_EVENT spurious event handling, blk layer guarantees exclusion */
+ int tur_mismatch; /* nr of get_event TUR mismatches */
+ bool tur_changed:1; /* changed according to TUR */
+ bool get_event_changed:1; /* changed according to GET_EVENT */
+ bool ignore_get_event:1; /* GET_EVENT is unreliable, use TUR */
+
struct cdrom_device_info cdi;
/* We hold gendisk and scsi_device references on probe and use
* the refs on this kref to decide when to release them */
^ permalink raw reply [flat|nested] 103+ messages in thread
* [043/102] [SCSI] ses: requesting a fault indication
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (41 preceding siblings ...)
2011-08-03 22:01 ` [042/102] [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [044/102] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
` (58 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Douglas Gilbert,
James Bottomley
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Douglas Gilbert <dgilbert@interlog.com>
commit 2a350cab9daf9a46322d83b091bb05cf54ccf6ab upstream.
Noticed that when the sysfs interface of the SCSI SES
driver was used to request a fault indication the LED
flashed but the buzzer didn't sound. So it was doing
what REQUEST IDENT (locate) should do.
Changelog:
- fix the setting of REQUEST FAULT for the device slot
and array device slot elements in the enclosure control
diagnostic page
- note the potentially defective code that reads the
FAULT SENSED and FAULT REQUESTED bits from the enclosure
status diagnostic page
The attached patch is against git/scsi-misc-2.6
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/ses.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -160,6 +160,10 @@ static unsigned char *ses_get_page2_desc
return NULL;
}
+/* For device slot and array device slot elements, byte 3 bit 6
+ * is "fault sensed" while byte 3 bit 5 is "fault reqstd". As this
+ * code stands these bits are shifted 4 positions right so in
+ * sysfs they will appear as bits 2 and 1 respectively. Strange. */
static void ses_get_fault(struct enclosure_device *edev,
struct enclosure_component *ecomp)
{
@@ -181,7 +185,7 @@ static int ses_set_fault(struct enclosur
/* zero is disabled */
break;
case ENCLOSURE_SETTING_ENABLED:
- desc[2] = 0x02;
+ desc[3] = 0x20;
break;
default:
/* SES doesn't do the SGPIO blink settings */
^ permalink raw reply [flat|nested] 103+ messages in thread
* [044/102] [SCSI] fix crash in scsi_dispatch_cmd()
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (42 preceding siblings ...)
2011-08-03 22:01 ` [043/102] [SCSI] ses: requesting a fault indication Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [045/102] [SCSI] pmcraid: reject negative request size Greg KH
` (57 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, James Bottomley
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: James Bottomley <James.Bottomley@HansenPartnership.com>
commit bfe159a51203c15d23cb3158fffdc25ec4b4dda1 upstream.
USB surprise removal of sr is triggering an oops in
scsi_dispatch_command(). What seems to be happening is that USB is
hanging on to a queue reference until the last close of the upper
device, so the crash is caused by surprise remove of a mounted CD
followed by attempted unmount.
The problem is that USB doesn't issue its final commands as part of
the SCSI teardown path, but on last close when the block queue is long
gone. The long term fix is probably to make sr do the teardown in the
same way as sd (so remove all the lower bits on ejection, but keep the
upper disk alive until last close of user space). However, the
current oops can be simply fixed by not allowing any commands to be
sent to a dead queue.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
block/blk-core.c | 3 +++
block/blk-exec.c | 7 +++++++
drivers/scsi/scsi_lib.c | 2 ++
3 files changed, 12 insertions(+)
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -839,6 +839,9 @@ struct request *blk_get_request(struct r
{
struct request *rq;
+ if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)))
+ return NULL;
+
BUG_ON(rw != READ && rw != WRITE);
spin_lock_irq(q->queue_lock);
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -50,6 +50,13 @@ void blk_execute_rq_nowait(struct reques
{
int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
+ if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) {
+ rq->errors = -ENXIO;
+ if (rq->end_io)
+ rq->end_io(rq, rq->errors);
+ return;
+ }
+
rq->rq_disk = bd_disk;
rq->end_io = done;
WARN_ON(irqs_disabled());
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -213,6 +213,8 @@ int scsi_execute(struct scsi_device *sde
int ret = DRIVER_ERROR << 24;
req = blk_get_request(sdev->request_queue, write, __GFP_WAIT);
+ if (!req)
+ return ret;
if (bufflen && blk_rq_map_kern(sdev->request_queue, req,
buffer, bufflen, __GFP_WAIT))
^ permalink raw reply [flat|nested] 103+ messages in thread
* [045/102] [SCSI] pmcraid: reject negative request size
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (43 preceding siblings ...)
2011-08-03 22:01 ` [044/102] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [046/102] [SCSI] hpsa: do not attempt to read from a write-only register Greg KH
` (56 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Dan Rosenberg,
James Bottomley
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit b5b515445f4f5a905c5dd27e6e682868ccd6c09d upstream.
There's a code path in pmcraid that can be reached via device ioctl that
causes all sorts of ugliness, including heap corruption or triggering the
OOM killer due to consecutive allocation of large numbers of pages.
First, the user can call pmcraid_chr_ioctl(), with a type
PMCRAID_PASSTHROUGH_IOCTL. This calls through to
pmcraid_ioctl_passthrough(). Next, a pmcraid_passthrough_ioctl_buffer
is copied in, and the request_size variable is set to
buffer->ioarcb.data_transfer_length, which is an arbitrary 32-bit
signed value provided by the user. If a negative value is provided
here, bad things can happen. For example,
pmcraid_build_passthrough_ioadls() is called with this request_size,
which immediately calls pmcraid_alloc_sglist() with a negative size.
The resulting math on allocating a scatter list can result in an
overflow in the kzalloc() call (if num_elem is 0, the sglist will be
smaller than expected), or if num_elem is unexpectedly large the
subsequent loop will call alloc_pages() repeatedly, a high number of
pages will be allocated and the OOM killer might be invoked.
It looks like preventing this value from being negative in
pmcraid_ioctl_passthrough() would be sufficient.
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/pmcraid.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3871,6 +3871,9 @@ static long pmcraid_ioctl_passthrough(
pmcraid_err("couldn't build passthrough ioadls\n");
goto out_free_buffer;
}
+ } else if (request_size < 0) {
+ rc = -EINVAL;
+ goto out_free_buffer;
}
/* If data is being written into the device, copy the data from user
^ permalink raw reply [flat|nested] 103+ messages in thread
* [046/102] [SCSI] hpsa: do not attempt to read from a write-only register
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (44 preceding siblings ...)
2011-08-03 22:01 ` [045/102] [SCSI] pmcraid: reject negative request size Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [047/102] drm/radeon/kms: fix i2c map for rv250/280 Greg KH
` (55 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Stephen M. Cameron,
James Bottomley
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
commit fec62c368b9c8b05d5124ca6c3b8336b537f26f3 upstream.
Most smartarrays tolerate it, but a few new ones don't.
Without this change some newer Smart Arrays will lock up
and i/o will grind to a halt.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/hpsa.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -214,7 +214,7 @@ static void SA5_submit_command(struct ct
dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
c->Header.Tag.lower);
writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
- (void) readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+ (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
h->commands_outstanding++;
if (h->commands_outstanding > h->max_outstanding)
h->max_outstanding = h->commands_outstanding;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [047/102] drm/radeon/kms: fix i2c map for rv250/280
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (45 preceding siblings ...)
2011-08-03 22:01 ` [046/102] [SCSI] hpsa: do not attempt to read from a write-only register Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [048/102] drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1 Greg KH
` (54 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alex Deucher, Dave Airlie
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 6dd666333ddee39903d86f870d5c40d9f100e0cc upstream.
Those chips have crt2_ddc bus.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=39672
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/radeon/radeon_combios.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -779,7 +779,8 @@ void radeon_combios_i2c_init(struct rade
}
}
}
- } else if (rdev->family >= CHIP_R200) {
+ } else if ((rdev->family == CHIP_R200) ||
+ (rdev->family >= CHIP_R300)) {
/* 0x68 */
i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
rdev->i2c_bus[3] = radeon_i2c_create(dev, &i2c, "MONID");
^ permalink raw reply [flat|nested] 103+ messages in thread
* [048/102] drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (46 preceding siblings ...)
2011-08-03 22:01 ` [047/102] drm/radeon/kms: fix i2c map for rv250/280 Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [049/102] drm/radeon/kms: add missing vddci setting on NI+ Greg KH
` (53 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jerome Glisse, Dave Airlie
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jerome Glisse <jglisse@redhat.com>
commit 5a96a899bbdee86024ab9ea6d02b9e242faacbed upstream.
DPEncoderService newer than 1.1 can't properly program the DP (display port)
link training. When facing such version use the DIGxEncoderControl method
instead. Fix DP link training on some R7XX.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/radeon/atombios_dp.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -627,6 +627,7 @@ struct radeon_dp_link_train_info {
u8 train_set[4];
u8 link_status[DP_LINK_STATUS_SIZE];
u8 tries;
+ bool use_dpencoder;
};
static void radeon_dp_update_vs_emph(struct radeon_dp_link_train_info *dp_info)
@@ -646,7 +647,7 @@ static void radeon_dp_set_tp(struct rade
int rtp = 0;
/* set training pattern on the source */
- if (ASIC_IS_DCE4(dp_info->rdev)) {
+ if (ASIC_IS_DCE4(dp_info->rdev) || !dp_info->use_dpencoder) {
switch (tp) {
case DP_TRAINING_PATTERN_1:
rtp = ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN1;
@@ -706,7 +707,7 @@ static int radeon_dp_link_train_init(str
radeon_write_dpcd_reg(dp_info->radeon_connector, DP_LINK_BW_SET, tmp);
/* start training on the source */
- if (ASIC_IS_DCE4(dp_info->rdev))
+ if (ASIC_IS_DCE4(dp_info->rdev) || !dp_info->use_dpencoder)
atombios_dig_encoder_setup(dp_info->encoder,
ATOM_ENCODER_CMD_DP_LINK_TRAINING_START, 0);
else
@@ -731,7 +732,7 @@ static int radeon_dp_link_train_finish(s
DP_TRAINING_PATTERN_DISABLE);
/* disable the training pattern on the source */
- if (ASIC_IS_DCE4(dp_info->rdev))
+ if (ASIC_IS_DCE4(dp_info->rdev) || !dp_info->use_dpencoder)
atombios_dig_encoder_setup(dp_info->encoder,
ATOM_ENCODER_CMD_DP_LINK_TRAINING_COMPLETE, 0);
else
@@ -869,7 +870,8 @@ void radeon_dp_link_train(struct drm_enc
struct radeon_connector *radeon_connector;
struct radeon_connector_atom_dig *dig_connector;
struct radeon_dp_link_train_info dp_info;
- u8 tmp;
+ int index;
+ u8 tmp, frev, crev;
if (!radeon_encoder->enc_priv)
return;
@@ -884,6 +886,18 @@ void radeon_dp_link_train(struct drm_enc
(dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_eDP))
return;
+ /* DPEncoderService newer than 1.1 can't program properly the
+ * training pattern. When facing such version use the
+ * DIGXEncoderControl (X== 1 | 2)
+ */
+ dp_info.use_dpencoder = true;
+ index = GetIndexIntoMasterTable(COMMAND, DPEncoderService);
+ if (atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) {
+ if (crev > 1) {
+ dp_info.use_dpencoder = false;
+ }
+ }
+
dp_info.enc_id = 0;
if (dig->dig_encoder)
dp_info.enc_id |= ATOM_DP_CONFIG_DIG2_ENCODER;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [049/102] drm/radeon/kms: add missing vddci setting on NI+
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (47 preceding siblings ...)
2011-08-03 22:01 ` [048/102] drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1 Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [050/102] ALSA: virtuoso: fix silent analog output on Xonar Essence ST Deluxe Greg KH
` (52 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alex Deucher, Dave Airlie
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 4639dd21e759e32125adc7171abf6cb8140d54cf upstream.
Need to add vddci setting to pm init as well as
resume. Fixes hangs on load on some boards.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=38754
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/radeon/radeon_pm.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -594,6 +594,9 @@ int radeon_pm_init(struct radeon_device
if (rdev->pm.default_vddc)
radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
SET_VOLTAGE_TYPE_ASIC_VDDC);
+ if (rdev->pm.default_vddci)
+ radeon_atom_set_voltage(rdev, rdev->pm.default_vddci,
+ SET_VOLTAGE_TYPE_ASIC_VDDCI);
if (rdev->pm.default_sclk)
radeon_set_engine_clock(rdev, rdev->pm.default_sclk);
if (rdev->pm.default_mclk)
^ permalink raw reply [flat|nested] 103+ messages in thread
* [050/102] ALSA: virtuoso: fix silent analog output on Xonar Essence ST Deluxe
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (48 preceding siblings ...)
2011-08-03 22:01 ` [049/102] drm/radeon/kms: add missing vddci setting on NI+ Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [051/102] ALSA: hda - Fix duplicated DAC assignments for Realtek Greg KH
` (51 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Clemens Ladisch
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <clemens@ladisch.de>
commit c81c6b356b52d3fcb4d531d149573fc100aad643 upstream.
Commit dd203fa97bd5 (ALSA: virtuoso: remove non-working controls on
Essence ST Deluxe) made it impossible to adjust the volume after the
driver initialized it to muted.
Ensure that those DACs that can be accessed with I2C are initialized
to the same volume that is the reset default of the DAC without I2C.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/pci/oxygen/xonar_pcm179x.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/sound/pci/oxygen/xonar_pcm179x.c
+++ b/sound/pci/oxygen/xonar_pcm179x.c
@@ -327,8 +327,10 @@ static void pcm1796_init(struct oxygen *
{
struct xonar_pcm179x *data = chip->model_data;
- data->pcm1796_regs[0][18 - PCM1796_REG_BASE] = PCM1796_MUTE |
+ data->pcm1796_regs[0][18 - PCM1796_REG_BASE] =
PCM1796_DMF_DISABLED | PCM1796_FMT_24_I2S | PCM1796_ATLD;
+ if (!data->broken_i2c)
+ data->pcm1796_regs[0][18 - PCM1796_REG_BASE] |= PCM1796_MUTE;
data->pcm1796_regs[0][19 - PCM1796_REG_BASE] =
PCM1796_FLT_SHARP | PCM1796_ATS_1;
data->pcm1796_regs[0][20 - PCM1796_REG_BASE] =
@@ -1123,6 +1125,7 @@ int __devinit get_xonar_pcm179x_model(st
chip->model.control_filter = xonar_st_h6_control_filter;
chip->model.dac_channels_pcm = 8;
chip->model.dac_channels_mixer = 8;
+ chip->model.dac_volume_min = 255;
chip->model.dac_mclks = OXYGEN_MCLKS(256, 128, 128);
break;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [051/102] ALSA: hda - Fix duplicated DAC assignments for Realtek
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (49 preceding siblings ...)
2011-08-03 22:01 ` [050/102] ALSA: virtuoso: fix silent analog output on Xonar Essence ST Deluxe Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [052/102] pnfs: save layoutcommit lwb at layout header Greg KH
` (50 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Takashi Iwai
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit c48a8fb0d31d6147d8d76b8e2ad7f51a2fbb5c4d upstream.
Copying hp_pins and speaker_pins from line_out_pins may confuse the
parser, and it can lead to duplicated initializations for the same pin
with a wrong DAC assignment. The problem appears in 3.0 kernel code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/pci/hda/patch_realtek.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1578,13 +1578,15 @@ static void alc_init_auto_hp(struct hda_
if (present == 3)
spec->automute_hp_lo = 1; /* both HP and LO automute */
- if (!cfg->speaker_pins[0]) {
+ if (!cfg->speaker_pins[0] &&
+ cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
memcpy(cfg->speaker_pins, cfg->line_out_pins,
sizeof(cfg->speaker_pins));
cfg->speaker_outs = cfg->line_outs;
}
- if (!cfg->hp_pins[0]) {
+ if (!cfg->hp_pins[0] &&
+ cfg->line_out_type == AUTO_PIN_HP_OUT) {
memcpy(cfg->hp_pins, cfg->line_out_pins,
sizeof(cfg->hp_pins));
cfg->hp_outs = cfg->line_outs;
@@ -1603,6 +1605,7 @@ static void alc_init_auto_hp(struct hda_
spec->automute_mode = ALC_AUTOMUTE_PIN;
}
if (spec->automute && cfg->line_out_pins[0] &&
+ cfg->speaker_pins[0] &&
cfg->line_out_pins[0] != cfg->hp_pins[0] &&
cfg->line_out_pins[0] != cfg->speaker_pins[0]) {
for (i = 0; i < cfg->line_outs; i++) {
^ permalink raw reply [flat|nested] 103+ messages in thread
* [052/102] pnfs: save layoutcommit lwb at layout header
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (50 preceding siblings ...)
2011-08-03 22:01 ` [051/102] ALSA: hda - Fix duplicated DAC assignments for Realtek Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [053/102] pnfs: save layoutcommit cred at layout header init Greg KH
` (49 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Peng Tao, Jim Rees,
Trond Myklebust
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peng Tao <bergwolf@gmail.com>
commit acff5880539fe33897d016c0f3dcf062e67c61b6 upstream.
No need to save it for every lseg.
[Needed in v3.0]
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfs/nfs4filelayout.c | 2 +-
fs/nfs/pnfs.c | 10 ++++++----
fs/nfs/pnfs.h | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -170,7 +170,7 @@ filelayout_set_layoutcommit(struct nfs_w
pnfs_set_layoutcommit(wdata);
dprintk("%s ionde %lu pls_end_pos %lu\n", __func__, wdata->inode->i_ino,
- (unsigned long) wdata->lseg->pls_end_pos);
+ (unsigned long) NFS_I(wdata->inode)->layout->plh_lwb);
}
/*
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1224,9 +1224,11 @@ pnfs_set_layoutcommit(struct nfs_write_d
dprintk("%s: Set layoutcommit for inode %lu ",
__func__, wdata->inode->i_ino);
}
- if (end_pos > wdata->lseg->pls_end_pos)
- wdata->lseg->pls_end_pos = end_pos;
+ if (end_pos > nfsi->layout->plh_lwb)
+ nfsi->layout->plh_lwb = end_pos;
spin_unlock(&nfsi->vfs_inode.i_lock);
+ dprintk("%s: lseg %p end_pos %llu\n",
+ __func__, wdata->lseg, nfsi->layout->plh_lwb);
/* if pnfs_layoutcommit_inode() runs between inode locks, the next one
* will be a noop because NFS_INO_LAYOUTCOMMIT will not be set */
@@ -1278,9 +1280,9 @@ pnfs_layoutcommit_inode(struct inode *in
*/
lseg = pnfs_list_write_lseg(inode);
- end_pos = lseg->pls_end_pos;
+ end_pos = nfsi->layout->plh_lwb;
cred = lseg->pls_lc_cred;
- lseg->pls_end_pos = 0;
+ nfsi->layout->plh_lwb = 0;
lseg->pls_lc_cred = NULL;
memcpy(&data->args.stateid.data, nfsi->layout->plh_stateid.data,
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -45,7 +45,6 @@ struct pnfs_layout_segment {
unsigned long pls_flags;
struct pnfs_layout_hdr *pls_layout;
struct rpc_cred *pls_lc_cred; /* LAYOUTCOMMIT credential */
- loff_t pls_end_pos; /* LAYOUTCOMMIT write end */
};
enum pnfs_try_status {
@@ -124,6 +123,7 @@ struct pnfs_layout_hdr {
unsigned long plh_block_lgets; /* block LAYOUTGET if >0 */
u32 plh_barrier; /* ignore lower seqids */
unsigned long plh_flags;
+ loff_t plh_lwb; /* last write byte for layoutcommit */
struct inode *plh_inode;
};
^ permalink raw reply [flat|nested] 103+ messages in thread
* [053/102] pnfs: save layoutcommit cred at layout header init
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (51 preceding siblings ...)
2011-08-03 22:01 ` [052/102] pnfs: save layoutcommit lwb at layout header Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [054/102] pnfs: let layoutcommit handle a list of lseg Greg KH
` (48 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Peng Tao, Boaz Harrosh,
Jim Rees, Trond Myklebust
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peng Tao <bergwolf@gmail.com>
commit 9fa4075878a5faac872a63f4a97ce79c776264e9 upstream.
No need to save it for every lseg.
No need to save it at every pnfs_set_layoutcommit.
[Needed in v3.0]
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfs/pnfs.c | 21 +++++++++++----------
fs/nfs/pnfs.h | 2 +-
2 files changed, 12 insertions(+), 11 deletions(-)
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -189,6 +189,7 @@ static void
pnfs_free_layout_hdr(struct pnfs_layout_hdr *lo)
{
struct pnfs_layoutdriver_type *ld = NFS_SERVER(lo->plh_inode)->pnfs_curr_ld;
+ put_rpccred(lo->plh_lc_cred);
return ld->alloc_layout_hdr ? ld->free_layout_hdr(lo) : kfree(lo);
}
@@ -805,7 +806,9 @@ out:
}
static struct pnfs_layout_hdr *
-alloc_init_layout_hdr(struct inode *ino, gfp_t gfp_flags)
+alloc_init_layout_hdr(struct inode *ino,
+ struct nfs_open_context *ctx,
+ gfp_t gfp_flags)
{
struct pnfs_layout_hdr *lo;
@@ -817,11 +820,14 @@ alloc_init_layout_hdr(struct inode *ino,
INIT_LIST_HEAD(&lo->plh_segs);
INIT_LIST_HEAD(&lo->plh_bulk_recall);
lo->plh_inode = ino;
+ lo->plh_lc_cred = get_rpccred(ctx->state->owner->so_cred);
return lo;
}
static struct pnfs_layout_hdr *
-pnfs_find_alloc_layout(struct inode *ino, gfp_t gfp_flags)
+pnfs_find_alloc_layout(struct inode *ino,
+ struct nfs_open_context *ctx,
+ gfp_t gfp_flags)
{
struct nfs_inode *nfsi = NFS_I(ino);
struct pnfs_layout_hdr *new = NULL;
@@ -836,7 +842,7 @@ pnfs_find_alloc_layout(struct inode *ino
return nfsi->layout;
}
spin_unlock(&ino->i_lock);
- new = alloc_init_layout_hdr(ino, gfp_flags);
+ new = alloc_init_layout_hdr(ino, ctx, gfp_flags);
spin_lock(&ino->i_lock);
if (likely(nfsi->layout == NULL)) /* Won the race? */
@@ -928,7 +934,7 @@ pnfs_update_layout(struct inode *ino,
if (!pnfs_enabled_sb(NFS_SERVER(ino)))
return NULL;
spin_lock(&ino->i_lock);
- lo = pnfs_find_alloc_layout(ino, gfp_flags);
+ lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags);
if (lo == NULL) {
dprintk("%s ERROR: can't get pnfs_layout_hdr\n", __func__);
goto out_unlock;
@@ -1218,8 +1224,6 @@ pnfs_set_layoutcommit(struct nfs_write_d
if (!test_and_set_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) {
/* references matched in nfs4_layoutcommit_release */
get_lseg(wdata->lseg);
- wdata->lseg->pls_lc_cred =
- get_rpccred(wdata->args.context->state->owner->so_cred);
mark_as_dirty = true;
dprintk("%s: Set layoutcommit for inode %lu ",
__func__, wdata->inode->i_ino);
@@ -1251,7 +1255,6 @@ pnfs_layoutcommit_inode(struct inode *in
struct nfs4_layoutcommit_data *data;
struct nfs_inode *nfsi = NFS_I(inode);
struct pnfs_layout_segment *lseg;
- struct rpc_cred *cred;
loff_t end_pos;
int status = 0;
@@ -1281,9 +1284,7 @@ pnfs_layoutcommit_inode(struct inode *in
lseg = pnfs_list_write_lseg(inode);
end_pos = nfsi->layout->plh_lwb;
- cred = lseg->pls_lc_cred;
nfsi->layout->plh_lwb = 0;
- lseg->pls_lc_cred = NULL;
memcpy(&data->args.stateid.data, nfsi->layout->plh_stateid.data,
sizeof(nfsi->layout->plh_stateid.data));
@@ -1291,7 +1292,7 @@ pnfs_layoutcommit_inode(struct inode *in
data->args.inode = inode;
data->lseg = lseg;
- data->cred = cred;
+ data->cred = get_rpccred(nfsi->layout->plh_lc_cred);
nfs_fattr_init(&data->fattr);
data->args.bitmask = NFS_SERVER(inode)->cache_consistency_bitmask;
data->res.fattr = &data->fattr;
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -44,7 +44,6 @@ struct pnfs_layout_segment {
atomic_t pls_refcount;
unsigned long pls_flags;
struct pnfs_layout_hdr *pls_layout;
- struct rpc_cred *pls_lc_cred; /* LAYOUTCOMMIT credential */
};
enum pnfs_try_status {
@@ -124,6 +123,7 @@ struct pnfs_layout_hdr {
u32 plh_barrier; /* ignore lower seqids */
unsigned long plh_flags;
loff_t plh_lwb; /* last write byte for layoutcommit */
+ struct rpc_cred *plh_lc_cred; /* layoutcommit cred */
struct inode *plh_inode;
};
^ permalink raw reply [flat|nested] 103+ messages in thread
* [054/102] pnfs: let layoutcommit handle a list of lseg
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (52 preceding siblings ...)
2011-08-03 22:01 ` [053/102] pnfs: save layoutcommit cred at layout header init Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [055/102] pnfs: use lwb as layoutcommit length Greg KH
` (47 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Peng Tao, Boaz Harrosh,
Jim Rees, Trond Myklebust
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peng Tao <peng_tao@emc.com>
commit a9bae5666d0510ad69bdb437371c9a3e6b770705 upstream.
There can be multiple lseg per file, so layoutcommit should be
able to handle it.
[Needed in v3.0]
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfs/nfs4proc.c | 8 +++++++-
fs/nfs/pnfs.c | 32 ++++++++++++++++----------------
fs/nfs/pnfs.h | 2 ++
include/linux/nfs_xdr.h | 2 +-
4 files changed, 26 insertions(+), 18 deletions(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5850,9 +5850,15 @@ nfs4_layoutcommit_done(struct rpc_task *
static void nfs4_layoutcommit_release(void *calldata)
{
struct nfs4_layoutcommit_data *data = calldata;
+ struct pnfs_layout_segment *lseg, *tmp;
/* Matched by references in pnfs_set_layoutcommit */
- put_lseg(data->lseg);
+ list_for_each_entry_safe(lseg, tmp, &data->lseg_list, pls_lc_list) {
+ list_del_init(&lseg->pls_lc_list);
+ if (test_and_clear_bit(NFS_LSEG_LAYOUTCOMMIT,
+ &lseg->pls_flags))
+ put_lseg(lseg);
+ }
put_rpccred(data->cred);
kfree(data);
}
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -224,6 +224,7 @@ static void
init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg)
{
INIT_LIST_HEAD(&lseg->pls_list);
+ INIT_LIST_HEAD(&lseg->pls_lc_list);
atomic_set(&lseg->pls_refcount, 1);
smp_mb();
set_bit(NFS_LSEG_VALID, &lseg->pls_flags);
@@ -1201,16 +1202,17 @@ pnfs_try_to_read_data(struct nfs_read_da
}
/*
- * Currently there is only one (whole file) write lseg.
+ * There can be multiple RW segments.
*/
-static struct pnfs_layout_segment *pnfs_list_write_lseg(struct inode *inode)
+static void pnfs_list_write_lseg(struct inode *inode, struct list_head *listp)
{
- struct pnfs_layout_segment *lseg, *rv = NULL;
+ struct pnfs_layout_segment *lseg;
- list_for_each_entry(lseg, &NFS_I(inode)->layout->plh_segs, pls_list)
- if (lseg->pls_range.iomode == IOMODE_RW)
- rv = lseg;
- return rv;
+ list_for_each_entry(lseg, &NFS_I(inode)->layout->plh_segs, pls_list) {
+ if (lseg->pls_range.iomode == IOMODE_RW &&
+ test_bit(NFS_LSEG_LAYOUTCOMMIT, &lseg->pls_flags))
+ list_add(&lseg->pls_lc_list, listp);
+ }
}
void
@@ -1222,12 +1224,14 @@ pnfs_set_layoutcommit(struct nfs_write_d
spin_lock(&nfsi->vfs_inode.i_lock);
if (!test_and_set_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) {
- /* references matched in nfs4_layoutcommit_release */
- get_lseg(wdata->lseg);
mark_as_dirty = true;
dprintk("%s: Set layoutcommit for inode %lu ",
__func__, wdata->inode->i_ino);
}
+ if (!test_and_set_bit(NFS_LSEG_LAYOUTCOMMIT, &wdata->lseg->pls_flags)) {
+ /* references matched in nfs4_layoutcommit_release */
+ get_lseg(wdata->lseg);
+ }
if (end_pos > nfsi->layout->plh_lwb)
nfsi->layout->plh_lwb = end_pos;
spin_unlock(&nfsi->vfs_inode.i_lock);
@@ -1254,7 +1258,6 @@ pnfs_layoutcommit_inode(struct inode *in
{
struct nfs4_layoutcommit_data *data;
struct nfs_inode *nfsi = NFS_I(inode);
- struct pnfs_layout_segment *lseg;
loff_t end_pos;
int status = 0;
@@ -1271,17 +1274,15 @@ pnfs_layoutcommit_inode(struct inode *in
goto out;
}
+ INIT_LIST_HEAD(&data->lseg_list);
spin_lock(&inode->i_lock);
if (!test_and_clear_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) {
spin_unlock(&inode->i_lock);
kfree(data);
goto out;
}
- /*
- * Currently only one (whole file) write lseg which is referenced
- * in pnfs_set_layoutcommit and will be found.
- */
- lseg = pnfs_list_write_lseg(inode);
+
+ pnfs_list_write_lseg(inode, &data->lseg_list);
end_pos = nfsi->layout->plh_lwb;
nfsi->layout->plh_lwb = 0;
@@ -1291,7 +1292,6 @@ pnfs_layoutcommit_inode(struct inode *in
spin_unlock(&inode->i_lock);
data->args.inode = inode;
- data->lseg = lseg;
data->cred = get_rpccred(nfsi->layout->plh_lc_cred);
nfs_fattr_init(&data->fattr);
data->args.bitmask = NFS_SERVER(inode)->cache_consistency_bitmask;
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -36,10 +36,12 @@
enum {
NFS_LSEG_VALID = 0, /* cleared when lseg is recalled/returned */
NFS_LSEG_ROC, /* roc bit received from server */
+ NFS_LSEG_LAYOUTCOMMIT, /* layoutcommit bit set for layoutcommit */
};
struct pnfs_layout_segment {
struct list_head pls_list;
+ struct list_head pls_lc_list;
struct pnfs_layout_range pls_range;
atomic_t pls_refcount;
unsigned long pls_flags;
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -262,7 +262,7 @@ struct nfs4_layoutcommit_res {
struct nfs4_layoutcommit_data {
struct rpc_task task;
struct nfs_fattr fattr;
- struct pnfs_layout_segment *lseg;
+ struct list_head lseg_list;
struct rpc_cred *cred;
struct nfs4_layoutcommit_args args;
struct nfs4_layoutcommit_res res;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [055/102] pnfs: use lwb as layoutcommit length
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (53 preceding siblings ...)
2011-08-03 22:01 ` [054/102] pnfs: let layoutcommit handle a list of lseg Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [056/102] kexec, x86: Fix incorrect jump back address if not preserving context Greg KH
` (46 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Peng Tao, Jim Rees,
Trond Myklebust
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peng Tao <bergwolf@gmail.com>
commit 3557c6c3be5b2ca0b11365db7f8a813253eb520b upstream.
Using NFS4_MAX_UINT64 will break current protocol.
[Needed in v3.0]
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfs/nfs4xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1888,7 +1888,7 @@ encode_layoutcommit(struct xdr_stream *x
*p++ = cpu_to_be32(OP_LAYOUTCOMMIT);
/* Only whole file layouts */
p = xdr_encode_hyper(p, 0); /* offset */
- p = xdr_encode_hyper(p, NFS4_MAX_UINT64); /* length */
+ p = xdr_encode_hyper(p, args->lastbytewritten + 1); /* length */
*p++ = cpu_to_be32(0); /* reclaim */
p = xdr_encode_opaque_fixed(p, args->stateid.data, NFS4_STATEID_SIZE);
*p++ = cpu_to_be32(1); /* newoffset = TRUE */
^ permalink raw reply [flat|nested] 103+ messages in thread
* [056/102] kexec, x86: Fix incorrect jump back address if not preserving context
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (54 preceding siblings ...)
2011-08-03 22:01 ` [055/102] pnfs: use lwb as layoutcommit length Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [057/102] oprofile, x86: Fix nmi-unsafe callgraph support Greg KH
` (45 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Huang Ying,
Eric W. Biederman, Vivek Goyal, Ingo Molnar
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Huang Ying <ying.huang@intel.com>
commit 050438ed5a05b25cdf287f5691e56a58c2606997 upstream.
In kexec jump support, jump back address passed to the kexeced
kernel via function calling ABI, that is, the function call
return address is the jump back entry.
Furthermore, jump back entry == 0 should be used to signal that
the jump back or preserve context is not enabled in the original
kernel.
But in the current implementation the stack position used for
function call return address is not cleared context
preservation is disabled. The patch fixes this bug.
Reported-and-tested-by: Yin Kangkai <kangkai.yin@intel.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Link: http://lkml.kernel.org/r/1310607277-25029-1-git-send-email-ying.huang@intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kernel/relocate_kernel_32.S | 2 ++
arch/x86/kernel/relocate_kernel_64.S | 2 ++
2 files changed, 4 insertions(+)
--- a/arch/x86/kernel/relocate_kernel_32.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
@@ -97,6 +97,8 @@ relocate_kernel:
ret
identity_mapped:
+ /* set return address to 0 if not preserving context */
+ pushl $0
/* store the start address on the stack */
pushl %edx
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -100,6 +100,8 @@ relocate_kernel:
ret
identity_mapped:
+ /* set return address to 0 if not preserving context */
+ pushq $0
/* store the start address on the stack */
pushq %rdx
^ permalink raw reply [flat|nested] 103+ messages in thread
* [057/102] oprofile, x86: Fix nmi-unsafe callgraph support
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (55 preceding siblings ...)
2011-08-03 22:01 ` [056/102] kexec, x86: Fix incorrect jump back address if not preserving context Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [058/102] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
` (44 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, John Lumby, Maynard Johnson,
Robert Richter
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Robert Richter <robert.richter@amd.com>
commit a0e3e70243f5b270bc3eca718f0a9fa5e6b8262e upstream.
Current oprofile's x86 callgraph support may trigger page faults
throwing the BUG_ON(in_nmi()) message below. This patch fixes this by
using the same nmi-safe copy-from-user code as in perf.
------------[ cut here ]------------
kernel BUG at .../arch/x86/kernel/traps.c:436!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/devices/pci0000:00/0000:00:0a.0/0000:07:00.0/0000:08:04.0/net/eth0/broadcast
CPU 5
Modules linked in:
Pid: 8611, comm: opcontrol Not tainted 2.6.39-00007-gfe47ae7 #1 Advanced Micro Device Anaheim/Anaheim
RIP: 0010:[<ffffffff813e8e35>] [<ffffffff813e8e35>] do_nmi+0x22/0x1ee
RSP: 0000:ffff88042fd47f28 EFLAGS: 00010002
RAX: ffff88042c0a7fd8 RBX: 0000000000000001 RCX: 00000000c0000101
RDX: 00000000ffff8804 RSI: ffffffffffffffff RDI: ffff88042fd47f58
RBP: ffff88042fd47f48 R08: 0000000000000004 R09: 0000000000001484
R10: 0000000000000001 R11: 0000000000000000 R12: ffff88042fd47f58
R13: 0000000000000000 R14: ffff88042fd47d98 R15: 0000000000000020
FS: 00007fca25e56700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000074 CR3: 000000042d28b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process opcontrol (pid: 8611, threadinfo ffff88042c0a6000, task ffff88042c532310)
Stack:
0000000000000000 0000000000000001 ffff88042c0a7fd8 0000000000000000
ffff88042fd47de8 ffffffff813e897a 0000000000000020 ffff88042fd47d98
0000000000000000 ffff88042c0a7fd8 ffff88042fd47de8 0000000000000074
Call Trace:
<NMI>
[<ffffffff813e897a>] nmi+0x1a/0x20
[<ffffffff813f08ab>] ? bad_to_user+0x25/0x771
<<EOE>>
Code: ff 59 5b 41 5c 41 5d c9 c3 55 65 48 8b 04 25 88 b5 00 00 48 89 e5 41 55 41 54 49 89 fc 53 48 83 ec 08 f6 80 47 e0 ff ff 04 74 04 <0f> 0b eb fe 81 80 44 e0 ff ff 00 00 01 04 65 ff 04 25 c4 0f 01
RIP [<ffffffff813e8e35>] do_nmi+0x22/0x1ee
RSP <ffff88042fd47f28>
---[ end trace ed6752185092104b ]---
Kernel panic - not syncing: Fatal exception in interrupt
Pid: 8611, comm: opcontrol Tainted: G D 2.6.39-00007-gfe47ae7 #1
Call Trace:
<NMI> [<ffffffff813e5e0a>] panic+0x8c/0x188
[<ffffffff813e915c>] oops_end+0x81/0x8e
[<ffffffff8100403d>] die+0x55/0x5e
[<ffffffff813e8c45>] do_trap+0x11c/0x12b
[<ffffffff810023c8>] do_invalid_op+0x91/0x9a
[<ffffffff813e8e35>] ? do_nmi+0x22/0x1ee
[<ffffffff8131e6fa>] ? oprofile_add_sample+0x83/0x95
[<ffffffff81321670>] ? op_amd_check_ctrs+0x4f/0x2cf
[<ffffffff813ee4d5>] invalid_op+0x15/0x20
[<ffffffff813e8e35>] ? do_nmi+0x22/0x1ee
[<ffffffff813e8e7a>] ? do_nmi+0x67/0x1ee
[<ffffffff813e897a>] nmi+0x1a/0x20
[<ffffffff813f08ab>] ? bad_to_user+0x25/0x771
<<EOE>>
Cc: John Lumby <johnlumby@hotmail.com>
Cc: Maynard Johnson <maynardj@us.ibm.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/oprofile/backtrace.c | 56 +++++++++++++++++++++++++++++++++++-------
1 file changed, 47 insertions(+), 9 deletions(-)
--- a/arch/x86/oprofile/backtrace.c
+++ b/arch/x86/oprofile/backtrace.c
@@ -11,10 +11,12 @@
#include <linux/oprofile.h>
#include <linux/sched.h>
#include <linux/mm.h>
+#include <linux/compat.h>
+#include <linux/highmem.h>
+
#include <asm/ptrace.h>
#include <asm/uaccess.h>
#include <asm/stacktrace.h>
-#include <linux/compat.h>
static int backtrace_stack(void *data, char *name)
{
@@ -36,17 +38,53 @@ static struct stacktrace_ops backtrace_o
.walk_stack = print_context_stack,
};
+/* from arch/x86/kernel/cpu/perf_event.c: */
+
+/*
+ * best effort, GUP based copy_from_user() that assumes IRQ or NMI context
+ */
+static unsigned long
+copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
+{
+ unsigned long offset, addr = (unsigned long)from;
+ unsigned long size, len = 0;
+ struct page *page;
+ void *map;
+ int ret;
+
+ do {
+ ret = __get_user_pages_fast(addr, 1, 0, &page);
+ if (!ret)
+ break;
+
+ offset = addr & (PAGE_SIZE - 1);
+ size = min(PAGE_SIZE - offset, n - len);
+
+ map = kmap_atomic(page);
+ memcpy(to, map+offset, size);
+ kunmap_atomic(map);
+ put_page(page);
+
+ len += size;
+ to += size;
+ addr += size;
+
+ } while (len < n);
+
+ return len;
+}
+
#ifdef CONFIG_COMPAT
static struct stack_frame_ia32 *
dump_user_backtrace_32(struct stack_frame_ia32 *head)
{
+ /* Also check accessibility of one struct frame_head beyond: */
struct stack_frame_ia32 bufhead[2];
struct stack_frame_ia32 *fp;
+ unsigned long bytes;
- /* Also check accessibility of one struct frame_head beyond */
- if (!access_ok(VERIFY_READ, head, sizeof(bufhead)))
- return NULL;
- if (__copy_from_user_inatomic(bufhead, head, sizeof(bufhead)))
+ bytes = copy_from_user_nmi(bufhead, head, sizeof(bufhead));
+ if (bytes != sizeof(bufhead))
return NULL;
fp = (struct stack_frame_ia32 *) compat_ptr(bufhead[0].next_frame);
@@ -87,12 +125,12 @@ x86_backtrace_32(struct pt_regs * const
static struct stack_frame *dump_user_backtrace(struct stack_frame *head)
{
+ /* Also check accessibility of one struct frame_head beyond: */
struct stack_frame bufhead[2];
+ unsigned long bytes;
- /* Also check accessibility of one struct stack_frame beyond */
- if (!access_ok(VERIFY_READ, head, sizeof(bufhead)))
- return NULL;
- if (__copy_from_user_inatomic(bufhead, head, sizeof(bufhead)))
+ bytes = copy_from_user_nmi(bufhead, head, sizeof(bufhead));
+ if (bytes != sizeof(bufhead))
return NULL;
oprofile_add_trace(bufhead[0].return_address);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [058/102] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (56 preceding siblings ...)
2011-08-03 22:01 ` [057/102] oprofile, x86: Fix nmi-unsafe callgraph support Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [059/102] irq_work, alpha: Fix up arch hooks Greg KH
` (43 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Anton Blanchard,
Michael Neuling, Benjamin Herrenschmidt
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Neuling <mikey@neuling.org>
commit 63f21a56f1cc0b800a4c00349c59448f82473d19 upstream.
The existing code it pretty ugly. How about we clean it up even more
like this?
From: Anton Blanchard <anton@samba.org>
We check for timeout expiry in the outer loop, but we also need to
check it in the inner loop or we can lock up forever waiting for a
CPU to hit real mode.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/powerpc/kernel/crash.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -242,12 +242,8 @@ static void crash_kexec_wait_realmode(in
while (paca[i].kexec_state < KEXEC_STATE_REAL_MODE) {
barrier();
- if (!cpu_possible(i)) {
+ if (!cpu_possible(i) || !cpu_online(i) || (msecs <= 0))
break;
- }
- if (!cpu_online(i)) {
- break;
- }
msecs--;
mdelay(1);
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [059/102] irq_work, alpha: Fix up arch hooks
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (57 preceding siblings ...)
2011-08-03 22:01 ` [058/102] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [060/102] tracing: Fix bug when reading system filters on module removal Greg KH
` (42 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Peter Zijlstra, Michael Cree,
Ingo Molnar
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
commit 0f933625e7b6c3d91878ae95e341bf1984db7eaf upstream.
Commit e360adbe29 ("irq_work: Add generic hardirq context
callbacks") fouled up the Alpha bit, not properly naming the
arch specific function that raises the 'self-IPI'.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Michael Cree <mcree@orcon.net.nz>
Link: http://lkml.kernel.org/n/tip-gukh0txmql2l4thgrekzzbfy@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/alpha/kernel/time.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -91,7 +91,7 @@ DEFINE_PER_CPU(u8, irq_work_pending);
#define test_irq_work_pending() __get_cpu_var(irq_work_pending)
#define clear_irq_work_pending() __get_cpu_var(irq_work_pending) = 0
-void set_irq_work_pending(void)
+void arch_irq_work_raise(void)
{
set_irq_work_pending_flag();
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [060/102] tracing: Fix bug when reading system filters on module removal
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (58 preceding siblings ...)
2011-08-03 22:01 ` [059/102] irq_work, alpha: Fix up arch hooks Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [061/102] tracing: Have "enable" file use refcounts like the "filter" file Greg KH
` (41 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Steven Rostedt
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <srostedt@redhat.com>
commit e9dbfae53eeb9fc3d4bb7da3df87fa9875f5da02 upstream.
The event system is freed when its nr_events is set to zero. This happens
when a module created an event system and then later the module is
removed. Modules may share systems, so the system is allocated when
it is created and freed when the modules are unloaded and all the
events under the system are removed (nr_events set to zero).
The problem arises when a task opened the "filter" file for the
system. If the module is unloaded and it removed the last event for
that system, the system structure is freed. If the task that opened
the filter file accesses the "filter" file after the system has
been freed, the system will access an invalid pointer.
By adding a ref_count, and using it to keep track of what
is using the event system, we can free it after all users
are finished with the event system.
Reported-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/trace/trace.h | 1
kernel/trace/trace_events.c | 86 ++++++++++++++++++++++++++++++++-----
kernel/trace/trace_events_filter.c | 6 ++
3 files changed, 82 insertions(+), 11 deletions(-)
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -677,6 +677,7 @@ struct event_subsystem {
struct dentry *entry;
struct event_filter *filter;
int nr_events;
+ int ref_count;
};
#define FILTER_PRED_INVALID ((unsigned short)-1)
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -244,6 +244,35 @@ static void ftrace_clear_events(void)
mutex_unlock(&event_mutex);
}
+static void __put_system(struct event_subsystem *system)
+{
+ struct event_filter *filter = system->filter;
+
+ WARN_ON_ONCE(system->ref_count == 0);
+ if (--system->ref_count)
+ return;
+
+ if (filter) {
+ kfree(filter->filter_string);
+ kfree(filter);
+ }
+ kfree(system->name);
+ kfree(system);
+}
+
+static void __get_system(struct event_subsystem *system)
+{
+ WARN_ON_ONCE(system->ref_count == 0);
+ system->ref_count++;
+}
+
+static void put_system(struct event_subsystem *system)
+{
+ mutex_lock(&event_mutex);
+ __put_system(system);
+ mutex_unlock(&event_mutex);
+}
+
/*
* __ftrace_set_clr_event(NULL, NULL, NULL, set) will set/unset all events.
*/
@@ -826,6 +855,47 @@ event_filter_write(struct file *filp, co
return cnt;
}
+static LIST_HEAD(event_subsystems);
+
+static int subsystem_open(struct inode *inode, struct file *filp)
+{
+ struct event_subsystem *system = NULL;
+ int ret;
+
+ /* Make sure the system still exists */
+ mutex_lock(&event_mutex);
+ list_for_each_entry(system, &event_subsystems, list) {
+ if (system == inode->i_private) {
+ /* Don't open systems with no events */
+ if (!system->nr_events) {
+ system = NULL;
+ break;
+ }
+ __get_system(system);
+ break;
+ }
+ }
+ mutex_unlock(&event_mutex);
+
+ if (system != inode->i_private)
+ return -ENODEV;
+
+ ret = tracing_open_generic(inode, filp);
+ if (ret < 0)
+ put_system(system);
+
+ return ret;
+}
+
+static int subsystem_release(struct inode *inode, struct file *file)
+{
+ struct event_subsystem *system = inode->i_private;
+
+ put_system(system);
+
+ return 0;
+}
+
static ssize_t
subsystem_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
loff_t *ppos)
@@ -963,10 +1033,11 @@ static const struct file_operations ftra
};
static const struct file_operations ftrace_subsystem_filter_fops = {
- .open = tracing_open_generic,
+ .open = subsystem_open,
.read = subsystem_filter_read,
.write = subsystem_filter_write,
.llseek = default_llseek,
+ .release = subsystem_release,
};
static const struct file_operations ftrace_system_enable_fops = {
@@ -1002,8 +1073,6 @@ static struct dentry *event_trace_events
return d_events;
}
-static LIST_HEAD(event_subsystems);
-
static struct dentry *
event_subsystem_dir(const char *name, struct dentry *d_events)
{
@@ -1013,6 +1082,7 @@ event_subsystem_dir(const char *name, st
/* First see if we did not already create this dir */
list_for_each_entry(system, &event_subsystems, list) {
if (strcmp(system->name, name) == 0) {
+ __get_system(system);
system->nr_events++;
return system->entry;
}
@@ -1035,6 +1105,7 @@ event_subsystem_dir(const char *name, st
}
system->nr_events = 1;
+ system->ref_count = 1;
system->name = kstrdup(name, GFP_KERNEL);
if (!system->name) {
debugfs_remove(system->entry);
@@ -1184,16 +1255,9 @@ static void remove_subsystem_dir(const c
list_for_each_entry(system, &event_subsystems, list) {
if (strcmp(system->name, name) == 0) {
if (!--system->nr_events) {
- struct event_filter *filter = system->filter;
-
debugfs_remove_recursive(system->entry);
list_del(&system->list);
- if (filter) {
- kfree(filter->filter_string);
- kfree(filter);
- }
- kfree(system->name);
- kfree(system);
+ __put_system(system);
}
break;
}
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1886,6 +1886,12 @@ int apply_subsystem_event_filter(struct
mutex_lock(&event_mutex);
+ /* Make sure the system still has events */
+ if (!system->nr_events) {
+ err = -ENODEV;
+ goto out_unlock;
+ }
+
if (!strcmp(strstrip(filter_string), "0")) {
filter_free_subsystem_preds(system);
remove_filter_string(system->filter);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [061/102] tracing: Have "enable" file use refcounts like the "filter" file
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (59 preceding siblings ...)
2011-08-03 22:01 ` [060/102] tracing: Fix bug when reading system filters on module removal Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [062/102] XZ: Fix missing <linux/kernel.h> include Greg KH
` (40 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Steven Rostedt
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <srostedt@redhat.com>
commit 40ee4dffff061399eb9358e0c8fcfbaf8de4c8fe upstream.
The "enable" file for the event system can be removed when a module
is unloaded and the event system only has events from that module.
As the event system nr_events count goes to zero, it may be freed
if its ref_count is also set to zero.
Like the "filter" file, the "enable" file may be opened by a task and
referenced later, after a module has been unloaded and the events for
that event system have been removed.
Although the "filter" file referenced the event system structure,
the "enable" file only references a pointer to the event system
name. Since the name is freed when the event system is removed,
it is possible that an access to the "enable" file may reference
a freed pointer.
Update the "enable" file to use the subsystem_open() routine that
the "filter" file uses, to keep a reference to the event system
structure while the "enable" file is opened.
Reported-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/trace/trace_events.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -557,7 +557,7 @@ system_enable_read(struct file *filp, ch
loff_t *ppos)
{
const char set_to_char[4] = { '?', '0', '1', 'X' };
- const char *system = filp->private_data;
+ struct event_subsystem *system = filp->private_data;
struct ftrace_event_call *call;
char buf[2];
int set = 0;
@@ -568,7 +568,7 @@ system_enable_read(struct file *filp, ch
if (!call->name || !call->class || !call->class->reg)
continue;
- if (system && strcmp(call->class->system, system) != 0)
+ if (system && strcmp(call->class->system, system->name) != 0)
continue;
/*
@@ -598,7 +598,8 @@ static ssize_t
system_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
loff_t *ppos)
{
- const char *system = filp->private_data;
+ struct event_subsystem *system = filp->private_data;
+ const char *name = NULL;
unsigned long val;
char buf[64];
ssize_t ret;
@@ -622,7 +623,14 @@ system_enable_write(struct file *filp, c
if (val != 0 && val != 1)
return -EINVAL;
- ret = __ftrace_set_clr_event(NULL, system, NULL, val);
+ /*
+ * Opening of "enable" adds a ref count to system,
+ * so the name is safe to use.
+ */
+ if (system)
+ name = system->name;
+
+ ret = __ftrace_set_clr_event(NULL, name, NULL, val);
if (ret)
goto out;
@@ -862,6 +870,9 @@ static int subsystem_open(struct inode *
struct event_subsystem *system = NULL;
int ret;
+ if (!inode->i_private)
+ goto skip_search;
+
/* Make sure the system still exists */
mutex_lock(&event_mutex);
list_for_each_entry(system, &event_subsystems, list) {
@@ -880,8 +891,9 @@ static int subsystem_open(struct inode *
if (system != inode->i_private)
return -ENODEV;
+ skip_search:
ret = tracing_open_generic(inode, filp);
- if (ret < 0)
+ if (ret < 0 && system)
put_system(system);
return ret;
@@ -891,7 +903,8 @@ static int subsystem_release(struct inod
{
struct event_subsystem *system = inode->i_private;
- put_system(system);
+ if (system)
+ put_system(system);
return 0;
}
@@ -1041,10 +1054,11 @@ static const struct file_operations ftra
};
static const struct file_operations ftrace_system_enable_fops = {
- .open = tracing_open_generic,
+ .open = subsystem_open,
.read = system_enable_read,
.write = system_enable_write,
.llseek = default_llseek,
+ .release = subsystem_release,
};
static const struct file_operations ftrace_show_header_fops = {
@@ -1133,8 +1147,7 @@ event_subsystem_dir(const char *name, st
"'%s/filter' entry\n", name);
}
- trace_create_file("enable", 0644, system->entry,
- (void *)system->name,
+ trace_create_file("enable", 0644, system->entry, system,
&ftrace_system_enable_fops);
return system->entry;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [062/102] XZ: Fix missing <linux/kernel.h> include
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (60 preceding siblings ...)
2011-08-03 22:01 ` [061/102] tracing: Have "enable" file use refcounts like the "filter" file Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [063/102] PCI: ARI is a PCIe v2 feature Greg KH
` (39 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Lasse Collin
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lasse Collin <lasse.collin@tukaani.org>
commit 81d67439855a7f928d90965d832aa4f2fb677342 upstream.
<linux/kernel.h> is needed for min_t. The old version
happened to work on x86 because <asm/unaligned.h>
indirectly includes <linux/kernel.h>, but it didn't
work on ARM.
<linux/kernel.h> includes <asm/byteorder.h> so it's
not necessary to include it explicitly anymore.
Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
lib/xz/xz_private.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/xz/xz_private.h
+++ b/lib/xz/xz_private.h
@@ -12,7 +12,7 @@
#ifdef __KERNEL__
# include <linux/xz.h>
-# include <asm/byteorder.h>
+# include <linux/kernel.h>
# include <asm/unaligned.h>
/* XZ_PREBOOT may be defined only via decompress_unxz.c. */
# ifndef XZ_PREBOOT
^ permalink raw reply [flat|nested] 103+ messages in thread
* [063/102] PCI: ARI is a PCIe v2 feature
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (61 preceding siblings ...)
2011-08-03 22:01 ` [062/102] XZ: Fix missing <linux/kernel.h> include Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [064/102] cciss: do not attempt to read from a write-only register Greg KH
` (38 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Don Dutile, Chris Wright,
Jesse Barnes
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chris Wright <chrisw@sous-sol.org>
commit 864d296cf948aef0fa32b81407541572583f7572 upstream.
The function pci_enable_ari() may mistakenly set the downstream port
of a v1 PCIe switch in ARI Forwarding mode. This is a PCIe v2 feature,
and with an SR-IOV device on that switch port believing the switch above
is ARI capable it may attempt to use functions 8-255, translating into
invalid (non-zero) device numbers for that bus. This has been seen
to cause Completion Timeouts and general misbehaviour including hangs
and panics.
Acked-by: Don Dutile <ddutile@redhat.com>
Tested-by: Don Dutile <ddutile@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/pci/pci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1905,7 +1905,7 @@ void pci_enable_ari(struct pci_dev *dev)
{
int pos;
u32 cap;
- u16 ctrl;
+ u16 flags, ctrl;
struct pci_dev *bridge;
if (!pci_is_pcie(dev) || dev->devfn)
@@ -1923,6 +1923,11 @@ void pci_enable_ari(struct pci_dev *dev)
if (!pos)
return;
+ /* ARI is a PCIe v2 feature */
+ pci_read_config_word(bridge, pos + PCI_EXP_FLAGS, &flags);
+ if ((flags & PCI_EXP_FLAGS_VERS) < 2)
+ return;
+
pci_read_config_dword(bridge, pos + PCI_EXP_DEVCAP2, &cap);
if (!(cap & PCI_EXP_DEVCAP2_ARI))
return;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [064/102] cciss: do not attempt to read from a write-only register
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (62 preceding siblings ...)
2011-08-03 22:01 ` [063/102] PCI: ARI is a PCIe v2 feature Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [065/102] drivers/firmware/sigma.c needs MODULE_LICENSE Greg KH
` (37 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Stephen M. Cameron,
Jens Axboe
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
commit 07d0c38e7d84f911c72058a124c7f17b3c779a65 upstream.
Most smartarrays will tolerate it, but some new ones don't.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Note: this is a regression caused by commit 1ddd5049
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/block/cciss.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/block/cciss.h
+++ b/drivers/block/cciss.h
@@ -223,7 +223,7 @@ static void SA5_submit_command( ctlr_inf
h->ctlr, c->busaddr);
#endif /* CCISS_DEBUG */
writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
- readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+ readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
h->commands_outstanding++;
if ( h->commands_outstanding > h->max_outstanding)
h->max_outstanding = h->commands_outstanding;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [065/102] drivers/firmware/sigma.c needs MODULE_LICENSE
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (63 preceding siblings ...)
2011-08-03 22:01 ` [064/102] cciss: do not attempt to read from a write-only register Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [066/102] geode: reflect mfgpt dependency on mfd Greg KH
` (36 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Randy Dunlap, Mike Frysinger
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Randy Dunlap <rdunlap@xenotime.net>
commit 27c46a2546c75c6814562e85b751e3d64c188ad5 upstream.
Fix module tainting message:
sigma: module license 'unspecified' taints kernel.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/firmware/sigma.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/firmware/sigma.c
+++ b/drivers/firmware/sigma.c
@@ -11,6 +11,7 @@
#include <linux/firmware.h>
#include <linux/kernel.h>
#include <linux/i2c.h>
+#include <linux/module.h>
#include <linux/sigma.h>
/* Return: 0==OK, <0==error, =1 ==no more actions */
@@ -113,3 +114,5 @@ int process_sigma_firmware(struct i2c_cl
return ret;
}
EXPORT_SYMBOL(process_sigma_firmware);
+
+MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 103+ messages in thread
* [066/102] geode: reflect mfgpt dependency on mfd
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (64 preceding siblings ...)
2011-08-03 22:01 ` [065/102] drivers/firmware/sigma.c needs MODULE_LICENSE Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [067/102] mm/futex: fix futex writes on archs with SW tracking of dirty & young Greg KH
` (35 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Philip A. Prindeville,
Alexandros C. Couloumbis, Andres Salomon
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Philip A. Prindeville" <philipp@redfish-solutions.com>
commit 703f03c896fdbd726b809066ae279df513992f0e upstream.
As stated in drivers/mfd/cs5535-mfd.c, the mfd driver exposes the BARs
which then make the GPIO, MFGPT, ACPI, etc. all visible to the system.
So the dependencies of the MFGPT stuff have changed, and most people
expect Kconfig to bring in the necessary dependencies. Without them, the
module fails to load and most people don't understand why because the
details of the rewrite aren't captured anywhere most people who know to
look.
This dependency needs to be reflected in Kconfig.
Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
Acked-by: Alexandros C. Couloumbis <alex@ozo.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/misc/Kconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -245,8 +245,7 @@ config SGI_XP
config CS5535_MFGPT
tristate "CS5535/CS5536 Geode Multi-Function General Purpose Timer (MFGPT) support"
- depends on PCI
- depends on X86
+ depends on PCI && X86 && MFD_CS5535
default n
help
This driver provides access to MFGPT functionality for other
^ permalink raw reply [flat|nested] 103+ messages in thread
* [067/102] mm/futex: fix futex writes on archs with SW tracking of dirty & young
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (65 preceding siblings ...)
2011-08-03 22:01 ` [066/102] geode: reflect mfgpt dependency on mfd Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [068/102] mm/backing-dev.c: reset bdi min_ratio in bdi_unregister() Greg KH
` (34 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Benjamin Herrenschmidt,
David Laight, Peter Zijlstra, Darren Hart
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
commit 2efaca927f5cd7ecd0f1554b8f9b6a9a2c329c03 upstream.
I haven't reproduced it myself but the fail scenario is that on such
machines (notably ARM and some embedded powerpc), if you manage to hit
that futex path on a writable page whose dirty bit has gone from the PTE,
you'll livelock inside the kernel from what I can tell.
It will go in a loop of trying the atomic access, failing, trying gup to
"fix it up", getting succcess from gup, go back to the atomic access,
failing again because dirty wasn't fixed etc...
So I think you essentially hang in the kernel.
The scenario is probably rare'ish because affected architecture are
embedded and tend to not swap much (if at all) so we probably rarely hit
the case where dirty is missing or young is missing, but I think Shan has
a piece of SW that can reliably reproduce it using a shared writable
mapping & fork or something like that.
On archs who use SW tracking of dirty & young, a page without dirty is
effectively mapped read-only and a page without young unaccessible in the
PTE.
Additionally, some architectures might lazily flush the TLB when relaxing
write protection (by doing only a local flush), and expect a fault to
invalidate the stale entry if it's still present on another processor.
The futex code assumes that if the "in_atomic()" access -EFAULT's, it can
"fix it up" by causing get_user_pages() which would then be equivalent to
taking the fault.
However that isn't the case. get_user_pages() will not call
handle_mm_fault() in the case where the PTE seems to have the right
permissions, regardless of the dirty and young state. It will eventually
update those bits ... in the struct page, but not in the PTE.
Additionally, it will not handle the lazy TLB flushing that can be
required by some architectures in the fault case.
Basically, gup is the wrong interface for the job. The patch provides a
more appropriate one which boils down to just calling handle_mm_fault()
since what we are trying to do is simulate a real page fault.
The futex code currently attempts to write to user memory within a
pagefault disabled section, and if that fails, tries to fix it up using
get_user_pages().
This doesn't work on archs where the dirty and young bits are maintained
by software, since they will gate access permission in the TLB, and will
not be updated by gup().
In addition, there's an expectation on some archs that a spurious write
fault triggers a local TLB flush, and that is missing from the picture as
well.
I decided that adding those "features" to gup() would be too much for this
already too complex function, and instead added a new simpler
fixup_user_fault() which is essentially a wrapper around handle_mm_fault()
which the futex code can call.
[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix some nits Darren saw, fiddle comment layout]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reported-by: Shan Hai <haishan.bai@gmail.com>
Tested-by: Shan Hai <haishan.bai@gmail.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Darren Hart <darren.hart@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/linux/mm.h | 2 +
kernel/futex.c | 4 +--
mm/memory.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 61 insertions(+), 3 deletions(-)
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -985,6 +985,8 @@ int get_user_pages(struct task_struct *t
int get_user_pages_fast(unsigned long start, int nr_pages, int write,
struct page **pages);
struct page *get_dump_page(unsigned long addr);
+extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
+ unsigned long address, unsigned int fault_flags);
extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
extern void do_invalidatepage(struct page *page, unsigned long offset);
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -355,8 +355,8 @@ static int fault_in_user_writeable(u32 _
int ret;
down_read(&mm->mmap_sem);
- ret = get_user_pages(current, mm, (unsigned long)uaddr,
- 1, 1, 0, NULL, NULL);
+ ret = fixup_user_fault(current, mm, (unsigned long)uaddr,
+ FAULT_FLAG_WRITE);
up_read(&mm->mmap_sem);
return ret < 0 ? ret : 0;
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1816,7 +1816,63 @@ next_page:
}
EXPORT_SYMBOL(__get_user_pages);
-/**
+/*
+ * fixup_user_fault() - manually resolve a user page fault
+ * @tsk: the task_struct to use for page fault accounting, or
+ * NULL if faults are not to be recorded.
+ * @mm: mm_struct of target mm
+ * @address: user address
+ * @fault_flags:flags to pass down to handle_mm_fault()
+ *
+ * This is meant to be called in the specific scenario where for locking reasons
+ * we try to access user memory in atomic context (within a pagefault_disable()
+ * section), this returns -EFAULT, and we want to resolve the user fault before
+ * trying again.
+ *
+ * Typically this is meant to be used by the futex code.
+ *
+ * The main difference with get_user_pages() is that this function will
+ * unconditionally call handle_mm_fault() which will in turn perform all the
+ * necessary SW fixup of the dirty and young bits in the PTE, while
+ * handle_mm_fault() only guarantees to update these in the struct page.
+ *
+ * This is important for some architectures where those bits also gate the
+ * access permission to the page because they are maintained in software. On
+ * such architectures, gup() will not be enough to make a subsequent access
+ * succeed.
+ *
+ * This should be called with the mm_sem held for read.
+ */
+int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
+ unsigned long address, unsigned int fault_flags)
+{
+ struct vm_area_struct *vma;
+ int ret;
+
+ vma = find_extend_vma(mm, address);
+ if (!vma || address < vma->vm_start)
+ return -EFAULT;
+
+ ret = handle_mm_fault(mm, vma, address, fault_flags);
+ if (ret & VM_FAULT_ERROR) {
+ if (ret & VM_FAULT_OOM)
+ return -ENOMEM;
+ if (ret & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))
+ return -EHWPOISON;
+ if (ret & VM_FAULT_SIGBUS)
+ return -EFAULT;
+ BUG();
+ }
+ if (tsk) {
+ if (ret & VM_FAULT_MAJOR)
+ tsk->maj_flt++;
+ else
+ tsk->min_flt++;
+ }
+ return 0;
+}
+
+/*
* get_user_pages() - pin user pages in memory
* @tsk: the task_struct to use for page fault accounting, or
* NULL if faults are not to be recorded.
^ permalink raw reply [flat|nested] 103+ messages in thread
* [068/102] mm/backing-dev.c: reset bdi min_ratio in bdi_unregister()
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (66 preceding siblings ...)
2011-08-03 22:01 ` [067/102] mm/futex: fix futex writes on archs with SW tracking of dirty & young Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [069/102] xtensa: prevent arbitrary read in ptrace Greg KH
` (33 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Peter Zijlstra, Wu Fengguang,
Miklos Szeredi
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
commit ccb6108f5b0b541d3eb332c3a73e645c0f84278e upstream.
Vito said:
: The system has many usb disks coming and going day to day, with their
: respective bdi's having min_ratio set to 1 when inserted. It works for
: some time until eventually min_ratio can no longer be set, even when the
: active set of bdi's seen in /sys/class/bdi/*/min_ratio doesn't add up to
: anywhere near 100.
:
: This then leads to an unrelated starvation problem caused by write-heavy
: fuse mounts being used atop the usb disks, a problem the min_ratio setting
: at the underlying devices bdi effectively prevents.
Fix this leakage by resetting the bdi min_ratio when unregistering the
BDI.
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Reported-by: Vito Caputo <lkml@pengaru.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
mm/backing-dev.c | 1 +
1 file changed, 1 insertion(+)
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -606,6 +606,7 @@ static void bdi_prune_sb(struct backing_
void bdi_unregister(struct backing_dev_info *bdi)
{
if (bdi->dev) {
+ bdi_set_min_ratio(bdi, 0);
trace_writeback_bdi_unregister(bdi);
bdi_prune_sb(bdi);
del_timer_sync(&bdi->wb.wakeup_timer);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [069/102] xtensa: prevent arbitrary read in ptrace
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (67 preceding siblings ...)
2011-08-03 22:01 ` [068/102] mm/backing-dev.c: reset bdi min_ratio in bdi_unregister() Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [070/102] ext4: fix i_blocks/quota accounting when extent insertion fails Greg KH
` (32 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Dan Rosenberg,
Christian Zankel, Oleg Nesterov
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit 0d0138ebe24b94065580bd2601f8bb7eb6152f56 upstream.
Prevent an arbitrary kernel read. Check the user pointer with access_ok()
before copying data in.
[akpm@linux-foundation.org: s/EIO/EFAULT/]
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Christian Zankel <chris@zankel.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/xtensa/kernel/ptrace.c | 3 +++
1 file changed, 3 insertions(+)
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -147,6 +147,9 @@ int ptrace_setxregs(struct task_struct *
elf_xtregs_t *xtregs = uregs;
int ret = 0;
+ if (!access_ok(VERIFY_READ, uregs, sizeof(elf_xtregs_t)))
+ return -EFAULT;
+
#if XTENSA_HAVE_COPROCESSORS
/* Flush all coprocessors before we overwrite them. */
coprocessor_flush_all(ti);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [070/102] ext4: fix i_blocks/quota accounting when extent insertion fails
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (68 preceding siblings ...)
2011-08-03 22:01 ` [069/102] xtensa: prevent arbitrary read in ptrace Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [071/102] ext4: free allocated and pre-allocated blocks when check_eofblocks_fl fails Greg KH
` (31 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Maxim Patlasov, Theodore Tso
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Maxim Patlasov <maxim.patlasov@gmail.com>
commit 7132de744ba76930d13033061018ddd7e3e8cd91 upstream.
The current implementation of ext4_free_blocks() always calls
dquot_free_block This looks quite sensible in the most cases: blocks
to be freed are associated with inode and were accounted in quota and
i_blocks some time ago.
However, there is a case when blocks to free were not accounted by the
time calling ext4_free_blocks() yet:
1. delalloc is on, write_begin pre-allocated some space in quota
2. write-back happens, ext4 allocates some blocks in ext4_ext_map_blocks()
3. then ext4_ext_map_blocks() gets an error (e.g. ENOSPC) from
ext4_ext_insert_extent() and calls ext4_free_blocks().
In this scenario, ext4_free_blocks() calls dquot_free_block() who, in
turn, decrements i_blocks for blocks which were not accounted yet (due
to delalloc) After clean umount, e2fsck reports something like:
> Inode 21, i_blocks is 5080, should be 5128. Fix<y>?
because i_blocks was erroneously decremented as explained above.
The patch fixes the problem by passing the new flag
EXT4_FREE_BLOCKS_NO_QUOT_UPDATE to ext4_free_blocks(), to request
that the dquot_free_block() call be skipped.
Signed-off-by: Maxim Patlasov <maxim.patlasov@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/ext4/ext4.h | 1 +
fs/ext4/extents.c | 4 +++-
fs/ext4/mballoc.c | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -526,6 +526,7 @@ struct ext4_new_group_data {
#define EXT4_FREE_BLOCKS_METADATA 0x0001
#define EXT4_FREE_BLOCKS_FORGET 0x0002
#define EXT4_FREE_BLOCKS_VALIDATED 0x0004
+#define EXT4_FREE_BLOCKS_NO_QUOT_UPDATE 0x0008
/*
* ioctl commands
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3601,12 +3601,14 @@ int ext4_ext_map_blocks(handle_t *handle
err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
if (err) {
+ int fb_flags = flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE ?
+ EXT4_FREE_BLOCKS_NO_QUOT_UPDATE : 0;
/* free data blocks we just allocated */
/* not a good idea to call discard here directly,
* but otherwise we'd need to call it every free() */
ext4_discard_preallocations(inode);
ext4_free_blocks(handle, inode, NULL, ext4_ext_pblock(&newex),
- ext4_ext_get_actual_len(&newex), 0);
+ ext4_ext_get_actual_len(&newex), fb_flags);
goto out2;
}
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4637,7 +4637,7 @@ do_more:
}
ext4_mark_super_dirty(sb);
error_return:
- if (freed)
+ if (freed && !(flags & EXT4_FREE_BLOCKS_NO_QUOT_UPDATE))
dquot_free_block(inode, freed);
brelse(bitmap_bh);
ext4_std_error(sb, err);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [071/102] ext4: free allocated and pre-allocated blocks when check_eofblocks_fl fails
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (69 preceding siblings ...)
2011-08-03 22:01 ` [070/102] ext4: fix i_blocks/quota accounting when extent insertion fails Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [072/102] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
` (30 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jiaying Zhang, Theodore Tso
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiaying Zhang <jiayingz@google.com>
commit 575a1d4bdfa2ea9fc10733013136145b497e1be0 upstream.
Upon corrupted inode or disk failures, we may fail after we already
allocate some blocks from the inode or take some blocks from the
inode's preallocation list, but before we successfully insert the
corresponding extent to the extent tree. In this case, we should free
any allocated blocks and discard the inode's preallocated blocks
because the entries in the inode's preallocation list may be in an
inconsistent state.
Signed-off-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/ext4/extents.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3596,10 +3596,9 @@ int ext4_ext_map_blocks(handle_t *handle
}
err = check_eofblocks_fl(handle, inode, map->m_lblk, path, ar.len);
- if (err)
- goto out2;
-
- err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
+ if (!err)
+ err = ext4_ext_insert_extent(handle, inode, path,
+ &newex, flags);
if (err) {
int fb_flags = flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE ?
EXT4_FREE_BLOCKS_NO_QUOT_UPDATE : 0;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [072/102] ext3: Fix oops in ext3_try_to_allocate_with_rsv()
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (70 preceding siblings ...)
2011-08-03 22:01 ` [071/102] ext4: free allocated and pre-allocated blocks when check_eofblocks_fl fails Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [073/102] ecryptfs: Make inode bdi consistent with superblock bdi Greg KH
` (29 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sage Weil, Jan Kara
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Kara <jack@suse.cz>
commit ad95c5e9bc8b5885f94dce720137cac8fa8da4c9 upstream.
Block allocation is called from two places: ext3_get_blocks_handle() and
ext3_xattr_block_set(). These two callers are not necessarily synchronized
because xattr code holds only xattr_sem and i_mutex, and
ext3_get_blocks_handle() may hold only truncate_mutex when called from
writepage() path. Block reservation code does not expect two concurrent
allocations to happen to the same inode and thus assertions can be triggered
or reservation structure corruption can occur.
Fix the problem by taking truncate_mutex in xattr code to serialize
allocations.
CC: Sage Weil <sage@newdream.net>
Reported-by: Fyodor Ustinov <ufm@ufm.su>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/ext3/xattr.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -803,8 +803,16 @@ inserted:
/* We need to allocate a new block */
ext3_fsblk_t goal = ext3_group_first_block_no(sb,
EXT3_I(inode)->i_block_group);
- ext3_fsblk_t block = ext3_new_block(handle, inode,
- goal, &error);
+ ext3_fsblk_t block;
+
+ /*
+ * Protect us agaist concurrent allocations to the
+ * same inode from ext3_..._writepage(). Reservation
+ * code does not expect racing allocations.
+ */
+ mutex_lock(&EXT3_I(inode)->truncate_mutex);
+ block = ext3_new_block(handle, inode, goal, &error);
+ mutex_unlock(&EXT3_I(inode)->truncate_mutex);
if (error)
goto cleanup;
ea_idebug(inode, "creating block %d", block);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [073/102] ecryptfs: Make inode bdi consistent with superblock bdi
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (71 preceding siblings ...)
2011-08-03 22:01 ` [072/102] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [074/102] eCryptfs: Unlock keys needed by ecryptfsd Greg KH
` (28 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Thieu Le, Tyler Hicks
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thieu Le <thieule@chromium.org>
commit 985ca0e626e195ea08a1a82b8dbeb6719747429a upstream.
Make the inode mapping bdi consistent with the superblock bdi so that
dirty pages are flushed properly.
Signed-off-by: Thieu Le <thieule@chromium.org>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/ecryptfs/inode.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -69,6 +69,7 @@ static int ecryptfs_inode_set(struct ino
inode->i_ino = lower_inode->i_ino;
inode->i_version++;
inode->i_mapping->a_ops = &ecryptfs_aops;
+ inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
if (S_ISLNK(inode->i_mode))
inode->i_op = &ecryptfs_symlink_iops;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [074/102] eCryptfs: Unlock keys needed by ecryptfsd
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (72 preceding siblings ...)
2011-08-03 22:01 ` [073/102] ecryptfs: Make inode bdi consistent with superblock bdi Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [075/102] nfsd: dont break lease on CLAIM_DELEGATE_CUR Greg KH
` (27 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Tyler Hicks, Roberto Sassu
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
commit b2987a5e05ec7a1af7ca42e5d5349d7a22753031 upstream.
Fixes a regression caused by b5695d04634fa4ccca7dcbc05bb4a66522f02e0b
Kernel keyring keys containing eCryptfs authentication tokens should not
be write locked when calling out to ecryptfsd to wrap and unwrap file
encryption keys. The eCryptfs kernel code can not hold the key's write
lock because ecryptfsd needs to request the key after receiving such a
request from the kernel.
Without this fix, all file opens and creates will timeout and fail when
using the eCryptfs PKI infrastructure. This is not an issue when using
passphrase-based mount keys, which is the most widely deployed eCryptfs
configuration.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Acked-by: Roberto Sassu <roberto.sassu@polito.it>
Tested-by: Roberto Sassu <roberto.sassu@polito.it>
Tested-by: Alexis Hafner1 <haf@zurich.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/ecryptfs/keystore.c | 47 +++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1868,11 +1868,6 @@ int ecryptfs_parse_packet_set(struct ecr
* just one will be sufficient to decrypt to get the FEK. */
find_next_matching_auth_tok:
found_auth_tok = 0;
- if (auth_tok_key) {
- up_write(&(auth_tok_key->sem));
- key_put(auth_tok_key);
- auth_tok_key = NULL;
- }
list_for_each_entry(auth_tok_list_item, &auth_tok_list, list) {
candidate_auth_tok = &auth_tok_list_item->auth_tok;
if (unlikely(ecryptfs_verbosity > 0)) {
@@ -1909,14 +1904,22 @@ found_matching_auth_tok:
memcpy(&(candidate_auth_tok->token.private_key),
&(matching_auth_tok->token.private_key),
sizeof(struct ecryptfs_private_key));
+ up_write(&(auth_tok_key->sem));
+ key_put(auth_tok_key);
rc = decrypt_pki_encrypted_session_key(candidate_auth_tok,
crypt_stat);
} else if (candidate_auth_tok->token_type == ECRYPTFS_PASSWORD) {
memcpy(&(candidate_auth_tok->token.password),
&(matching_auth_tok->token.password),
sizeof(struct ecryptfs_password));
+ up_write(&(auth_tok_key->sem));
+ key_put(auth_tok_key);
rc = decrypt_passphrase_encrypted_session_key(
candidate_auth_tok, crypt_stat);
+ } else {
+ up_write(&(auth_tok_key->sem));
+ key_put(auth_tok_key);
+ rc = -EINVAL;
}
if (rc) {
struct ecryptfs_auth_tok_list_item *auth_tok_list_item_tmp;
@@ -1956,15 +1959,12 @@ found_matching_auth_tok:
out_wipe_list:
wipe_auth_tok_list(&auth_tok_list);
out:
- if (auth_tok_key) {
- up_write(&(auth_tok_key->sem));
- key_put(auth_tok_key);
- }
return rc;
}
static int
-pki_encrypt_session_key(struct ecryptfs_auth_tok *auth_tok,
+pki_encrypt_session_key(struct key *auth_tok_key,
+ struct ecryptfs_auth_tok *auth_tok,
struct ecryptfs_crypt_stat *crypt_stat,
struct ecryptfs_key_record *key_rec)
{
@@ -1979,6 +1979,8 @@ pki_encrypt_session_key(struct ecryptfs_
crypt_stat->cipher,
crypt_stat->key_size),
crypt_stat, &payload, &payload_len);
+ up_write(&(auth_tok_key->sem));
+ key_put(auth_tok_key);
if (rc) {
ecryptfs_printk(KERN_ERR, "Error generating tag 66 packet\n");
goto out;
@@ -2008,6 +2010,8 @@ out:
* write_tag_1_packet - Write an RFC2440-compatible tag 1 (public key) packet
* @dest: Buffer into which to write the packet
* @remaining_bytes: Maximum number of bytes that can be writtn
+ * @auth_tok_key: The authentication token key to unlock and put when done with
+ * @auth_tok
* @auth_tok: The authentication token used for generating the tag 1 packet
* @crypt_stat: The cryptographic context
* @key_rec: The key record struct for the tag 1 packet
@@ -2018,7 +2022,7 @@ out:
*/
static int
write_tag_1_packet(char *dest, size_t *remaining_bytes,
- struct ecryptfs_auth_tok *auth_tok,
+ struct key *auth_tok_key, struct ecryptfs_auth_tok *auth_tok,
struct ecryptfs_crypt_stat *crypt_stat,
struct ecryptfs_key_record *key_rec, size_t *packet_size)
{
@@ -2039,12 +2043,15 @@ write_tag_1_packet(char *dest, size_t *r
memcpy(key_rec->enc_key,
auth_tok->session_key.encrypted_key,
auth_tok->session_key.encrypted_key_size);
+ up_write(&(auth_tok_key->sem));
+ key_put(auth_tok_key);
goto encrypted_session_key_set;
}
if (auth_tok->session_key.encrypted_key_size == 0)
auth_tok->session_key.encrypted_key_size =
auth_tok->token.private_key.key_size;
- rc = pki_encrypt_session_key(auth_tok, crypt_stat, key_rec);
+ rc = pki_encrypt_session_key(auth_tok_key, auth_tok, crypt_stat,
+ key_rec);
if (rc) {
printk(KERN_ERR "Failed to encrypt session key via a key "
"module; rc = [%d]\n", rc);
@@ -2421,6 +2428,8 @@ ecryptfs_generate_key_packet_set(char *d
&max, auth_tok,
crypt_stat, key_rec,
&written);
+ up_write(&(auth_tok_key->sem));
+ key_put(auth_tok_key);
if (rc) {
ecryptfs_printk(KERN_WARNING, "Error "
"writing tag 3 packet\n");
@@ -2438,8 +2447,8 @@ ecryptfs_generate_key_packet_set(char *d
}
(*len) += written;
} else if (auth_tok->token_type == ECRYPTFS_PRIVATE_KEY) {
- rc = write_tag_1_packet(dest_base + (*len),
- &max, auth_tok,
+ rc = write_tag_1_packet(dest_base + (*len), &max,
+ auth_tok_key, auth_tok,
crypt_stat, key_rec, &written);
if (rc) {
ecryptfs_printk(KERN_WARNING, "Error "
@@ -2448,14 +2457,13 @@ ecryptfs_generate_key_packet_set(char *d
}
(*len) += written;
} else {
+ up_write(&(auth_tok_key->sem));
+ key_put(auth_tok_key);
ecryptfs_printk(KERN_WARNING, "Unsupported "
"authentication token type\n");
rc = -EINVAL;
goto out_free;
}
- up_write(&(auth_tok_key->sem));
- key_put(auth_tok_key);
- auth_tok_key = NULL;
}
if (likely(max > 0)) {
dest_base[(*len)] = 0x00;
@@ -2468,11 +2476,6 @@ out_free:
out:
if (rc)
(*len) = 0;
- if (auth_tok_key) {
- up_write(&(auth_tok_key->sem));
- key_put(auth_tok_key);
- }
-
mutex_unlock(&crypt_stat->keysig_list_mutex);
return rc;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [075/102] nfsd: dont break lease on CLAIM_DELEGATE_CUR
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (73 preceding siblings ...)
2011-08-03 22:01 ` [074/102] eCryptfs: Unlock keys needed by ecryptfsd Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [076/102] nfsd4: remember to put RW access on stateid destruction Greg KH
` (26 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Casey Bodley,
J. Bruce Fields
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Casey Bodley <cbodley@citi.umich.edu>
commit 0c12eaffdf09466f36a9ffe970dda8f4aeb6efc0 upstream.
CLAIM_DELEGATE_CUR is used in response to a broken lease; allowing it
to break the lease and return EAGAIN leaves the client unable to make
progress in returning the delegation
nfs4_get_vfs_file() now takes struct nfsd4_open for access to the
claim type, and calls nfsd_open() with NFSD_MAY_NOT_BREAK_LEASE when
claim type is CLAIM_DELEGATE_CUR
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfsd/nfs4state.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2556,12 +2556,18 @@ static inline int nfs4_access_to_access(
return flags;
}
-static __be32 nfs4_get_vfs_file(struct svc_rqst *rqstp, struct nfs4_file
-*fp, struct svc_fh *cur_fh, u32 nfs4_access)
+static __be32 nfs4_get_vfs_file(struct svc_rqst *rqstp, struct nfs4_file *fp,
+ struct svc_fh *cur_fh, struct nfsd4_open *open)
{
__be32 status;
- int oflag = nfs4_access_to_omode(nfs4_access);
- int access = nfs4_access_to_access(nfs4_access);
+ int oflag = nfs4_access_to_omode(open->op_share_access);
+ int access = nfs4_access_to_access(open->op_share_access);
+
+ /* CLAIM_DELEGATE_CUR is used in response to a broken lease;
+ * allowing it to break the lease and return EAGAIN leaves the
+ * client unable to make progress in returning the delegation */
+ if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR)
+ access |= NFSD_MAY_NOT_BREAK_LEASE;
if (!fp->fi_fds[oflag]) {
status = nfsd_open(rqstp, cur_fh, S_IFREG, access,
@@ -2586,7 +2592,7 @@ nfs4_new_open(struct svc_rqst *rqstp, st
if (stp == NULL)
return nfserr_resource;
- status = nfs4_get_vfs_file(rqstp, fp, cur_fh, open->op_share_access);
+ status = nfs4_get_vfs_file(rqstp, fp, cur_fh, open);
if (status) {
kmem_cache_free(stateid_slab, stp);
return status;
@@ -2619,7 +2625,7 @@ nfs4_upgrade_open(struct svc_rqst *rqstp
new_access = !test_bit(op_share_access, &stp->st_access_bmap);
if (new_access) {
- status = nfs4_get_vfs_file(rqstp, fp, cur_fh, op_share_access);
+ status = nfs4_get_vfs_file(rqstp, fp, cur_fh, open);
if (status)
return status;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [076/102] nfsd4: remember to put RW access on stateid destruction
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (74 preceding siblings ...)
2011-08-03 22:01 ` [075/102] nfsd: dont break lease on CLAIM_DELEGATE_CUR Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [077/102] nfsd4: fix file leak on open_downgrade Greg KH
` (25 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, J. Bruce Fields
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "J. Bruce Fields" <bfields@redhat.com>
commit 499f3edc23ca0431f3a0a6736b3a40944c81bf3b upstream.
Without this, for example,
open read
open read+write
close
will result in a struct file leak.
Regression from 7d94784293096c0a46897acdb83be5abd9278ece "nfsd4: fix
downgrade/lock logic".
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfsd/nfs4state.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -381,14 +381,6 @@ static int nfs4_access_to_omode(u32 acce
BUG();
}
-static int nfs4_access_bmap_to_omode(struct nfs4_stateid *stp)
-{
- unsigned int access;
-
- set_access(&access, stp->st_access_bmap);
- return nfs4_access_to_omode(access);
-}
-
static void unhash_generic_stateid(struct nfs4_stateid *stp)
{
list_del(&stp->st_hash);
@@ -398,11 +390,14 @@ static void unhash_generic_stateid(struc
static void free_generic_stateid(struct nfs4_stateid *stp)
{
- int oflag;
+ int i;
if (stp->st_access_bmap) {
- oflag = nfs4_access_bmap_to_omode(stp);
- nfs4_file_put_access(stp->st_file, oflag);
+ for (i = 1; i < 4; i++) {
+ if (test_bit(i, &stp->st_access_bmap))
+ nfs4_file_put_access(stp->st_file,
+ nfs4_access_to_omode(i));
+ }
}
put_nfs4_file(stp->st_file);
kmem_cache_free(stateid_slab, stp);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [077/102] nfsd4: fix file leak on open_downgrade
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (75 preceding siblings ...)
2011-08-03 22:01 ` [076/102] nfsd4: remember to put RW access on stateid destruction Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [078/102] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
` (24 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, J. Bruce Fields
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "J. Bruce Fields" <bfields@redhat.com>
commit f197c27196a5e7631b89e2e92daa096fcf7c302c upstream.
Stateid's hold a read reference for a read open, a write reference for a
write open, and an additional one of each for each read+write open. The
latter wasn't getting put on a downgrade, so something like:
open RW
open R
downgrade to R
was resulting in a file leak.
Also fix an imbalance in an error path.
Regression from 7d94784293096c0a46897acdb83be5abd9278ece "nfsd4: fix
downgrade/lock logic".
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfsd/nfs4state.c | 31 ++++++++-----------------------
1 file changed, 8 insertions(+), 23 deletions(-)
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2332,15 +2332,6 @@ out:
return ret;
}
-static inline void
-nfs4_file_downgrade(struct nfs4_file *fp, unsigned int share_access)
-{
- if (share_access & NFS4_SHARE_ACCESS_WRITE)
- nfs4_file_put_access(fp, O_WRONLY);
- if (share_access & NFS4_SHARE_ACCESS_READ)
- nfs4_file_put_access(fp, O_RDONLY);
-}
-
static void nfsd_break_one_deleg(struct nfs4_delegation *dp)
{
/* We're assuming the state code never drops its reference
@@ -2627,7 +2618,7 @@ nfs4_upgrade_open(struct svc_rqst *rqstp
status = nfsd4_truncate(rqstp, cur_fh, open);
if (status) {
if (new_access) {
- int oflag = nfs4_access_to_omode(new_access);
+ int oflag = nfs4_access_to_omode(op_share_access);
nfs4_file_put_access(fp, oflag);
}
return status;
@@ -3385,18 +3376,15 @@ out:
return status;
}
-
-/*
- * unset all bits in union bitmap (bmap) that
- * do not exist in share (from successful OPEN_DOWNGRADE)
- */
-static void
-reset_union_bmap_access(unsigned long access, unsigned long *bmap)
+static inline void nfs4_file_downgrade(struct nfs4_stateid *stp, unsigned int to_access)
{
int i;
+
for (i = 1; i < 4; i++) {
- if ((i & access) != i)
- __clear_bit(i, bmap);
+ if (test_bit(i, &stp->st_access_bmap) && !(i & to_access)) {
+ nfs4_file_put_access(stp->st_file, i);
+ __clear_bit(i, &stp->st_access_bmap);
+ }
}
}
@@ -3417,7 +3405,6 @@ nfsd4_open_downgrade(struct svc_rqst *rq
{
__be32 status;
struct nfs4_stateid *stp;
- unsigned int share_access;
dprintk("NFSD: nfsd4_open_downgrade on file %.*s\n",
(int)cstate->current_fh.fh_dentry->d_name.len,
@@ -3446,10 +3433,8 @@ nfsd4_open_downgrade(struct svc_rqst *rq
stp->st_deny_bmap, od->od_share_deny);
goto out;
}
- set_access(&share_access, stp->st_access_bmap);
- nfs4_file_downgrade(stp->st_file, share_access & ~od->od_share_access);
+ nfs4_file_downgrade(stp, od->od_share_access);
- reset_union_bmap_access(od->od_share_access, &stp->st_access_bmap);
reset_union_bmap_deny(od->od_share_deny, &stp->st_deny_bmap);
update_stateid(&stp->st_stateid);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [078/102] svcrpc: fix list-corrupting race on nfsd shutdown
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (76 preceding siblings ...)
2011-08-03 22:01 ` [077/102] nfsd4: fix file leak on open_downgrade Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [079/102] NFSv4: Dont use the delegation->inode in nfs_mark_return_delegation() Greg KH
` (23 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, gnb, J. Bruce Fields
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "J. Bruce Fields" <bfields@redhat.com>
commit ebc63e531cc6a457595dd110b07ac530eae788c3 upstream.
After commit 3262c816a3d7fb1eaabce633caa317887ed549ae "[PATCH] knfsd:
split svc_serv into pools", svc_delete_xprt (then svc_delete_socket) no
longer removed its xpt_ready (then sk_ready) field from whatever list it
was on, noting that there was no point since the whole list was about to
be destroyed anyway.
That was mostly true, but forgot that a few svc_xprt_enqueue()'s might
still be hanging around playing with the about-to-be-destroyed list, and
could get themselves into trouble writing to freed memory if we left
this xprt on the list after freeing it.
(This is actually functionally identical to a patch made first by Ben
Greear, but with more comments.)
Cc: gnb@fmeh.org
Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/sunrpc/svc_xprt.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -902,12 +902,13 @@ void svc_delete_xprt(struct svc_xprt *xp
if (!test_and_set_bit(XPT_DETACHED, &xprt->xpt_flags))
list_del_init(&xprt->xpt_list);
/*
- * We used to delete the transport from whichever list
- * it's sk_xprt.xpt_ready node was on, but we don't actually
- * need to. This is because the only time we're called
- * while still attached to a queue, the queue itself
- * is about to be destroyed (in svc_destroy).
+ * The only time we're called while xpt_ready is still on a list
+ * is while the list itself is about to be destroyed (in
+ * svc_destroy). BUT svc_xprt_enqueue could still be attempting
+ * to add new entries to the sp_sockets list, so we can't leave
+ * a freed xprt on it.
*/
+ list_del_init(&xprt->xpt_ready);
if (test_bit(XPT_TEMP, &xprt->xpt_flags))
serv->sv_tmpcnt--;
spin_unlock_bh(&serv->sv_lock);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [079/102] NFSv4: Dont use the delegation->inode in nfs_mark_return_delegation()
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (77 preceding siblings ...)
2011-08-03 22:01 ` [078/102] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [080/102] NFS: Fix spurious readdir cookie loop messages Greg KH
` (22 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Trond Myklebust
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit ed1e6211a0a134ff23592c6f057af982ad5dab52 upstream.
nfs_mark_return_delegation() is usually called without any locking, and
so it is not safe to dereference delegation->inode. Since the inode is
only used to discover the nfs_client anyway, it makes more sense to
have the callers pass a valid pointer to the nfs_server as a parameter.
Reported-by: Ian Kent <raven@themaw.net>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfs/delegation.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -398,12 +398,11 @@ int nfs_inode_return_delegation(struct i
return err;
}
-static void nfs_mark_return_delegation(struct nfs_delegation *delegation)
+static void nfs_mark_return_delegation(struct nfs_server *server,
+ struct nfs_delegation *delegation)
{
- struct nfs_client *clp = NFS_SERVER(delegation->inode)->nfs_client;
-
set_bit(NFS_DELEGATION_RETURN, &delegation->flags);
- set_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state);
+ set_bit(NFS4CLNT_DELEGRETURN, &server->nfs_client->cl_state);
}
/**
@@ -441,7 +440,7 @@ static void nfs_mark_return_all_delegati
if ((delegation->type == (FMODE_READ|FMODE_WRITE)) && !(flags & FMODE_WRITE))
continue;
if (delegation->type & flags)
- nfs_mark_return_delegation(delegation);
+ nfs_mark_return_delegation(server, delegation);
}
}
@@ -508,7 +507,7 @@ static void nfs_mark_return_unreferenced
list_for_each_entry_rcu(delegation, &server->delegations, super_list) {
if (test_and_clear_bit(NFS_DELEGATION_REFERENCED, &delegation->flags))
continue;
- nfs_mark_return_delegation(delegation);
+ nfs_mark_return_delegation(server, delegation);
}
}
@@ -539,7 +538,8 @@ void nfs_expire_unreferenced_delegations
int nfs_async_inode_return_delegation(struct inode *inode,
const nfs4_stateid *stateid)
{
- struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
+ struct nfs_server *server = NFS_SERVER(inode);
+ struct nfs_client *clp = server->nfs_client;
struct nfs_delegation *delegation;
rcu_read_lock();
@@ -549,7 +549,7 @@ int nfs_async_inode_return_delegation(st
rcu_read_unlock();
return -ENOENT;
}
- nfs_mark_return_delegation(delegation);
+ nfs_mark_return_delegation(server, delegation);
rcu_read_unlock();
nfs_delegation_run_state_manager(clp);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [080/102] NFS: Fix spurious readdir cookie loop messages
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (78 preceding siblings ...)
2011-08-03 22:01 ` [079/102] NFSv4: Dont use the delegation->inode in nfs_mark_return_delegation() Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [081/102] proc: fix a race in do_io_accounting() Greg KH
` (21 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Trond Myklebust
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit 0c0308066ca53fdf1423895f3a42838b67b3a5a8 upstream.
If the directory contents change, then we have to accept that the
file->f_pos value may shrink if we do a 'search-by-cookie'. In that
case, we should turn off the loop detection and let the NFS client
try to recover.
The patch also fixes a second loop detection bug by ensuring
that after turning on the ctx->duped flag, we read at least one new
cookie into ctx->dir_cookie before attempting to match with
ctx->dup_cookie.
Reported-by: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/nfs/dir.c | 56 ++++++++++++++++++++++++++++---------------------
include/linux/nfs_fs.h | 3 +-
2 files changed, 35 insertions(+), 24 deletions(-)
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -134,18 +134,19 @@ const struct inode_operations nfs4_dir_i
#endif /* CONFIG_NFS_V4 */
-static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct rpc_cred *cred)
+static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir, struct rpc_cred *cred)
{
struct nfs_open_dir_context *ctx;
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
if (ctx != NULL) {
ctx->duped = 0;
+ ctx->attr_gencount = NFS_I(dir)->attr_gencount;
ctx->dir_cookie = 0;
ctx->dup_cookie = 0;
ctx->cred = get_rpccred(cred);
- } else
- ctx = ERR_PTR(-ENOMEM);
- return ctx;
+ return ctx;
+ }
+ return ERR_PTR(-ENOMEM);
}
static void put_nfs_open_dir_context(struct nfs_open_dir_context *ctx)
@@ -173,7 +174,7 @@ nfs_opendir(struct inode *inode, struct
cred = rpc_lookup_cred();
if (IS_ERR(cred))
return PTR_ERR(cred);
- ctx = alloc_nfs_open_dir_context(cred);
+ ctx = alloc_nfs_open_dir_context(inode, cred);
if (IS_ERR(ctx)) {
res = PTR_ERR(ctx);
goto out;
@@ -323,7 +324,6 @@ int nfs_readdir_search_for_pos(struct nf
{
loff_t diff = desc->file->f_pos - desc->current_index;
unsigned int index;
- struct nfs_open_dir_context *ctx = desc->file->private_data;
if (diff < 0)
goto out_eof;
@@ -336,7 +336,6 @@ int nfs_readdir_search_for_pos(struct nf
index = (unsigned int)diff;
*desc->dir_cookie = array->array[index].cookie;
desc->cache_entry_index = index;
- ctx->duped = 0;
return 0;
out_eof:
desc->eof = 1;
@@ -349,14 +348,33 @@ int nfs_readdir_search_for_cookie(struct
int i;
loff_t new_pos;
int status = -EAGAIN;
- struct nfs_open_dir_context *ctx = desc->file->private_data;
for (i = 0; i < array->size; i++) {
if (array->array[i].cookie == *desc->dir_cookie) {
+ struct nfs_inode *nfsi = NFS_I(desc->file->f_path.dentry->d_inode);
+ struct nfs_open_dir_context *ctx = desc->file->private_data;
+
new_pos = desc->current_index + i;
- if (new_pos < desc->file->f_pos) {
+ if (ctx->attr_gencount != nfsi->attr_gencount
+ || (nfsi->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA))) {
+ ctx->duped = 0;
+ ctx->attr_gencount = nfsi->attr_gencount;
+ } else if (new_pos < desc->file->f_pos) {
+ if (ctx->duped > 0
+ && ctx->dup_cookie == *desc->dir_cookie) {
+ if (printk_ratelimit()) {
+ pr_notice("NFS: directory %s/%s contains a readdir loop."
+ "Please contact your server vendor. "
+ "Offending cookie: %llu\n",
+ desc->file->f_dentry->d_parent->d_name.name,
+ desc->file->f_dentry->d_name.name,
+ *desc->dir_cookie);
+ }
+ status = -ELOOP;
+ goto out;
+ }
ctx->dup_cookie = *desc->dir_cookie;
- ctx->duped = 1;
+ ctx->duped = -1;
}
desc->file->f_pos = new_pos;
desc->cache_entry_index = i;
@@ -368,6 +386,7 @@ int nfs_readdir_search_for_cookie(struct
if (*desc->dir_cookie == array->last_cookie)
desc->eof = 1;
}
+out:
return status;
}
@@ -740,19 +759,6 @@ int nfs_do_filldir(nfs_readdir_descripto
struct nfs_cache_array *array = NULL;
struct nfs_open_dir_context *ctx = file->private_data;
- if (ctx->duped != 0 && ctx->dup_cookie == *desc->dir_cookie) {
- if (printk_ratelimit()) {
- pr_notice("NFS: directory %s/%s contains a readdir loop. "
- "Please contact your server vendor. "
- "Offending cookie: %llu\n",
- file->f_dentry->d_parent->d_name.name,
- file->f_dentry->d_name.name,
- *desc->dir_cookie);
- }
- res = -ELOOP;
- goto out;
- }
-
array = nfs_readdir_get_array(desc->page);
if (IS_ERR(array)) {
res = PTR_ERR(array);
@@ -774,6 +780,8 @@ int nfs_do_filldir(nfs_readdir_descripto
*desc->dir_cookie = array->array[i+1].cookie;
else
*desc->dir_cookie = array->last_cookie;
+ if (ctx->duped != 0)
+ ctx->duped = 1;
}
if (array->eof_index >= 0)
desc->eof = 1;
@@ -805,6 +813,7 @@ int uncached_readdir(nfs_readdir_descrip
struct page *page = NULL;
int status;
struct inode *inode = desc->file->f_path.dentry->d_inode;
+ struct nfs_open_dir_context *ctx = desc->file->private_data;
dfprintk(DIRCACHE, "NFS: uncached_readdir() searching for cookie %Lu\n",
(unsigned long long)*desc->dir_cookie);
@@ -818,6 +827,7 @@ int uncached_readdir(nfs_readdir_descrip
desc->page_index = 0;
desc->last_cookie = *desc->dir_cookie;
desc->page = page;
+ ctx->duped = 0;
status = nfs_readdir_xdr_to_array(desc, page, inode);
if (status < 0)
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -99,9 +99,10 @@ struct nfs_open_context {
struct nfs_open_dir_context {
struct rpc_cred *cred;
+ unsigned long attr_gencount;
__u64 dir_cookie;
__u64 dup_cookie;
- int duped;
+ signed char duped;
};
/*
^ permalink raw reply [flat|nested] 103+ messages in thread
* [081/102] proc: fix a race in do_io_accounting()
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (79 preceding siblings ...)
2011-08-03 22:01 ` [080/102] NFS: Fix spurious readdir cookie loop messages Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [082/102] n_gsm: fix the wrong FCS handling Greg KH
` (20 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Vasiliy Kulikov, Al Viro
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vasiliy Kulikov <segoon@openwall.com>
commit 293eb1e7772b25a93647c798c7b89bf26c2da2e0 upstream.
If an inode's mode permits opening /proc/PID/io and the resulting file
descriptor is kept across execve() of a setuid or similar binary, the
ptrace_may_access() check tries to prevent using this fd against the
task with escalated privileges.
Unfortunately, there is a race in the check against execve(). If
execve() is processed after the ptrace check, but before the actual io
information gathering, io statistics will be gathered from the
privileged process. At least in theory this might lead to gathering
sensible information (like ssh/ftp password length) that wouldn't be
available otherwise.
Holding task->signal->cred_guard_mutex while gathering the io
information should protect against the race.
The order of locking is similar to the one inside of ptrace_attach():
first goes cred_guard_mutex, then lock_task_sighand().
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/proc/base.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2707,9 +2707,16 @@ static int do_io_accounting(struct task_
{
struct task_io_accounting acct = task->ioac;
unsigned long flags;
+ int result;
- if (!ptrace_may_access(task, PTRACE_MODE_READ))
- return -EACCES;
+ result = mutex_lock_killable(&task->signal->cred_guard_mutex);
+ if (result)
+ return result;
+
+ if (!ptrace_may_access(task, PTRACE_MODE_READ)) {
+ result = -EACCES;
+ goto out_unlock;
+ }
if (whole && lock_task_sighand(task, &flags)) {
struct task_struct *t = task;
@@ -2720,7 +2727,7 @@ static int do_io_accounting(struct task_
unlock_task_sighand(task, &flags);
}
- return sprintf(buffer,
+ result = sprintf(buffer,
"rchar: %llu\n"
"wchar: %llu\n"
"syscr: %llu\n"
@@ -2735,6 +2742,9 @@ static int do_io_accounting(struct task_
(unsigned long long)acct.read_bytes,
(unsigned long long)acct.write_bytes,
(unsigned long long)acct.cancelled_write_bytes);
+out_unlock:
+ mutex_unlock(&task->signal->cred_guard_mutex);
+ return result;
}
static int proc_tid_io_accounting(struct task_struct *task, char *buffer)
^ permalink raw reply [flat|nested] 103+ messages in thread
* [082/102] n_gsm: fix the wrong FCS handling
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (80 preceding siblings ...)
2011-08-03 22:01 ` [081/102] proc: fix a race in do_io_accounting() Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [083/102] EHCI: only power off port if over-current is active Greg KH
` (19 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alek Du, Alan Cox
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Du, Alek" <alek.du@intel.com>
commit f086ced17191fa0c5712539d2b680eae3dc972a1 upstream.
FCS could be GSM0_SOF, so will break state machine...
[This byte isn't quoted in any way so a SOF here doesn't imply an error
occurred.]
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
[Trivial but best backported once its in 3.1rc I think]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/tty/n_gsm.c | 4 ----
1 file changed, 4 deletions(-)
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1823,10 +1823,6 @@ static void gsm0_receive(struct gsm_mux
break;
case GSM_FCS: /* FCS follows the packet */
gsm->received_fcs = c;
- if (c == GSM0_SOF) {
- gsm->state = GSM_SEARCH;
- break;
- }
gsm_queue(gsm);
gsm->state = GSM_SSOF;
break;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [083/102] EHCI: only power off port if over-current is active
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (81 preceding siblings ...)
2011-08-03 22:01 ` [082/102] n_gsm: fix the wrong FCS handling Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [084/102] EHCI: fix direction handling for interrupt data toggles Greg KH
` (18 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sergei Shtylyov, Alan Stern
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
commit 81463c1d707186adbbe534016cd1249edeab0dac upstream.
MAX4967 USB power supply chip we use on our boards signals over-current when
power is not enabled; once it's enabled, over-current signal returns to normal.
That unfortunately caused the endless stream of "over-current change on port"
messages. The EHCI root hub code reacts on every over-current signal change
with powering off the port -- such change event is generated the moment the
port power is enabled, so once enabled the power is immediately cut off.
I think we should only cut off power when we're seeing the active over-current
signal, so I'm adding such check to that code. I also think that the fact that
we've cut off the port power should be reflected in the result of GetPortStatus
request immediately, hence I'm adding a PORTSCn register readback after write...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/host/ehci-hub.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -891,10 +891,11 @@ static int ehci_hub_control (
* power switching; they're allowed to just limit the
* current. khubd will turn the power back on.
*/
- if (HCS_PPC (ehci->hcs_params)){
+ if ((temp & PORT_OC) && HCS_PPC(ehci->hcs_params)) {
ehci_writel(ehci,
temp & ~(PORT_RWC_BITS | PORT_POWER),
status_reg);
+ temp = ehci_readl(ehci, status_reg);
}
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [084/102] EHCI: fix direction handling for interrupt data toggles
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (82 preceding siblings ...)
2011-08-03 22:01 ` [083/102] EHCI: only power off port if over-current is active Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [085/102] cfg80211: really ignore the regulatory request Greg KH
` (17 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit e04f5f7e423018bcec84c11af2058cdce87816f3 upstream.
This patch (as1480) fixes a rather obscure bug in ehci-hcd. The
qh_update() routine needs to know the number and direction of the
endpoint corresponding to its QH argument. The number can be taken
directly from the QH data structure, but the direction isn't stored
there. The direction is taken instead from the first qTD linked to
the QH.
However, it turns out that for interrupt transfers, qh_update() gets
called before the qTDs are linked to the QH. As a result, qh_update()
computes a bogus direction value, which messes up the endpoint toggle
handling. Under the right combination of circumstances this causes
usb_reset_endpoint() not to work correctly, which causes packets to be
dropped and communications to fail.
Now, it's silly for the QH structure not to have direct access to all
the descriptor information for the corresponding endpoint. Ultimately
it may get a pointer to the usb_host_endpoint structure; for now,
adding a copy of the direction flag solves the immediate problem.
This allows the Spyder2 color-calibration system (a low-speed USB
device that sends all its interrupt data packets with the toggle set
to 0 and hance requires constant use of usb_reset_endpoint) to work
when connected through a high-speed hub. Thanks to Graeme Gill for
supplying the hardware that allowed me to track down this bug.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Graeme Gill <graeme@argyllcms.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/host/ehci-q.c | 3 ++-
drivers/usb/host/ehci.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -103,7 +103,7 @@ qh_update (struct ehci_hcd *ehci, struct
if (!(hw->hw_info1 & cpu_to_hc32(ehci, 1 << 14))) {
unsigned is_out, epnum;
- is_out = !(qtd->hw_token & cpu_to_hc32(ehci, 1 << 8));
+ is_out = qh->is_out;
epnum = (hc32_to_cpup(ehci, &hw->hw_info1) >> 8) & 0x0f;
if (unlikely (!usb_gettoggle (qh->dev, epnum, is_out))) {
hw->hw_token &= ~cpu_to_hc32(ehci, QTD_TOGGLE);
@@ -946,6 +946,7 @@ done:
hw = qh->hw;
hw->hw_info1 = cpu_to_hc32(ehci, info1);
hw->hw_info2 = cpu_to_hc32(ehci, info2);
+ qh->is_out = !is_input;
usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1);
qh_refresh (ehci, qh);
return qh;
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -375,6 +375,7 @@ struct ehci_qh {
#define NO_FRAME ((unsigned short)~0) /* pick new start */
struct usb_device *dev; /* access to TT */
+ unsigned is_out:1; /* bulk or intr OUT */
unsigned clearing_tt:1; /* Clear-TT-Buf in progress */
};
^ permalink raw reply [flat|nested] 103+ messages in thread
* [085/102] cfg80211: really ignore the regulatory request
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (83 preceding siblings ...)
2011-08-03 22:01 ` [084/102] EHCI: fix direction handling for interrupt data toggles Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [086/102] memcg: fix behavior of mem_cgroup_resize_limit() Greg KH
` (16 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sven Neumann, linux-wireless,
Johannes Berg, Daniel Mack, John W. Linville
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sven Neumann <s.neumann@raumfeld.com>
commit a203c2aa4cefccb879c879b8e1cad1a09a679e55 upstream.
At the beginning of wiphy_update_regulatory() a check is performed
whether the request is to be ignored. Then the request is sent to
the driver nevertheless. This happens even if last_request points
to NULL, leading to a crash in the driver:
[<bf01d864>] (lbs_set_11d_domain_info+0x28/0x1e4 [libertas]) from [<c03b714c>] (wiphy_update_regulatory+0x4d0/0x4f4)
[<c03b714c>] (wiphy_update_regulatory+0x4d0/0x4f4) from [<c03b4008>] (wiphy_register+0x354/0x420)
[<c03b4008>] (wiphy_register+0x354/0x420) from [<bf01b17c>] (lbs_cfg_register+0x80/0x164 [libertas])
[<bf01b17c>] (lbs_cfg_register+0x80/0x164 [libertas]) from [<bf020e64>] (lbs_start_card+0x20/0x88 [libertas])
[<bf020e64>] (lbs_start_card+0x20/0x88 [libertas]) from [<bf02cbd8>] (if_sdio_probe+0x898/0x9c0 [libertas_sdio])
Fix this by returning early. Also remove the out: label as it is
not any longer needed.
Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
Cc: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Daniel Mack <daniel@zonque.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/wireless/reg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1125,12 +1125,13 @@ void wiphy_update_regulatory(struct wiph
enum ieee80211_band band;
if (ignore_reg_update(wiphy, initiator))
- goto out;
+ return;
+
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (wiphy->bands[band])
handle_band(wiphy, band, initiator);
}
-out:
+
reg_process_beacons(wiphy);
reg_process_ht_flags(wiphy);
if (wiphy->reg_notifier)
^ permalink raw reply [flat|nested] 103+ messages in thread
* [086/102] memcg: fix behavior of mem_cgroup_resize_limit()
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (84 preceding siblings ...)
2011-08-03 22:01 ` [085/102] cfg80211: really ignore the regulatory request Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [087/102] tty/serial: Fix XSCALE serial ports, e.g. ce4100 Greg KH
` (15 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Daisuke Nishimura,
Balbir Singh, KAMEZAWA Hiroyuki, Michal Hocko, Ying Han
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
commit 108b6a78463bb8c7163e4f9779f36ad8bbade334 upstream.
Commit 22a668d7c3ef ("memcg: fix behavior under memory.limit equals to
memsw.limit") introduced "memsw_is_minimum" flag, which becomes true
when mem_limit == memsw_limit. The flag is checked at the beginning of
reclaim, and "noswap" is set if the flag is true, because using swap is
meaningless in this case.
This works well in most cases, but when we try to shrink mem_limit,
which is the same as memsw_limit now, we might fail to shrink mem_limit
because swap doesn't used.
This patch fixes this behavior by:
- check MEM_CGROUP_RECLAIM_SHRINK at the begining of reclaim
- If it is set, don't set "noswap" flag even if memsw_is_minimum is true.
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <bsingharora@gmail.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1730,7 +1730,7 @@ static int mem_cgroup_hierarchical_recla
excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT;
/* If memsw_is_minimum==1, swap-out is of-no-use. */
- if (!check_soft && root_mem->memsw_is_minimum)
+ if (!check_soft && !shrink && root_mem->memsw_is_minimum)
noswap = true;
while (1) {
^ permalink raw reply [flat|nested] 103+ messages in thread
* [087/102] tty/serial: Fix XSCALE serial ports, e.g. ce4100
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (85 preceding siblings ...)
2011-08-03 22:01 ` [086/102] memcg: fix behavior of mem_cgroup_resize_limit() Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [088/102] SERIAL: SC26xx: Fix link error Greg KH
` (14 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Stephen Warren
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stephen Warren <swarren@nvidia.com>
commit 5568181f188ae9485a0cdbea5ea48f63d186a298 upstream.
Commit 4539c24fe4f92c09ee668ef959d3e8180df619b9 "tty/serial: Add
explicit PORT_TEGRA type" introduced separate flags describing the need
for IER bits UUE and RTOIE. Both bits are required for the XSCALE port
type. While that patch updated uart_config[] as required, the auto-probing
code wasn't updated to set the RTOIE flag when an XSCALE port type was
detected. This caused such ports to stop working. This patch rectifies
that.
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/tty/serial/8250.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1107,7 +1107,7 @@ static void autoconfig_16550a(struct uar
*/
DEBUG_AUTOCONF("Xscale ");
up->port.type = PORT_XSCALE;
- up->capabilities |= UART_CAP_UUE;
+ up->capabilities |= UART_CAP_UUE | UART_CAP_RTOIE;
return;
}
} else {
^ permalink raw reply [flat|nested] 103+ messages in thread
* [088/102] SERIAL: SC26xx: Fix link error.
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (86 preceding siblings ...)
2011-08-03 22:01 ` [087/102] tty/serial: Fix XSCALE serial ports, e.g. ce4100 Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [089/102] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
` (13 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Ralf Baechle, linux-serial,
linux-mips, Alan Cox
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ralf Baechle <ralf@linux-mips.org>
commit f2eb3cdf14457fccb14ae8c4d7d7cee088cd3957 upstream.
Kconfig allows enabling console support for the SC26xx driver even when
it's configured as a module resulting in a:
ERROR: "uart_console_device" [drivers/tty/serial/sc26xx.ko] undefined!
modpost error since the driver was merged in
eea63e0e8a60d00485b47fb6e75d9aa2566b989b [SC26XX: New serial driver for
SC2681 uarts] in 2.6.25. Fixed by only allowing console support to be
enabled if the driver is builtin.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/tty/serial/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1419,7 +1419,7 @@ config SERIAL_SC26XX
config SERIAL_SC26XX_CONSOLE
bool "Console on SC2681/SC2692 serial port"
- depends on SERIAL_SC26XX
+ depends on SERIAL_SC26XX=y
select SERIAL_CORE_CONSOLE
help
Support for Console on SC2681/SC2692 serial ports.
^ permalink raw reply [flat|nested] 103+ messages in thread
* [089/102] powerpc/pseries/hvconsole: Fix dropped console output
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (87 preceding siblings ...)
2011-08-03 22:01 ` [088/102] SERIAL: SC26xx: Fix link error Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [090/102] hvc_console: Improve tty/console put_chars handling Greg KH
` (12 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Anton Blanchard,
Benjamin Herrenschmidt
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anton Blanchard <anton@samba.org>
commit 51d33021425e1f905beb4208823146f2fb6517da upstream.
Return -EAGAIN when we get H_BUSY back from the hypervisor. This
makes the hvc console driver retry, avoiding dropped printks.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/powerpc/platforms/pseries/hvconsole.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/platforms/pseries/hvconsole.c
+++ b/arch/powerpc/platforms/pseries/hvconsole.c
@@ -73,7 +73,7 @@ int hvc_put_chars(uint32_t vtermno, cons
if (ret == H_SUCCESS)
return count;
if (ret == H_BUSY)
- return 0;
+ return -EAGAIN;
return -EIO;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [090/102] hvc_console: Improve tty/console put_chars handling
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (88 preceding siblings ...)
2011-08-03 22:01 ` [089/102] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [091/102] ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID Greg KH
` (11 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Hendrik Brueckner,
Anton Blanchard, Benjamin Herrenschmidt
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
commit 8c2381af0d3ef62a681dac5a141b6dabb27bf2e1 upstream.
Currently, the hvc_console_print() function drops console output if the
hvc backend's put_chars() returns 0. This patch changes this behavior
to allow a retry through returning -EAGAIN.
This change also affects the hvc_push() function. Both functions are
changed to handle -EAGAIN and to retry the put_chars() operation.
If a hvc backend returns -EAGAIN, the retry handling differs:
- hvc_console_print() spins to write the complete console output.
- hvc_push() behaves the same way as for returning 0.
Now hvc backends can indirectly control the way how console output is
handled through the hvc console layer.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Acked-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/tty/hvc/hvc_console.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -163,8 +163,10 @@ static void hvc_console_print(struct con
} else {
r = cons_ops[index]->put_chars(vtermnos[index], c, i);
if (r <= 0) {
- /* throw away chars on error */
- i = 0;
+ /* throw away characters on error
+ * but spin in case of -EAGAIN */
+ if (r != -EAGAIN)
+ i = 0;
} else if (r > 0) {
i -= r;
if (i > 0)
@@ -448,7 +450,7 @@ static int hvc_push(struct hvc_struct *h
n = hp->ops->put_chars(hp->vtermno, hp->outbuf, hp->n_outbuf);
if (n <= 0) {
- if (n == 0) {
+ if (n == 0 || n == -EAGAIN) {
hp->do_wakeup = 1;
return 0;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [091/102] ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (89 preceding siblings ...)
2011-08-03 22:01 ` [090/102] hvc_console: Improve tty/console put_chars handling Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [092/102] AppArmor: Fix reference to rcu protected pointer outside of rcu_read_lock Greg KH
` (10 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Manfred Spraul, Eric Dumazet
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Manfred Spraul <manfred@colorfullife.com>
commit d694ad62bf539dbb20a0899ac2a954555f9e4a83 upstream.
If a semaphore array is removed and in parallel a sleeping task is woken
up (signal or timeout, does not matter), then the woken up task does not
wait until wake_up_sem_queue_do() is completed. This will cause crashes,
because wake_up_sem_queue_do() will read from a stale pointer.
The fix is simple: Regardless of anything, always call get_queue_result().
This function waits until wake_up_sem_queue_do() has finished it's task.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=27142
Reported-by: Yuriy Yevtukhov <yuriy@ucoz.com>
Reported-by: Harald Laabs <kernel@dasr.de>
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
ipc/sem.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1456,15 +1456,24 @@ SYSCALL_DEFINE4(semtimedop, int, semid,
}
sma = sem_lock(ns, semid);
+
+ /*
+ * Wait until it's guaranteed that no wakeup_sem_queue_do() is ongoing.
+ */
+ error = get_queue_result(&queue);
+
+ /*
+ * Array removed? If yes, leave without sem_unlock().
+ */
if (IS_ERR(sma)) {
error = -EIDRM;
goto out_free;
}
- error = get_queue_result(&queue);
/*
- * If queue.status != -EINTR we are woken up by another process
+ * If queue.status != -EINTR we are woken up by another process.
+ * Leave without unlink_queue(), but with sem_unlock().
*/
if (error != -EINTR) {
^ permalink raw reply [flat|nested] 103+ messages in thread
* [092/102] AppArmor: Fix reference to rcu protected pointer outside of rcu_read_lock
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (90 preceding siblings ...)
2011-08-03 22:01 ` [091/102] ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [093/102] AppArmor: Fix masking of capabilities in complain mode Greg KH
` (9 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, John Johansen
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: John Johansen <john.johansen@canonical.com>
commit 04fdc099f9c80c7775dbac388fc97e156d4d47e7 upstream.
The pointer returned from tracehook_tracer_task() is only valid inside
the rcu_read_lock. However the tracer pointer obtained is being passed
to aa_may_ptrace outside of the rcu_read_lock critical section.
Mover the aa_may_ptrace test into the rcu_read_lock critical section, to
fix this.
Kernels affected: 2.6.36 - 3.0
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
security/apparmor/domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -73,7 +73,6 @@ static int may_change_ptraced_domain(str
cred = get_task_cred(tracer);
tracerp = aa_cred_profile(cred);
}
- rcu_read_unlock();
/* not ptraced */
if (!tracer || unconfined(tracerp))
@@ -82,6 +81,7 @@ static int may_change_ptraced_domain(str
error = aa_may_ptrace(tracer, tracerp, to_profile, PTRACE_MODE_ATTACH);
out:
+ rcu_read_unlock();
if (cred)
put_cred(cred);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [093/102] AppArmor: Fix masking of capabilities in complain mode
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (91 preceding siblings ...)
2011-08-03 22:01 ` [092/102] AppArmor: Fix reference to rcu protected pointer outside of rcu_read_lock Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [094/102] oom: task->mm == NULL doesnt mean the memory was freed Greg KH
` (8 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, John Johansen
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: John Johansen <john.johansen@canonical.com>
commit 25e75dff519bcce2cb35023105e7df51d7b9e691 upstream.
AppArmor is masking the capabilities returned by capget against the
capabilities mask in the profile. This is wrong, in complain mode the
profile has effectively all capabilities, as the profile restrictions are
not being enforced, merely tested against to determine if an access is
known by the profile.
This can result in the wrong behavior of security conscience applications
like sshd which examine their capability set, and change their behavior
accordingly. In this case because of the masked capability set being
returned sshd fails due to DAC checks, even when the profile is in complain
mode.
Kernels affected: 2.6.36 - 3.0.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
security/apparmor/lsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -127,7 +127,7 @@ static int apparmor_capget(struct task_s
*inheritable = cred->cap_inheritable;
*permitted = cred->cap_permitted;
- if (!unconfined(profile)) {
+ if (!unconfined(profile) && !COMPLAIN_MODE(profile)) {
*effective = cap_intersect(*effective, profile->caps.allow);
*permitted = cap_intersect(*permitted, profile->caps.allow);
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [094/102] oom: task->mm == NULL doesnt mean the memory was freed
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (92 preceding siblings ...)
2011-08-03 22:01 ` [093/102] AppArmor: Fix masking of capabilities in complain mode Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [095/102] rt2x00: Add device ID for RT539F device Greg KH
` (7 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Oleg Nesterov
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Oleg Nesterov <oleg@redhat.com>
commit c027a474a68065391c8773f6e83ed5412657e369 upstream.
exit_mm() sets ->mm == NULL then it does mmput()->exit_mmap() which
frees the memory.
However select_bad_process() checks ->mm != NULL before TIF_MEMDIE,
so it continues to kill other tasks even if we have the oom-killed
task freeing its memory.
Change select_bad_process() to check ->mm after TIF_MEMDIE, but skip
the tasks which have already passed exit_notify() to ensure a zombie
with TIF_MEMDIE set can't block oom-killer. Alternatively we could
probably clear TIF_MEMDIE after exit_mmap().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
mm/oom_kill.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -303,7 +303,7 @@ static struct task_struct *select_bad_pr
do_each_thread(g, p) {
unsigned int points;
- if (!p->mm)
+ if (p->exit_state)
continue;
if (oom_unkillable_task(p, mem, nodemask))
continue;
@@ -319,6 +319,8 @@ static struct task_struct *select_bad_pr
*/
if (test_tsk_thread_flag(p, TIF_MEMDIE))
return ERR_PTR(-1UL);
+ if (!p->mm)
+ continue;
if (p->flags & PF_EXITING) {
/*
^ permalink raw reply [flat|nested] 103+ messages in thread
* [095/102] rt2x00: Add device ID for RT539F device.
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (93 preceding siblings ...)
2011-08-03 22:01 ` [094/102] oom: task->mm == NULL doesnt mean the memory was freed Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [096/102] GFS2: Fix mount hang caused by certain access pattern to sysfs files Greg KH
` (6 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Gertjan van Wingerde,
Ivo van Doorn, John W. Linville
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Gertjan van Wingerde <gwingerde@gmail.com>
commit 71e0b38c2914018b01f3f08b43ee9e3328197699 upstream.
Reported-by: Wim Vander Schelden <wim@fixnum.org>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -1158,6 +1158,7 @@ static DEFINE_PCI_DEVICE_TABLE(rt2800pci
#endif
#ifdef CONFIG_RT2800PCI_RT53XX
{ PCI_DEVICE(0x1814, 0x5390) },
+ { PCI_DEVICE(0x1814, 0x539f) },
#endif
{ 0, }
};
^ permalink raw reply [flat|nested] 103+ messages in thread
* [096/102] GFS2: Fix mount hang caused by certain access pattern to sysfs files
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (94 preceding siblings ...)
2011-08-03 22:01 ` [095/102] rt2x00: Add device ID for RT539F device Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [097/102] watchdog: shwdt: fix usage of mod_timer Greg KH
` (5 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Steven Whitehouse
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Whitehouse <swhiteho@redhat.com>
commit 19237039919088781b4191a00bdc1284d8fea1dd upstream.
Depending upon the order of userspace/kernel during the
mount process, this can result in a hang without the
_all version of the completion.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/gfs2/ops_fstype.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1018,13 +1018,13 @@ hostdata_error:
fsname++;
if (lm->lm_mount == NULL) {
fs_info(sdp, "Now mounting FS...\n");
- complete(&sdp->sd_locking_init);
+ complete_all(&sdp->sd_locking_init);
return 0;
}
ret = lm->lm_mount(sdp, fsname);
if (ret == 0)
fs_info(sdp, "Joined cluster. Now mounting FS...\n");
- complete(&sdp->sd_locking_init);
+ complete_all(&sdp->sd_locking_init);
return ret;
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* [097/102] watchdog: shwdt: fix usage of mod_timer
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (95 preceding siblings ...)
2011-08-03 22:01 ` [096/102] GFS2: Fix mount hang caused by certain access pattern to sysfs files Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [098/102] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
` (4 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, David Engraf, Paul Mundt,
Wim Van sebroeck
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Engraf <david.engraf@sysgo.com>
commit bea1906620ce72b63f83735c4cc2642b25ec54ae upstream.
Fix the usage of mod_timer() and make the driver usable. mod_timer() must
be called with an absolute timeout in jiffies. The old implementation
used a relative timeout thus the hardware watchdog was never triggered.
Signed-off-by: David Engraf <david.engraf@sysgo.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Wim Van sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/watchdog/shwdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -64,7 +64,7 @@
* misses its deadline, the kernel timer will allow the WDT to overflow.
*/
static int clock_division_ratio = WTCSR_CKS_4096;
-#define next_ping_period(cks) msecs_to_jiffies(cks - 4)
+#define next_ping_period(cks) (jiffies + msecs_to_jiffies(cks - 4))
static const struct watchdog_info sh_wdt_info;
static struct platform_device *sh_wdt_dev;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [098/102] ALSA: sound/core/pcm_compat.c: adjust array index
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (96 preceding siblings ...)
2011-08-03 22:01 ` [097/102] watchdog: shwdt: fix usage of mod_timer Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:01 ` [099/102] dm io: flush cpu cache with vmapped io Greg KH
` (3 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Julia Lawall, Takashi Iwai
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Julia Lawall <julia@diku.dk>
commit ca9380fd68514c7bc952282c1b4fc70607e9fe43 upstream.
Convert array index from the loop bound to the loop index.
A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e1,e2,ar;
@@
for(e1 = 0; e1 < e2; e1++) { <...
ar[
- e2
+ e1
]
...> }
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/core/pcm_compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -342,7 +342,7 @@ static int snd_pcm_ioctl_xfern_compat(st
kfree(bufs);
return -EFAULT;
}
- bufs[ch] = compat_ptr(ptr);
+ bufs[i] = compat_ptr(ptr);
bufptr++;
}
if (dir == SNDRV_PCM_STREAM_PLAYBACK)
^ permalink raw reply [flat|nested] 103+ messages in thread
* [099/102] dm io: flush cpu cache with vmapped io
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (97 preceding siblings ...)
2011-08-03 22:01 ` [098/102] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
@ 2011-08-03 22:01 ` Greg KH
2011-08-03 22:02 ` [100/102] dm snapshot: flush disk cache when merging Greg KH
` (2 subsequent siblings)
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Mikulas Patocka,
Alasdair G Kergon
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit bb91bc7bacb906c9f3a9b22744c53fa7564b51ba upstream.
For normal kernel pages, CPU cache is synchronized by the dma layer.
However, this is not done for pages allocated with vmalloc. If we do I/O
to/from vmallocated pages, we must synchronize CPU cache explicitly.
Prior to doing I/O on vmallocated page we must call
flush_kernel_vmap_range to flush dirty cache on the virtual address.
After finished read we must call invalidate_kernel_vmap_range to
invalidate cache on the virtual address, so that accesses to the virtual
address return newly read data and not stale data from CPU cache.
This patch fixes metadata corruption on dm-snapshots on PA-RISC and
possibly other architectures with caches indexed by virtual address.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/md/dm-io.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -38,6 +38,8 @@ struct io {
struct dm_io_client *client;
io_notify_fn callback;
void *context;
+ void *vma_invalidate_address;
+ unsigned long vma_invalidate_size;
} __attribute__((aligned(DM_IO_MAX_REGIONS)));
static struct kmem_cache *_dm_io_cache;
@@ -116,6 +118,10 @@ static void dec_count(struct io *io, uns
set_bit(region, &io->error_bits);
if (atomic_dec_and_test(&io->count)) {
+ if (io->vma_invalidate_size)
+ invalidate_kernel_vmap_range(io->vma_invalidate_address,
+ io->vma_invalidate_size);
+
if (io->sleeper)
wake_up_process(io->sleeper);
@@ -159,6 +165,9 @@ struct dpages {
unsigned context_u;
void *context_ptr;
+
+ void *vma_invalidate_address;
+ unsigned long vma_invalidate_size;
};
/*
@@ -377,6 +386,9 @@ static int sync_io(struct dm_io_client *
io->sleeper = current;
io->client = client;
+ io->vma_invalidate_address = dp->vma_invalidate_address;
+ io->vma_invalidate_size = dp->vma_invalidate_size;
+
dispatch_io(rw, num_regions, where, dp, io, 1);
while (1) {
@@ -415,13 +427,21 @@ static int async_io(struct dm_io_client
io->callback = fn;
io->context = context;
+ io->vma_invalidate_address = dp->vma_invalidate_address;
+ io->vma_invalidate_size = dp->vma_invalidate_size;
+
dispatch_io(rw, num_regions, where, dp, io, 0);
return 0;
}
-static int dp_init(struct dm_io_request *io_req, struct dpages *dp)
+static int dp_init(struct dm_io_request *io_req, struct dpages *dp,
+ unsigned long size)
{
/* Set up dpages based on memory type */
+
+ dp->vma_invalidate_address = NULL;
+ dp->vma_invalidate_size = 0;
+
switch (io_req->mem.type) {
case DM_IO_PAGE_LIST:
list_dp_init(dp, io_req->mem.ptr.pl, io_req->mem.offset);
@@ -432,6 +452,11 @@ static int dp_init(struct dm_io_request
break;
case DM_IO_VMA:
+ flush_kernel_vmap_range(io_req->mem.ptr.vma, size);
+ if ((io_req->bi_rw & RW_MASK) == READ) {
+ dp->vma_invalidate_address = io_req->mem.ptr.vma;
+ dp->vma_invalidate_size = size;
+ }
vm_dp_init(dp, io_req->mem.ptr.vma);
break;
@@ -460,7 +485,7 @@ int dm_io(struct dm_io_request *io_req,
int r;
struct dpages dp;
- r = dp_init(io_req, &dp);
+ r = dp_init(io_req, &dp, (unsigned long)where->count << SECTOR_SHIFT);
if (r)
return r;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [100/102] dm snapshot: flush disk cache when merging
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (98 preceding siblings ...)
2011-08-03 22:01 ` [099/102] dm io: flush cpu cache with vmapped io Greg KH
@ 2011-08-03 22:02 ` Greg KH
2011-08-03 22:02 ` [101/102] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
2011-08-03 22:02 ` [102/102] dm: fix idr leak on module removal Greg KH
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Mikulas Patocka,
Alasdair G Kergon
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 762a80d9fc9f690a3a35983f3b4619a220650808 upstream.
This patch makes dm-snapshot flush disk cache when writing metadata for
merging snapshot.
Without cache flushing the disk may reorder metadata write and other
data writes and there is a possibility of data corruption in case of
power fault.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/md/dm-snap-persistent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -753,7 +753,7 @@ static int persistent_commit_merge(struc
for (i = 0; i < nr_merged; i++)
clear_exception(ps, ps->current_committed - 1 - i);
- r = area_io(ps, WRITE);
+ r = area_io(ps, WRITE_FLUSH_FUA);
if (r < 0)
return r;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [101/102] dm mpath: fix potential NULL pointer in feature arg processing
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (99 preceding siblings ...)
2011-08-03 22:02 ` [100/102] dm snapshot: flush disk cache when merging Greg KH
@ 2011-08-03 22:02 ` Greg KH
2011-08-03 22:02 ` [102/102] dm: fix idr leak on module removal Greg KH
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Mike Snitzer,
Alasdair G Kergon
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike Snitzer <snitzer@redhat.com>
commit 286f367dad40beb3234a18c17391d03ba939a7f3 upstream.
Avoid dereferencing a NULL pointer if the number of feature arguments
supplied is fewer than indicated.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/md/dm-mpath.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -807,6 +807,11 @@ static int parse_features(struct arg_set
if (!argc)
return 0;
+ if (argc > as->argc) {
+ ti->error = "not enough arguments for features";
+ return -EINVAL;
+ }
+
do {
param_name = shift(as);
argc--;
^ permalink raw reply [flat|nested] 103+ messages in thread
* [102/102] dm: fix idr leak on module removal
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
` (100 preceding siblings ...)
2011-08-03 22:02 ` [101/102] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
@ 2011-08-03 22:02 ` Greg KH
101 siblings, 0 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alasdair G Kergon
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alasdair G Kergon <agk@redhat.com>
commit d15b774c2920d55e3d58275c97fbe3adc3afde38 upstream.
Destroy _minor_idr when unloading the core dm module. (Found by kmemleak.)
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/md/dm.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -37,6 +37,8 @@ static const char *_name = DM_NAME;
static unsigned int major = 0;
static unsigned int _major = 0;
+static DEFINE_IDR(_minor_idr);
+
static DEFINE_SPINLOCK(_minor_lock);
/*
* For bio-based dm.
@@ -313,6 +315,12 @@ static void __exit dm_exit(void)
while (i--)
_exits[i]();
+
+ /*
+ * Should be empty by this point.
+ */
+ idr_remove_all(&_minor_idr);
+ idr_destroy(&_minor_idr);
}
/*
@@ -1705,8 +1713,6 @@ static int dm_any_congested(void *conges
/*-----------------------------------------------------------------
* An IDR is used to keep track of allocated minor numbers.
*---------------------------------------------------------------*/
-static DEFINE_IDR(_minor_idr);
-
static void free_minor(int minor)
{
spin_lock(&_minor_lock);
^ permalink raw reply [flat|nested] 103+ messages in thread
* [000/102] 3.0.1-stable review
@ 2011-08-03 22:13 Greg KH
2011-08-03 22:00 ` [001/102] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
` (101 more replies)
0 siblings, 102 replies; 103+ messages in thread
From: Greg KH @ 2011-08-03 22:13 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan
This is the start of the stable review cycle for the 3.0.1 release.
There are 102 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 Friday, August 5, 2011, 20: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/v3.0/stable-review/patch-3.0.1-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 4 +-
arch/alpha/kernel/time.c | 2 +-
arch/arm/mach-pxa/cm-x300.c | 8 +-
arch/powerpc/kernel/crash.c | 6 +-
arch/powerpc/kernel/time.c | 2 +-
arch/powerpc/platforms/pseries/hvconsole.c | 2 +-
arch/x86/include/asm/msr-index.h | 3 +
arch/x86/kernel/cpu/intel.c | 18 +++
arch/x86/kernel/relocate_kernel_32.S | 2 +
arch/x86/kernel/relocate_kernel_64.S | 2 +
arch/x86/oprofile/backtrace.c | 56 ++++++++--
arch/xtensa/kernel/ptrace.c | 3 +
block/blk-core.c | 3 +
block/blk-exec.c | 7 ++
drivers/block/cciss.h | 2 +-
drivers/firewire/core-cdev.c | 20 ++--
drivers/firmware/sigma.c | 3 +
drivers/gpu/drm/radeon/atombios_dp.c | 22 +++-
drivers/gpu/drm/radeon/radeon_combios.c | 3 +-
drivers/gpu/drm/radeon/radeon_pm.c | 3 +
drivers/infiniband/ulp/srp/ib_srp.c | 2 +
drivers/md/dm-io.c | 29 +++++-
drivers/md/dm-mpath.c | 5 +
drivers/md/dm-snap-persistent.c | 2 +-
drivers/md/dm.c | 10 ++-
drivers/misc/Kconfig | 3 +-
drivers/mmc/host/sdhci-esdhc-imx.c | 2 +-
drivers/net/jme.c | 20 +++-
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 3 +-
drivers/net/wireless/ath/ath9k/mac.c | 3 +-
drivers/net/wireless/rt2x00/rt2800pci.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 2 +-
drivers/pci/pci.c | 7 +-
drivers/pci/quirks.c | 23 ++++
drivers/rtc/interface.c | 55 +++++++---
drivers/rtc/rtc-tegra.c | 2 +-
drivers/scsi/hpsa.h | 2 +-
drivers/scsi/libsas/sas_expander.c | 3 +
drivers/scsi/pmcraid.c | 3 +
drivers/scsi/scsi_devinfo.c | 2 +
drivers/scsi/scsi_lib.c | 2 +
drivers/scsi/ses.c | 6 +-
drivers/scsi/sr.c | 46 +++++++-
drivers/scsi/sr.h | 7 ++
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 49 ++++++---
drivers/staging/ath6kl/os/linux/cfg80211.c | 31 +++---
.../staging/ath6kl/os/linux/include/ar6000_drv.h | 9 ++
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c | 5 -
drivers/staging/comedi/comedi_fops.c | 4 +-
drivers/staging/hv/channel.c | 2 +-
drivers/staging/hv/channel_mgmt.c | 2 +-
drivers/staging/hv/connection.c | 2 +-
drivers/staging/hv/netvsc.c | 4 +-
drivers/staging/hv/rndis_filter.c | 6 +-
drivers/staging/hv/storvsc.c | 8 +-
drivers/staging/hv/storvsc_drv.c | 2 +-
drivers/staging/rtl8192e/r8192E_core.c | 6 +
drivers/staging/usbip/vhci_hcd.c | 4 +-
drivers/tty/hvc/hvc_console.c | 8 +-
drivers/tty/n_gsm.c | 4 -
drivers/tty/serial/8250.c | 2 +-
drivers/tty/serial/Kconfig | 2 +-
drivers/usb/host/ehci-hcd.c | 8 +-
drivers/usb/host/ehci-hub.c | 3 +-
drivers/usb/host/ehci-q.c | 85 +++++++--------
drivers/usb/host/ehci.h | 4 +-
drivers/usb/host/pci-quirks.c | 28 +++++
drivers/usb/musb/musb_core.c | 1 +
drivers/usb/serial/pl2303.c | 1 +
drivers/usb/serial/pl2303.h | 4 +
drivers/watchdog/shwdt.c | 2 +-
fs/cifs/dir.c | 2 +-
fs/ecryptfs/inode.c | 1 +
fs/ecryptfs/keystore.c | 47 +++++----
fs/ext3/xattr.c | 12 ++-
fs/ext4/ext4.h | 1 +
fs/ext4/extents.c | 11 +-
fs/ext4/mballoc.c | 2 +-
fs/gfs2/ops_fstype.c | 4 +-
fs/nfs/delegation.c | 16 ++--
fs/nfs/dir.c | 56 ++++++----
fs/nfs/nfs4filelayout.c | 2 +-
fs/nfs/nfs4proc.c | 8 ++-
fs/nfs/nfs4xdr.c | 2 +-
fs/nfs/pnfs.c | 63 ++++++-----
fs/nfs/pnfs.h | 6 +-
fs/nfsd/nfs4state.c | 66 +++++-------
fs/proc/base.c | 16 +++-
include/linux/firewire-cdev.h | 3 +
include/linux/mm.h | 2 +
include/linux/netdevice.h | 5 +-
include/linux/nfs_fs.h | 3 +-
include/linux/nfs_xdr.h | 2 +-
ipc/sem.c | 13 ++-
kernel/events/core.c | 7 +-
kernel/futex.c | 4 +-
kernel/trace/trace.h | 1 +
kernel/trace/trace_events.c | 113 ++++++++++++++++---
kernel/trace/trace_events_filter.c | 6 +
lib/xz/xz_private.h | 2 +-
mm/backing-dev.c | 1 +
mm/memcontrol.c | 2 +-
mm/memory.c | 58 ++++++++++-
mm/oom_kill.c | 4 +-
net/bridge/br_private.h | 1 +
net/bridge/br_stp.c | 4 +-
net/core/ethtool.c | 4 +-
net/mac80211/mlme.c | 3 +
net/sunrpc/svc_xprt.c | 11 +-
net/wireless/reg.c | 5 +-
security/apparmor/domain.c | 2 +-
security/apparmor/lsm.c | 2 +-
sound/core/pcm_compat.c | 2 +-
sound/pci/hda/patch_realtek.c | 7 +-
sound/pci/oxygen/xonar_pcm179x.c | 5 +-
sound/soc/davinci/davinci-vcif.c | 9 +-
sound/soc/soc-core.c | 1 +
tools/perf/Makefile | 5 +-
tools/perf/util/header.c | 5 +-
tools/perf/util/session.c | 30 +++--
tools/perf/util/session.h | 1 +
121 files changed, 932 insertions(+), 403 deletions(-)
^ permalink raw reply [flat|nested] 103+ messages in thread
end of thread, other threads:[~2011-08-03 23:46 UTC | newest]
Thread overview: 103+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
2011-08-03 22:00 ` [001/102] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
2011-08-03 22:00 ` [002/102] mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency Greg KH
2011-08-03 22:00 ` [003/102] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get cleared Greg KH
2011-08-03 22:00 ` [004/102] bridge: send proper message_age in config BPDU Greg KH
2011-08-03 22:00 ` [005/102] gro: Only reset frag0 when skb can be pulled Greg KH
2011-08-03 22:00 ` [006/102] Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread Greg KH
2011-08-03 22:00 ` [007/102] staging: r8192e_pci: Handle duplicate PCI ID 0x10ec:0x8192 conflict with rtl8192se Greg KH
2011-08-03 22:00 ` [008/102] staging: comedi: fix infoleak to userspace Greg KH
2011-08-03 22:00 ` [009/102] Staging: hv: storvsc: Increase the timeout value in the storvsc driver Greg KH
2011-08-03 22:00 ` [010/102] Staging: hv: vmbus: Increase the timeout value in the vmbus driver Greg KH
2011-08-03 22:00 ` [011/102] Staging: hv: netvsc: Increase the timeout value in the netvsc driver Greg KH
2011-08-03 22:00 ` [012/102] USB: OHCI: fix another regression for NVIDIA controllers Greg KH
2011-08-03 22:00 ` [013/102] USB: EHCI: go back to using the system clock for QH unlinks Greg KH
2011-08-03 22:00 ` [014/102] usb: musb: restore INDEX register in resume path Greg KH
2011-08-03 22:00 ` [015/102] rtc: handle errors correctly in rtc_irq_set_state() Greg KH
2011-08-03 22:00 ` [016/102] rtc: fix hrtimer deadlock Greg KH
2011-08-03 22:00 ` [017/102] rtc: limit frequency Greg KH
2011-08-03 22:00 ` [018/102] drivers/rtc/rtc-tegra.c: properly initialize spinlock Greg KH
2011-08-03 22:00 ` [019/102] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
2011-08-03 22:00 ` [020/102] ASoC: davinci: add missing break statement Greg KH
2011-08-03 22:00 ` [021/102] ASoC: davinci: fix codec start and stop functions Greg KH
2011-08-03 22:00 ` [022/102] ASoC: Mark cache as dirty when suspending Greg KH
2011-08-03 22:00 ` [023/102] ath6kl: cache firmware Greg KH
2011-08-03 22:00 ` [024/102] ath6kl: fix crash when interface is closed but scan is ongoing Greg KH
2011-08-03 22:00 ` [025/102] ath9k_hw: Fix incorrect key_miss handling Greg KH
2011-08-03 22:00 ` [026/102] CIFS: Fix oops while mounting with prefixpath Greg KH
2011-08-03 22:00 ` [027/102] staging: brcm80211: fix for reported log spam problem Greg KH
2011-08-03 22:00 ` [028/102] jme: Fix unmap error (Causing system freeze) Greg KH
2011-08-03 22:00 ` [029/102] ethtool: Allow zero-length register dumps again Greg KH
2011-08-03 22:00 ` [030/102] firewire: cdev: return -ENOTTY for unimplemented ioctls, not -EINVAL Greg KH
2011-08-03 22:00 ` [031/102] firewire: cdev: prevent race between first get_info ioctl and bus reset event queuing Greg KH
2011-08-03 22:00 ` [032/102] IB/srp: Avoid duplicate devices from LUN scan Greg KH
2011-08-03 22:00 ` [033/102] [SCSI] libsas: remove expander from dev list on error Greg KH
2011-08-03 22:00 ` [034/102] rtlwifi: rtl8192cu: Fix duplicate if test Greg KH
2011-08-03 22:00 ` [035/102] mac80211: Restart STA timers only on associated state Greg KH
2011-08-03 22:00 ` [036/102] irq_work, ppc: Fix up arch hooks Greg KH
2011-08-03 22:00 ` [037/102] perf tools, x86: Fix 32-bit compile on 64-bit system Greg KH
2011-08-03 22:00 ` [038/102] perf tools: Fix endian conversion reading event attr from file header Greg KH
2011-08-03 22:00 ` [039/102] x86, intel, power: Initialize MSR_IA32_ENERGY_PERF_BIAS Greg KH
2011-08-03 22:01 ` [040/102] perf: Fix software event overflow Greg KH
2011-08-03 22:01 ` [041/102] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
2011-08-03 22:01 ` [042/102] [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise Greg KH
2011-08-03 22:01 ` [043/102] [SCSI] ses: requesting a fault indication Greg KH
2011-08-03 22:01 ` [044/102] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
2011-08-03 22:01 ` [045/102] [SCSI] pmcraid: reject negative request size Greg KH
2011-08-03 22:01 ` [046/102] [SCSI] hpsa: do not attempt to read from a write-only register Greg KH
2011-08-03 22:01 ` [047/102] drm/radeon/kms: fix i2c map for rv250/280 Greg KH
2011-08-03 22:01 ` [048/102] drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1 Greg KH
2011-08-03 22:01 ` [049/102] drm/radeon/kms: add missing vddci setting on NI+ Greg KH
2011-08-03 22:01 ` [050/102] ALSA: virtuoso: fix silent analog output on Xonar Essence ST Deluxe Greg KH
2011-08-03 22:01 ` [051/102] ALSA: hda - Fix duplicated DAC assignments for Realtek Greg KH
2011-08-03 22:01 ` [052/102] pnfs: save layoutcommit lwb at layout header Greg KH
2011-08-03 22:01 ` [053/102] pnfs: save layoutcommit cred at layout header init Greg KH
2011-08-03 22:01 ` [054/102] pnfs: let layoutcommit handle a list of lseg Greg KH
2011-08-03 22:01 ` [055/102] pnfs: use lwb as layoutcommit length Greg KH
2011-08-03 22:01 ` [056/102] kexec, x86: Fix incorrect jump back address if not preserving context Greg KH
2011-08-03 22:01 ` [057/102] oprofile, x86: Fix nmi-unsafe callgraph support Greg KH
2011-08-03 22:01 ` [058/102] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
2011-08-03 22:01 ` [059/102] irq_work, alpha: Fix up arch hooks Greg KH
2011-08-03 22:01 ` [060/102] tracing: Fix bug when reading system filters on module removal Greg KH
2011-08-03 22:01 ` [061/102] tracing: Have "enable" file use refcounts like the "filter" file Greg KH
2011-08-03 22:01 ` [062/102] XZ: Fix missing <linux/kernel.h> include Greg KH
2011-08-03 22:01 ` [063/102] PCI: ARI is a PCIe v2 feature Greg KH
2011-08-03 22:01 ` [064/102] cciss: do not attempt to read from a write-only register Greg KH
2011-08-03 22:01 ` [065/102] drivers/firmware/sigma.c needs MODULE_LICENSE Greg KH
2011-08-03 22:01 ` [066/102] geode: reflect mfgpt dependency on mfd Greg KH
2011-08-03 22:01 ` [067/102] mm/futex: fix futex writes on archs with SW tracking of dirty & young Greg KH
2011-08-03 22:01 ` [068/102] mm/backing-dev.c: reset bdi min_ratio in bdi_unregister() Greg KH
2011-08-03 22:01 ` [069/102] xtensa: prevent arbitrary read in ptrace Greg KH
2011-08-03 22:01 ` [070/102] ext4: fix i_blocks/quota accounting when extent insertion fails Greg KH
2011-08-03 22:01 ` [071/102] ext4: free allocated and pre-allocated blocks when check_eofblocks_fl fails Greg KH
2011-08-03 22:01 ` [072/102] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
2011-08-03 22:01 ` [073/102] ecryptfs: Make inode bdi consistent with superblock bdi Greg KH
2011-08-03 22:01 ` [074/102] eCryptfs: Unlock keys needed by ecryptfsd Greg KH
2011-08-03 22:01 ` [075/102] nfsd: dont break lease on CLAIM_DELEGATE_CUR Greg KH
2011-08-03 22:01 ` [076/102] nfsd4: remember to put RW access on stateid destruction Greg KH
2011-08-03 22:01 ` [077/102] nfsd4: fix file leak on open_downgrade Greg KH
2011-08-03 22:01 ` [078/102] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
2011-08-03 22:01 ` [079/102] NFSv4: Dont use the delegation->inode in nfs_mark_return_delegation() Greg KH
2011-08-03 22:01 ` [080/102] NFS: Fix spurious readdir cookie loop messages Greg KH
2011-08-03 22:01 ` [081/102] proc: fix a race in do_io_accounting() Greg KH
2011-08-03 22:01 ` [082/102] n_gsm: fix the wrong FCS handling Greg KH
2011-08-03 22:01 ` [083/102] EHCI: only power off port if over-current is active Greg KH
2011-08-03 22:01 ` [084/102] EHCI: fix direction handling for interrupt data toggles Greg KH
2011-08-03 22:01 ` [085/102] cfg80211: really ignore the regulatory request Greg KH
2011-08-03 22:01 ` [086/102] memcg: fix behavior of mem_cgroup_resize_limit() Greg KH
2011-08-03 22:01 ` [087/102] tty/serial: Fix XSCALE serial ports, e.g. ce4100 Greg KH
2011-08-03 22:01 ` [088/102] SERIAL: SC26xx: Fix link error Greg KH
2011-08-03 22:01 ` [089/102] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
2011-08-03 22:01 ` [090/102] hvc_console: Improve tty/console put_chars handling Greg KH
2011-08-03 22:01 ` [091/102] ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID Greg KH
2011-08-03 22:01 ` [092/102] AppArmor: Fix reference to rcu protected pointer outside of rcu_read_lock Greg KH
2011-08-03 22:01 ` [093/102] AppArmor: Fix masking of capabilities in complain mode Greg KH
2011-08-03 22:01 ` [094/102] oom: task->mm == NULL doesnt mean the memory was freed Greg KH
2011-08-03 22:01 ` [095/102] rt2x00: Add device ID for RT539F device Greg KH
2011-08-03 22:01 ` [096/102] GFS2: Fix mount hang caused by certain access pattern to sysfs files Greg KH
2011-08-03 22:01 ` [097/102] watchdog: shwdt: fix usage of mod_timer Greg KH
2011-08-03 22:01 ` [098/102] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
2011-08-03 22:01 ` [099/102] dm io: flush cpu cache with vmapped io Greg KH
2011-08-03 22:02 ` [100/102] dm snapshot: flush disk cache when merging Greg KH
2011-08-03 22:02 ` [101/102] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
2011-08-03 22:02 ` [102/102] dm: fix idr leak on module removal Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox