* [01/55] ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [02/55] [media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner Greg KH
` (53 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Liam Girdwood, Mark Brown
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
commit e999dc50404d401150a5429b6459473a691fd1a0 upstream.
The Blackfin DMA controller can report one frame beyond the end of the
buffer in the wraparound case but ALSA requires that the pointer always
be in the buffer. Do the wraparound to handle this. A similar bug is
likely to apply to the other Blackfin PCM drivers but the code is less
obvious to inspection and I don't have a user to test.
Reported-by: Kieran O'Leary <Kieran.O'Leary@wolfsonmicro.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/blackfin/bf5xx-i2s-pcm.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -139,11 +139,20 @@ static snd_pcm_uframes_t bf5xx_pcm_point
pr_debug("%s enter\n", __func__);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
diff = sport_curr_offset_tx(sport);
- frames = bytes_to_frames(substream->runtime, diff);
} else {
diff = sport_curr_offset_rx(sport);
- frames = bytes_to_frames(substream->runtime, diff);
}
+
+ /*
+ * TX at least can report one frame beyond the end of the
+ * buffer if we hit the wraparound case - clamp to within the
+ * buffer as the ALSA APIs require.
+ */
+ if (diff == snd_pcm_lib_buffer_bytes(substream))
+ diff = 0;
+
+ frames = bytes_to_frames(substream->runtime, diff);
+
return frames;
}
^ permalink raw reply [flat|nested] 64+ messages in thread
* [02/55] [media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
2011-08-06 0:01 ` [01/55] ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [03/55] [media] pvrusb2: fix g/s_tuner support Greg KH
` (52 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Hans Verkuil,
Mauro Carvalho Chehab
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <hans.verkuil@cisco.com>
commit 227690df75382e46a4f6ea1bbc5df855a674b47f upstream.
The subdevs are supposed to receive a valid tuner type for the g_frequency
and g/s_tuner subdev ops. Some drivers do this, others don't. So prefill
this in v4l2-ioctl.c based on whether the device node from which this is
called is a radio node or not.
The spec does not require applications to fill in the type, and if they
leave it at 0 then the 'check_mode' call in tuner-core.c will return
an error and the ioctl does nothing.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/media/video/v4l2-ioctl.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -1600,6 +1600,8 @@ static long __video_do_ioctl(struct file
if (!ops->vidioc_g_tuner)
break;
+ p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+ V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
ret = ops->vidioc_g_tuner(file, fh, p);
if (!ret)
dbgarg(cmd, "index=%d, name=%s, type=%d, "
@@ -1618,6 +1620,8 @@ static long __video_do_ioctl(struct file
if (!ops->vidioc_s_tuner)
break;
+ p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+ V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
dbgarg(cmd, "index=%d, name=%s, type=%d, "
"capability=0x%x, rangelow=%d, "
"rangehigh=%d, signal=%d, afc=%d, "
@@ -1636,6 +1640,8 @@ static long __video_do_ioctl(struct file
if (!ops->vidioc_g_frequency)
break;
+ p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+ V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
ret = ops->vidioc_g_frequency(file, fh, p);
if (!ret)
dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n",
^ permalink raw reply [flat|nested] 64+ messages in thread
* [03/55] [media] pvrusb2: fix g/s_tuner support
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
2011-08-06 0:01 ` [01/55] ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values Greg KH
2011-08-06 0:01 ` [02/55] [media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [04/55] [media] bttv: fix s_tuner for radio Greg KH
` (51 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Hans Verkuil, Mike Isely,
Mauro Carvalho Chehab
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <hans.verkuil@cisco.com>
commit 50e9efd60b213ce43ad6979bfc18e25eec2d8413 upstream.
The tuner-core subdev requires that the type field of v4l2_tuner is
filled in correctly. This is done in v4l2-ioctl.c, but pvrusb2 doesn't
use that yet, so we have to do it manually based on whether the current
input is radio or not.
Tested with my pvrusb2.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/media/video/pvrusb2/pvrusb2-hdw.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2979,6 +2979,8 @@ static void pvr2_subdev_update(struct pv
if (hdw->input_dirty || hdw->audiomode_dirty || hdw->force_dirty) {
struct v4l2_tuner vt;
memset(&vt, 0, sizeof(vt));
+ vt.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
+ V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
vt.audmode = hdw->audiomode_val;
v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, s_tuner, &vt);
}
@@ -5064,6 +5066,8 @@ void pvr2_hdw_status_poll(struct pvr2_hd
{
struct v4l2_tuner *vtp = &hdw->tuner_signal_info;
memset(vtp, 0, sizeof(*vtp));
+ vtp->type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
+ V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
hdw->tuner_signal_stale = 0;
/* Note: There apparently is no replacement for VIDIOC_CROPCAP
using v4l2-subdev - therefore we can't support that AT ALL right
^ permalink raw reply [flat|nested] 64+ messages in thread
* [04/55] [media] bttv: fix s_tuner for radio
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (2 preceding siblings ...)
2011-08-06 0:01 ` [03/55] [media] pvrusb2: fix g/s_tuner support Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [05/55] gro: Only reset frag0 when skb can be pulled Greg KH
` (50 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Hans Verkuil,
Mauro Carvalho Chehab
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <hans.verkuil@cisco.com>
commit a024c1a6b274e11596d124619e43c25560f64c01 upstream.
Fix typo: g_tuner should have been s_tuner.
Tested with a bttv card.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/media/video/bt8xx/bttv-driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3532,7 +3532,7 @@ static int radio_s_tuner(struct file *fi
if (0 != t->index)
return -EINVAL;
- bttv_call_all(btv, tuner, g_tuner, t);
+ bttv_call_all(btv, tuner, s_tuner, t);
return 0;
}
^ permalink raw reply [flat|nested] 64+ messages in thread
* [05/55] gro: Only reset frag0 when skb can be pulled
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (3 preceding siblings ...)
2011-08-06 0:01 ` [04/55] [media] bttv: fix s_tuner for radio Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [06/55] NFSv4.1: update nfs4_fattr_bitmap_maxsz Greg KH
` (49 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Herbert Xu, David S. Miller
2.6.32-longterm 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
@@ -1164,9 +1164,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] 64+ messages in thread
* [06/55] NFSv4.1: update nfs4_fattr_bitmap_maxsz
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (4 preceding siblings ...)
2011-08-06 0:01 ` [05/55] gro: Only reset frag0 when skb can be pulled Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks Greg KH
` (48 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Andy Adamson,
Trond Myklebust
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Andy Adamson <andros@netapp.com>
commit e5012d1f3861d18c7f3814e757c1c3ab3741dbcd upstream.
Attribute IDs assigned in RFC 5661 now require three bitmaps.
Fixes hitting a BUG_ON in xdr_shrink_bufhead when getting ACLs.
Signed-off-by: Andy Adamson <andros@netapp.com>
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
@@ -88,7 +88,7 @@ static int nfs4_stat_to_errno(int);
#define encode_getfh_maxsz (op_encode_hdr_maxsz)
#define decode_getfh_maxsz (op_decode_hdr_maxsz + 1 + \
((3+NFS4_FHSIZE) >> 2))
-#define nfs4_fattr_bitmap_maxsz 3
+#define nfs4_fattr_bitmap_maxsz 4
#define encode_getattr_maxsz (op_encode_hdr_maxsz + nfs4_fattr_bitmap_maxsz)
#define nfs4_name_maxsz (1 + ((3 + NFS4_MAXNAMLEN) >> 2))
#define nfs4_path_maxsz (1 + ((3 + NFS4_MAXPATHLEN) >> 2))
^ permalink raw reply [flat|nested] 64+ messages in thread
* [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (5 preceding siblings ...)
2011-08-06 0:01 ` [06/55] NFSv4.1: update nfs4_fattr_bitmap_maxsz Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-07 17:38 ` [Stable-review] " Ben Hutchings
2011-08-06 0:01 ` [08/55] SUNRPC: Fix use of static variable in rpcb_getport_async Greg KH
` (47 subsequent siblings)
54 siblings, 1 reply; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Trond Myklebust
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit b55c59892e1f3b6c7d4b9ccffb4263e1486fb990 upstream.
Since rpc_killall_tasks may modify the rpc_task's tk_action field
without any locking, we need to be careful when dereferencing it.
Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/sunrpc/sched.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -613,30 +613,25 @@ static void __rpc_execute(struct rpc_tas
BUG_ON(RPC_IS_QUEUED(task));
for (;;) {
+ void (*do_action)(struct rpc_task *);
/*
- * Execute any pending callback.
+ * Execute any pending callback first.
*/
- if (task->tk_callback) {
- void (*save_callback)(struct rpc_task *);
-
- /*
- * We set tk_callback to NULL before calling it,
- * in case it sets the tk_callback field itself:
- */
- save_callback = task->tk_callback;
- task->tk_callback = NULL;
- save_callback(task);
- } else {
+ do_action = task->tk_callback;
+ task->tk_callback = NULL;
+ if (do_action == NULL) {
/*
* Perform the next FSM step.
- * tk_action may be NULL when the task has been killed
- * by someone else.
+ * tk_action may be NULL if the task has been killed.
+ * In particular, note that rpc_killall_tasks may
+ * do this at any time, so beware when dereferencing.
*/
- if (task->tk_action == NULL)
+ do_action = task->tk_action;
+ if (do_action == NULL)
break;
- task->tk_action(task);
}
+ do_action(task);
/*
* Lockless check for whether task is sleeping or not.
^ permalink raw reply [flat|nested] 64+ messages in thread
* [08/55] SUNRPC: Fix use of static variable in rpcb_getport_async
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (6 preceding siblings ...)
2011-08-06 0:01 ` [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [09/55] si4713-i2c: avoid potential buffer overflow on si4713 Greg KH
` (46 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Ben Greear, Trond Myklebust
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Ben Greear <greearb@candelatech.com>
commit ec0dd267bf7d08cb30e321e45a75fd40edd7e528 upstream.
Because struct rpcbind_args *map was declared static, if two
threads entered this method at the same time, the values
assigned to map could be sent two two differen tasks.
This could cause all sorts of problems, include use-after-free
and double-free of memory.
Fix this by removing the static declaration so that the map
pointer is on the stack.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/sunrpc/rpcb_clnt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -533,7 +533,7 @@ void rpcb_getport_async(struct rpc_task
u32 bind_version;
struct rpc_xprt *xprt;
struct rpc_clnt *rpcb_clnt;
- static struct rpcbind_args *map;
+ struct rpcbind_args *map;
struct rpc_task *child;
struct sockaddr_storage addr;
struct sockaddr *sap = (struct sockaddr *)&addr;
^ permalink raw reply [flat|nested] 64+ messages in thread
* [09/55] si4713-i2c: avoid potential buffer overflow on si4713
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (7 preceding siblings ...)
2011-08-06 0:01 ` [08/55] SUNRPC: Fix use of static variable in rpcb_getport_async Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [10/55] hwmon: (max1111) Fix race condition causing NULL pointer exception Greg KH
` (45 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Mauro Carvalho Chehab,
Sakari Ailus, Eduardo Valentin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Mauro Carvalho Chehab <mchehab@redhat.com>
commit dc6b845044ccb7e9e6f3b7e71bd179b3cf0223b6 upstream.
While compiling it with Fedora 15, I noticed this issue:
inlined from ‘si4713_write_econtrol_string’ at drivers/media/radio/si4713-i2c.c:1065:24:
arch/x86/include/asm/uaccess_32.h:211:26: error: call to ‘copy_from_user_overflow’ declared with attribute error: copy_from_user() buffer size is not provably correct
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Eugene Teo <eugeneteo@kernel.sg>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/media/radio/si4713-i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/media/radio/si4713-i2c.c
+++ b/drivers/media/radio/si4713-i2c.c
@@ -1003,7 +1003,7 @@ static int si4713_write_econtrol_string(
char ps_name[MAX_RDS_PS_NAME + 1];
len = control->size - 1;
- if (len > MAX_RDS_PS_NAME) {
+ if (len < 0 || len > MAX_RDS_PS_NAME) {
rval = -ERANGE;
goto exit;
}
@@ -1025,7 +1025,7 @@ static int si4713_write_econtrol_string(
char radio_text[MAX_RDS_RADIO_TEXT + 1];
len = control->size - 1;
- if (len > MAX_RDS_RADIO_TEXT) {
+ if (len < 0 || len > MAX_RDS_RADIO_TEXT) {
rval = -ERANGE;
goto exit;
}
^ permalink raw reply [flat|nested] 64+ messages in thread
* [10/55] hwmon: (max1111) Fix race condition causing NULL pointer exception
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (8 preceding siblings ...)
2011-08-06 0:01 ` [09/55] si4713-i2c: avoid potential buffer overflow on si4713 Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [11/55] bridge: send proper message_age in config BPDU Greg KH
` (44 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Pavel Herrmann, Russell King,
Pavel Machek, Marek Vasut, Cyril Hrubis, Jean Delvare
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Pavel Herrmann <morpheus.ibis@gmail.com>
commit d3f684f2820a7f42acef68bea6622d9032127fb2 upstream.
spi_sync call uses its spi_message parameter to keep completion information,
using a drvdata structure is not thread-safe. Use a mutex to prevent
multiple access to shared driver data.
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Cyril Hrubis <metan@ucw.cz>
Tested-by: Stanislav Brabec <utx@penguin.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/hwmon/max1111.c | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/drivers/hwmon/max1111.c
+++ b/drivers/hwmon/max1111.c
@@ -39,6 +39,8 @@ struct max1111_data {
struct spi_transfer xfer[2];
uint8_t *tx_buf;
uint8_t *rx_buf;
+ struct mutex drvdata_lock;
+ /* protect msg, xfer and buffers from multiple access */
};
static int max1111_read(struct device *dev, int channel)
@@ -47,6 +49,9 @@ static int max1111_read(struct device *d
uint8_t v1, v2;
int err;
+ /* writing to drvdata struct is not thread safe, wait on mutex */
+ mutex_lock(&data->drvdata_lock);
+
data->tx_buf[0] = (channel << MAX1111_CTRL_SEL_SH) |
MAX1111_CTRL_PD0 | MAX1111_CTRL_PD1 |
MAX1111_CTRL_SGL | MAX1111_CTRL_UNI | MAX1111_CTRL_STR;
@@ -54,12 +59,15 @@ static int max1111_read(struct device *d
err = spi_sync(data->spi, &data->msg);
if (err < 0) {
dev_err(dev, "spi_sync failed with %d\n", err);
+ mutex_unlock(&data->drvdata_lock);
return err;
}
v1 = data->rx_buf[0];
v2 = data->rx_buf[1];
+ mutex_unlock(&data->drvdata_lock);
+
if ((v1 & 0xc0) || (v2 & 0x3f))
return -EINVAL;
@@ -175,6 +183,8 @@ static int __devinit max1111_probe(struc
if (err)
goto err_free_data;
+ mutex_init(&data->drvdata_lock);
+
data->spi = spi;
spi_set_drvdata(spi, data);
@@ -212,6 +222,7 @@ static int __devexit max1111_remove(stru
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group);
+ mutex_destroy(&data->drvdata_lock);
kfree(data->rx_buf);
kfree(data->tx_buf);
kfree(data);
^ permalink raw reply [flat|nested] 64+ messages in thread
* [11/55] bridge: send proper message_age in config BPDU
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (9 preceding siblings ...)
2011-08-06 0:01 ` [10/55] hwmon: (max1111) Fix race condition causing NULL pointer exception Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [12/55] davinci: DM365 EVM: fix video input mux bits Greg KH
` (43 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Stephen Hemminger,
David S. Miller
2.6.32-longterm 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
@@ -75,6 +75,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
@@ -165,8 +165,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;
@@ -190,6 +189,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] 64+ messages in thread
* [12/55] davinci: DM365 EVM: fix video input mux bits
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (10 preceding siblings ...)
2011-08-06 0:01 ` [11/55] bridge: send proper message_age in config BPDU Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [13/55] libata: fix unexpectedly frozen port after ata_eh_reset() Greg KH
` (42 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jon Povey, Manjunath Hadli,
Sekhar Nori
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Jon Povey <jon.povey@racelogic.co.uk>
commit 9daedd833a38edd90cf7baa1b1fcf61c3a0721e3 upstream.
Video input mux settings for tvp7002 and imager inputs were swapped.
Comment was correct.
Tested on EVM with tvp7002 input.
Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/arm/mach-davinci/board-dm365-evm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -413,7 +413,7 @@ fail:
*/
if (have_imager()) {
label = "HD imager";
- mux |= 1;
+ mux |= 2;
/* externally mux MMC1/ENET/AIC33 to imager */
mux |= BIT(6) | BIT(5) | BIT(3);
@@ -434,7 +434,7 @@ fail:
resets &= ~BIT(1);
if (have_tvp7002()) {
- mux |= 2;
+ mux |= 1;
resets &= ~BIT(2);
label = "tvp7002 HD";
} else {
^ permalink raw reply [flat|nested] 64+ messages in thread
* [13/55] libata: fix unexpectedly frozen port after ata_eh_reset()
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (11 preceding siblings ...)
2011-08-06 0:01 ` [12/55] davinci: DM365 EVM: fix video input mux bits Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [14/55] x86: Make Dell Latitude E5420 use reboot=pci Greg KH
` (41 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Tejun Heo, Dave Howorth,
Jeff Garzik
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 8c56cacc724c7650b893d43068fa66044aa29a61 upstream.
To work around controllers which can't properly plug events while
reset, ata_eh_reset() clears error states and ATA_PFLAG_EH_PENDING
after reset but before RESET is marked done. As reset is the final
recovery action and full verification of devices including onlineness
and classfication match is done afterwards, this shouldn't lead to
lost devices or missed hotplug events.
Unfortunately, it forgot to thaw the port when clearing EH_PENDING, so
if the condition happens after resetting an empty port, the port could
be left frozen and EH will end without thawing it, making the port
unresponsive to further hotplug events.
Thaw if the port is frozen after clearing EH_PENDING. This problem is
reported by Bruce Stenning in the following thread.
http://thread.gmane.org/gmane.linux.kernel/1123265
stable: I think we should weather this patch a bit longer in -rcX
before sending it to -stable. Please wait at least a month
after this patch makes upstream. Thanks.
-v2: Fixed spelling in the comment per Dave Howorth.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Bruce Stenning <b.stenning@indigovision.com>
Cc: Dave Howorth <dhoworth@mrc-lmb.cam.ac.uk>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/ata/libata-eh.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2707,10 +2707,11 @@ int ata_eh_reset(struct ata_link *link,
}
/*
- * Some controllers can't be frozen very well and may set
- * spuruious error conditions during reset. Clear accumulated
- * error information. As reset is the final recovery action,
- * nothing is lost by doing this.
+ * Some controllers can't be frozen very well and may set spurious
+ * error conditions during reset. Clear accumulated error
+ * information and re-thaw the port if frozen. As reset is the
+ * final recovery action and we cross check link onlineness against
+ * device classification later, no hotplug event is lost by this.
*/
spin_lock_irqsave(link->ap->lock, flags);
memset(&link->eh_info, 0, sizeof(link->eh_info));
@@ -2719,6 +2720,9 @@ int ata_eh_reset(struct ata_link *link,
ap->pflags &= ~ATA_PFLAG_EH_PENDING;
spin_unlock_irqrestore(link->ap->lock, flags);
+ if (ap->pflags & ATA_PFLAG_FROZEN)
+ ata_eh_thaw_port(ap);
+
/*
* Make sure onlineness and classification result correspond.
* Hotplug could have happened during reset and some
^ permalink raw reply [flat|nested] 64+ messages in thread
* [14/55] x86: Make Dell Latitude E5420 use reboot=pci
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (12 preceding siblings ...)
2011-08-06 0:01 ` [13/55] libata: fix unexpectedly frozen port after ata_eh_reset() Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [15/55] USB: pl2303: add AdLink ND-6530 USB IDs Greg KH
` (40 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Daniel J Blueman,
H. Peter Anvin
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Daniel J Blueman <daniel.blueman@gmail.com>
commit b7798d28ec15d20fd34b70fa57eb13f0cf6d1ecd upstream.
Rebooting on the Dell E5420 often hangs with the keyboard or ACPI
methods, but is reliable via the PCI method.
[ hpa: this was deferred because we believed for a long time that the
recent reshuffling of the boot priorities in commit
660e34cebf0a11d54f2d5dd8838607452355f321 fixed this platform.
Unfortunately that turned out to be incorrect. ]
Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Link: http://lkml.kernel.org/r/1305248699-2347-1-git-send-email-daniel.blueman@gmail.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kernel/reboot.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -469,6 +469,14 @@ static struct dmi_system_id __initdata p
DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
},
},
+ { /* Handle problems with rebooting on the Latitude E5420. */
+ .callback = set_pci_reboot,
+ .ident = "Dell Latitude E5420",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
+ },
+ },
{ }
};
^ permalink raw reply [flat|nested] 64+ messages in thread
* [15/55] USB: pl2303: add AdLink ND-6530 USB IDs
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (13 preceding siblings ...)
2011-08-06 0:01 ` [14/55] x86: Make Dell Latitude E5420 use reboot=pci Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [16/55] USB: pl2303.h: checkpatch cleanups Greg KH
` (39 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Manuel Jander
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Manuel Jander <manuel.jander@gmail.com>
commit 9a61d72602771906e11a5944e8571f8006387b39 upstream.
I read a rumor that the AdLink ND6530 USB RS232, RS422 and RS485
isolated adapter is actually a PL2303 based usb serial adapter. I
tried it out, and as far as I can tell it works.
Signed-off-by: Manuel Jander <manuel.jander@gmail.com>
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
@@ -100,6 +100,7 @@ static struct usb_device_id id_table []
{ USB_DEVICE(ZEAGLE_VENDOR_ID, ZEAGLE_N2ITION3_PRODUCT_ID) },
{ 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) },
{ } /* Terminating entry */
};
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -140,3 +140,7 @@
/* Sanwa KB-USB2 multimeter cable (ID: 11ad:0001) */
#define SANWA_VENDOR_ID 0x11ad
#define SANWA_PRODUCT_ID 0x0001
+
+/* ADLINK ND-6530 RS232,RS485 and RS422 adapter */
+#define ADLINK_VENDOR_ID 0x0b63
+#define ADLINK_ND6530_PRODUCT_ID 0x6530
^ permalink raw reply [flat|nested] 64+ messages in thread
* [16/55] USB: pl2303.h: checkpatch cleanups
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (14 preceding siblings ...)
2011-08-06 0:01 ` [15/55] USB: pl2303: add AdLink ND-6530 USB IDs Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [17/55] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
` (38 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Greg Kroah-Hartman <gregkh@suse.de>
commit 5d78fcb0caf219e2e6c8e486d7e31fec1333ac06 upstream.
Minor whitespace cleanups to make checkpatch happy.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/serial/pl2303.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -5,7 +5,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
*/
#define BENQ_VENDOR_ID 0x04a5
@@ -142,5 +142,5 @@
#define SANWA_PRODUCT_ID 0x0001
/* ADLINK ND-6530 RS232,RS485 and RS422 adapter */
-#define ADLINK_VENDOR_ID 0x0b63
-#define ADLINK_ND6530_PRODUCT_ID 0x6530
+#define ADLINK_VENDOR_ID 0x0b63
+#define ADLINK_ND6530_PRODUCT_ID 0x6530
^ permalink raw reply [flat|nested] 64+ messages in thread
* [17/55] USB: serial: add IDs for WinChipHead USB->RS232 adapter
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (15 preceding siblings ...)
2011-08-06 0:01 ` [16/55] USB: pl2303.h: checkpatch cleanups Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [18/55] staging: comedi: fix infoleak to userspace Greg KH
` (37 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Wolfgang Denk
2.6.32-longterm 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
@@ -101,6 +101,7 @@ static struct usb_device_id id_table []
{ 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] 64+ messages in thread
* [18/55] staging: comedi: fix infoleak to userspace
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (16 preceding siblings ...)
2011-08-06 0:01 ` [17/55] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [19/55] USB: OHCI: fix another regression for NVIDIA controllers Greg KH
` (36 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Vasiliy Kulikov
2.6.32-longterm 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
@@ -367,8 +367,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] 64+ messages in thread
* [19/55] USB: OHCI: fix another regression for NVIDIA controllers
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (17 preceding siblings ...)
2011-08-06 0:01 ` [18/55] staging: comedi: fix infoleak to userspace Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [20/55] usb: musb: restore INDEX register in resume path Greg KH
` (35 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern
2.6.32-longterm 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
@@ -34,6 +34,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 */
@@ -204,6 +206,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] 64+ messages in thread
* [20/55] usb: musb: restore INDEX register in resume path
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (18 preceding siblings ...)
2011-08-06 0:01 ` [19/55] USB: OHCI: fix another regression for NVIDIA controllers Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [21/55] USB: dummy-hcd needs the has_tt flag Greg KH
` (34 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Anand Gadiyar,
Ajay Kumar Gupta, Felipe Balbi
2.6.32-longterm 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
@@ -1634,6 +1634,7 @@ void musb_dma_completion(struct musb *mu
}
}
}
+ musb_writeb(musb_base, MUSB_INDEX, musb->context.index);
}
#else
^ permalink raw reply [flat|nested] 64+ messages in thread
* [21/55] USB: dummy-hcd needs the has_tt flag
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (19 preceding siblings ...)
2011-08-06 0:01 ` [20/55] usb: musb: restore INDEX register in resume path Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [22/55] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
` (33 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit c5c69f3f0dcf9b569c8f3ad67f3af92cfcedac43 upstream.
Like with other host controllers capable of operating at both high
speed and full speed, we need to indicate that the emulated controller
presented by dummy-hcd has this ability. Otherwise usbcore will not
accept full-speed gadgets under dummy-hcd. This patch (as1469) sets
the appropriate has_tt flag.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/gadget/dummy_hcd.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1886,6 +1886,7 @@ static int dummy_hcd_probe(struct platfo
if (!hcd)
return -ENOMEM;
the_controller = hcd_to_dummy (hcd);
+ hcd->has_tt = 1;
retval = usb_add_hcd(hcd, 0, 0);
if (retval != 0) {
^ permalink raw reply [flat|nested] 64+ messages in thread
* [22/55] ARM: pxa/cm-x300: fix V3020 RTC functionality
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (20 preceding siblings ...)
2011-08-06 0:01 ` [21/55] USB: dummy-hcd needs the has_tt flag Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [23/55] jme: Fix unmap error (Causing system freeze) Greg KH
` (32 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Igor Grinberg, Eric Miao
2.6.32-longterm 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
@@ -143,10 +143,10 @@ static mfp_cfg_t cm_x300_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] 64+ messages in thread
* [23/55] jme: Fix unmap error (Causing system freeze)
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (21 preceding siblings ...)
2011-08-06 0:01 ` [22/55] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [24/55] [SCSI] libsas: remove expander from dev list on error Greg KH
` (31 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Guo-Fu Tseng, Chris Wright,
David S. Miller
2.6.32-longterm 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
@@ -681,20 +681,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] 64+ messages in thread
* [24/55] [SCSI] libsas: remove expander from dev list on error
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (22 preceding siblings ...)
2011-08-06 0:01 ` [23/55] jme: Fix unmap error (Causing system freeze) Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [25/55] mac80211: Restart STA timers only on associated state Greg KH
` (30 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Luben Tuikov,
James Bottomley
2.6.32-longterm 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
@@ -840,6 +840,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] 64+ messages in thread
* [25/55] mac80211: Restart STA timers only on associated state
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (23 preceding siblings ...)
2011-08-06 0:01 ` [24/55] [SCSI] libsas: remove expander from dev list on error Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [26/55] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
` (29 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Rajkumar Manoharan,
John W. Linville
2.6.32-longterm 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
@@ -2308,6 +2308,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] 64+ messages in thread
* [26/55] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups.
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (24 preceding siblings ...)
2011-08-06 0:01 ` [25/55] mac80211: Restart STA timers only on associated state Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [27/55] [SCSI] ses: requesting a fault indication Greg KH
` (28 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Werner Fink, Ankit Jain,
James Bottomley
2.6.32-longterm 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
@@ -196,6 +196,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},
@@ -242,6 +243,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] 64+ messages in thread
* [27/55] [SCSI] ses: requesting a fault indication
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (25 preceding siblings ...)
2011-08-06 0:01 ` [26/55] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:01 ` [28/55] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
` (27 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Douglas Gilbert,
James Bottomley
2.6.32-longterm 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
@@ -157,6 +157,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)
{
@@ -178,7 +182,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] 64+ messages in thread
* [28/55] [SCSI] fix crash in scsi_dispatch_cmd()
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (26 preceding siblings ...)
2011-08-06 0:01 ` [27/55] [SCSI] ses: requesting a fault indication Greg KH
@ 2011-08-06 0:01 ` Greg KH
[not found] ` <1312739411.2591.1026.camel@deadeye>
2011-08-06 0:01 ` [29/55] [SCSI] pmcraid: reject negative request size Greg KH
` (26 subsequent siblings)
54 siblings, 1 reply; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, James Bottomley
2.6.32-longterm 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
@@ -865,6 +865,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
@@ -215,6 +215,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] 64+ messages in thread
* [29/55] [SCSI] pmcraid: reject negative request size
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (27 preceding siblings ...)
2011-08-06 0:01 ` [28/55] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
@ 2011-08-06 0:01 ` Greg KH
2011-08-06 0:02 ` [30/55] kexec, x86: Fix incorrect jump back address if not Greg KH
` (25 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Dan Rosenberg,
James Bottomley
2.6.32-longterm 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
@@ -3557,6 +3557,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] 64+ messages in thread
* [30/55] kexec, x86: Fix incorrect jump back address if not
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (28 preceding siblings ...)
2011-08-06 0:01 ` [29/55] [SCSI] pmcraid: reject negative request size Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [31/55] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
` (24 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Huang Ying,
Eric W. Biederman, Vivek Goyal, Ingo Molnar
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
preserving context
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] 64+ messages in thread
* [31/55] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (29 preceding siblings ...)
2011-08-06 0:02 ` [30/55] kexec, x86: Fix incorrect jump back address if not Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [32/55] PCI: ARI is a PCIe v2 feature Greg KH
` (23 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Anton Blanchard,
Michael Neuling, Benjamin Herrenschmidt
2.6.32-longterm 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
@@ -176,12 +176,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] 64+ messages in thread
* [32/55] PCI: ARI is a PCIe v2 feature
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (30 preceding siblings ...)
2011-08-06 0:02 ` [31/55] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [33/55] cciss: do not attempt to read from a write-only register Greg KH
` (22 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Don Dutile, Chris Wright,
Jesse Barnes
2.6.32-longterm 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
@@ -1507,7 +1507,7 @@ void pci_enable_ari(struct pci_dev *dev)
{
int pos;
u32 cap;
- u16 ctrl;
+ u16 flags, ctrl;
struct pci_dev *bridge;
if (!dev->is_pcie || dev->devfn)
@@ -1525,6 +1525,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] 64+ messages in thread
* [33/55] cciss: do not attempt to read from a write-only register
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (31 preceding siblings ...)
2011-08-06 0:02 ` [32/55] PCI: ARI is a PCIe v2 feature Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [34/55] xtensa: prevent arbitrary read in ptrace Greg KH
` (21 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Stephen M. Cameron,
Jens Axboe
2.6.32-longterm 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
@@ -165,7 +165,7 @@ static void SA5_submit_command( ctlr_inf
printk("Sending %x - down to controller\n", 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] 64+ messages in thread
* [34/55] xtensa: prevent arbitrary read in ptrace
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (32 preceding siblings ...)
2011-08-06 0:02 ` [33/55] cciss: do not attempt to read from a write-only register Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [35/55] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
` (20 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Dan Rosenberg,
Christian Zankel, Oleg Nesterov
2.6.32-longterm 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
@@ -136,6 +136,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] 64+ messages in thread
* [35/55] ext3: Fix oops in ext3_try_to_allocate_with_rsv()
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (33 preceding siblings ...)
2011-08-06 0:02 ` [34/55] xtensa: prevent arbitrary read in ptrace Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [36/55] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
` (19 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sage Weil, Jan Kara
2.6.32-longterm 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
@@ -800,8 +800,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] 64+ messages in thread
* [36/55] svcrpc: fix list-corrupting race on nfsd shutdown
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (34 preceding siblings ...)
2011-08-06 0:02 ` [35/55] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [37/55] EHCI: only power off port if over-current is active Greg KH
` (18 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, gnb, J. Bruce Fields
2.6.32-longterm 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
@@ -896,12 +896,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--;
^ permalink raw reply [flat|nested] 64+ messages in thread
* [37/55] EHCI: only power off port if over-current is active
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (35 preceding siblings ...)
2011-08-06 0:02 ` [36/55] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [38/55] EHCI: fix direction handling for interrupt data toggles Greg KH
` (17 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sergei Shtylyov, Alan Stern
2.6.32-longterm 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
@@ -758,10 +758,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] 64+ messages in thread
* [38/55] EHCI: fix direction handling for interrupt data toggles
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (36 preceding siblings ...)
2011-08-06 0:02 ` [37/55] EHCI: only power off port if over-current is active Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [39/55] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
` (16 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Alan Stern
2.6.32-longterm 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);
@@ -923,6 +923,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
@@ -366,6 +366,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] 64+ messages in thread
* [39/55] powerpc/pseries/hvconsole: Fix dropped console output
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (37 preceding siblings ...)
2011-08-06 0:02 ` [38/55] EHCI: fix direction handling for interrupt data toggles Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [40/55] x86: Hpet: Avoid the comparator readback penalty Greg KH
` (15 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Anton Blanchard,
Benjamin Herrenschmidt
2.6.32-longterm 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] 64+ messages in thread
* [40/55] x86: Hpet: Avoid the comparator readback penalty
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (38 preceding siblings ...)
2011-08-06 0:02 ` [39/55] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [41/55] x86: HPET: Chose a paranoid safe value for the ETIME check Greg KH
` (14 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Thomas Gleixner,
Damien Wyart, Venkatesh Pallipadi, Arjan van de Ven,
Andreas Herrmann, Suresh Siddha, Konstantin Khlebnikov
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
(imported from commit v2.6.36-rc4-167-g995bd3b)
Due to the overly intelligent design of HPETs, we need to workaround
the problem that the compare value which we write is already behind
the actual counter value at the point where the value hits the real
compare register. This happens for two reasons:
1) We read out the counter, add the delta and write the result to the
compare register. When a NMI or SMI hits between the read out and
the write then the counter can be ahead of the event already
2) The write to the compare register is delayed by up to two HPET
cycles in certain chipsets.
We worked around this by reading back the compare register to make
sure that the written value has hit the hardware. For certain ICH9+
chipsets this can require two readouts, as the first one can return
the previous compare register value. That's bad performance wise for
the normal case where the event is far enough in the future.
As we already know that the write can be delayed by up to two cycles
we can avoid the read back of the compare register completely if we
make the decision whether the delta has elapsed already or not based
on the following calculation:
cmp = event - actual_count;
If cmp is less than 8 HPET clock cycles, then we decide that the event
has happened already and return -ETIME. That covers the above #1 and
#2 problems which would cause a wait for HPET wraparound (~306
seconds).
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Nix <nix@esperi.org.uk>
Tested-by: Artur Skawina <art.08.09@gmail.com>
Cc: Damien Wyart <damien.wyart@free.fr>
Tested-by: John Drescher <drescherjm@gmail.com>
Cc: Venkatesh Pallipadi <venki@google.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Tested-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <alpine.LFD.2.00.1009151500060.2416@localhost6.localdomain6>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kernel/hpet.c | 43 +++++++++++++++++++++----------------------
1 file changed, 21 insertions(+), 22 deletions(-)
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -379,36 +379,35 @@ static int hpet_next_event(unsigned long
struct clock_event_device *evt, int timer)
{
u32 cnt;
+ s32 res;
cnt = hpet_readl(HPET_COUNTER);
cnt += (u32) delta;
hpet_writel(cnt, HPET_Tn_CMP(timer));
/*
- * We need to read back the CMP register on certain HPET
- * implementations (ATI chipsets) which seem to delay the
- * transfer of the compare register into the internal compare
- * logic. With small deltas this might actually be too late as
- * the counter could already be higher than the compare value
- * at that point and we would wait for the next hpet interrupt
- * forever. We found out that reading the CMP register back
- * forces the transfer so we can rely on the comparison with
- * the counter register below. If the read back from the
- * compare register does not match the value we programmed
- * then we might have a real hardware problem. We can not do
- * much about it here, but at least alert the user/admin with
- * a prominent warning.
- * An erratum on some chipsets (ICH9,..), results in comparator read
- * immediately following a write returning old value. Workaround
- * for this is to read this value second time, when first
- * read returns old value.
+ * HPETs are a complete disaster. The compare register is
+ * based on a equal comparison and neither provides a less
+ * than or equal functionality (which would require to take
+ * the wraparound into account) nor a simple count down event
+ * mode. Further the write to the comparator register is
+ * delayed internally up to two HPET clock cycles in certain
+ * chipsets (ATI, ICH9,10). We worked around that by reading
+ * back the compare register, but that required another
+ * workaround for ICH9,10 chips where the first readout after
+ * write can return the old stale value. We already have a
+ * minimum delta of 5us enforced, but a NMI or SMI hitting
+ * between the counter readout and the comparator write can
+ * move us behind that point easily. Now instead of reading
+ * the compare register back several times, we make the ETIME
+ * decision based on the following: Return ETIME if the
+ * counter value after the write is less than 8 HPET cycles
+ * away from the event or if the counter is already ahead of
+ * the event.
*/
- if (unlikely((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt)) {
- WARN_ONCE((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt,
- KERN_WARNING "hpet: compare register read back failed.\n");
- }
+ res = (s32)(cnt - (u32)hpet_readl(HPET_COUNTER));
- return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
+ return res < 8 ? -ETIME : 0;
}
static void hpet_legacy_set_mode(enum clock_event_mode mode,
^ permalink raw reply [flat|nested] 64+ messages in thread
* [41/55] x86: HPET: Chose a paranoid safe value for the ETIME check
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (39 preceding siblings ...)
2011-08-06 0:02 ` [40/55] x86: Hpet: Avoid the comparator readback penalty Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [42/55] Revert "block: rescan partitions on invalidated devices on -ENOMEDIA Greg KH
` (13 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Thomas Gleixner, Simon Kirby,
Borislav Petkov, Andreas Herrmann, John Stultz,
Konstantin Khlebnikov
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
(imported from commit v2.6.37-rc5-64-gf1c1807)
commit 995bd3bb5 (x86: Hpet: Avoid the comparator readback penalty)
chose 8 HPET cycles as a safe value for the ETIME check, as we had the
confirmation that the posted write to the comparator register is
delayed by two HPET clock cycles on Intel chipsets which showed
readback problems.
After that patch hit mainline we got reports from machines with newer
AMD chipsets which seem to have an even longer delay. See
http://thread.gmane.org/gmane.linux.kernel/1054283 and
http://thread.gmane.org/gmane.linux.kernel/1069458 for further
information.
Boris tried to come up with an ACPI based selection of the minimum
HPET cycles, but this failed on a couple of test machines. And of
course we did not get any useful information from the hardware folks.
For now our only option is to chose a paranoid high and safe value for
the minimum HPET cycles used by the ETIME check. Adjust the minimum ns
value for the HPET clockevent accordingly.
Reported-Bistected-and-Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <alpine.LFD.2.00.1012131222420.2653@localhost6.localdomain6>
Cc: Simon Kirby <sim@hostway.ca>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andreas Herrmann <Andreas.Herrmann3@amd.com>
Cc: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kernel/hpet.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -27,6 +27,9 @@
#define HPET_DEV_FSB_CAP 0x1000
#define HPET_DEV_PERI_CAP 0x2000
+#define HPET_MIN_CYCLES 128
+#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1))
+
#define EVT_TO_HPET_DEV(evt) container_of(evt, struct hpet_dev, evt)
/*
@@ -298,8 +301,9 @@ static void hpet_legacy_clockevent_regis
/* Calculate the min / max delta */
hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
&hpet_clockevent);
- /* 5 usec minimum reprogramming delta. */
- hpet_clockevent.min_delta_ns = 5000;
+ /* Setup minimum reprogramming delta. */
+ hpet_clockevent.min_delta_ns = clockevent_delta2ns(HPET_MIN_PROG_DELTA,
+ &hpet_clockevent);
/*
* Start hpet with the boot cpu mask and make it
@@ -392,22 +396,24 @@ static int hpet_next_event(unsigned long
* the wraparound into account) nor a simple count down event
* mode. Further the write to the comparator register is
* delayed internally up to two HPET clock cycles in certain
- * chipsets (ATI, ICH9,10). We worked around that by reading
- * back the compare register, but that required another
- * workaround for ICH9,10 chips where the first readout after
- * write can return the old stale value. We already have a
- * minimum delta of 5us enforced, but a NMI or SMI hitting
+ * chipsets (ATI, ICH9,10). Some newer AMD chipsets have even
+ * longer delays. We worked around that by reading back the
+ * compare register, but that required another workaround for
+ * ICH9,10 chips where the first readout after write can
+ * return the old stale value. We already had a minimum
+ * programming delta of 5us enforced, but a NMI or SMI hitting
* between the counter readout and the comparator write can
* move us behind that point easily. Now instead of reading
* the compare register back several times, we make the ETIME
* decision based on the following: Return ETIME if the
- * counter value after the write is less than 8 HPET cycles
+ * counter value after the write is less than HPET_MIN_CYCLES
* away from the event or if the counter is already ahead of
- * the event.
+ * the event. The minimum programming delta for the generic
+ * clockevents code is set to 1.5 * HPET_MIN_CYCLES.
*/
res = (s32)(cnt - (u32)hpet_readl(HPET_COUNTER));
- return res < 8 ? -ETIME : 0;
+ return res < HPET_MIN_CYCLES ? -ETIME : 0;
}
static void hpet_legacy_set_mode(enum clock_event_mode mode,
^ permalink raw reply [flat|nested] 64+ messages in thread
* [42/55] Revert "block: rescan partitions on invalidated devices on -ENOMEDIA
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (40 preceding siblings ...)
2011-08-06 0:02 ` [41/55] x86: HPET: Chose a paranoid safe value for the ETIME check Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [43/55] cifs: clean up cifs_find_smb_ses (try #2) Greg KH
` (12 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Tejun Heo, David Zeuthen,
Martin Pitt, Kay Sievers, Jens Axboe, Andi Kleen
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
too"
This reverts commit 5b2745db12a3f97a9ec9efd4ffa077da707d3e4c (commit
02e352287a40bd456eb78df705bf888bc3161d3f upstream)
This should have only been commited on .38 and newer, not older kernels
like this one, sorry.
Cc: Tejun Heo <tj@kernel.org>
Cc: David Zeuthen <zeuthen@gmail.com>
Cc: Martin Pitt <martin.pitt@ubuntu.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jens Axboe <jaxboe@fusionio.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/block_dev.c | 27 +++++++++------------------
1 file changed, 9 insertions(+), 18 deletions(-)
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1203,7 +1203,6 @@ static int __blkdev_get(struct block_dev
if (!bdev->bd_part)
goto out_clear;
- ret = 0;
if (disk->fops->open) {
ret = disk->fops->open(bdev, mode);
if (ret == -ERESTARTSYS) {
@@ -1219,18 +1218,9 @@ static int __blkdev_get(struct block_dev
mutex_unlock(&bdev->bd_mutex);
goto restart;
}
+ if (ret)
+ goto out_clear;
}
- /*
- * If the device is invalidated, rescan partition
- * if open succeeded or failed with -ENOMEDIUM.
- * The latter is necessary to prevent ghost
- * partitions on a removed medium.
- */
- if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM))
- rescan_partitions(disk, bdev);
- if (ret)
- goto out_clear;
-
if (!bdev->bd_openers) {
bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
bdi = blk_get_backing_dev_info(bdev);
@@ -1238,6 +1228,8 @@ static int __blkdev_get(struct block_dev
bdi = &default_backing_dev_info;
bdev->bd_inode->i_data.backing_dev_info = bdi;
}
+ if (bdev->bd_invalidated)
+ rescan_partitions(disk, bdev);
} else {
struct block_device *whole;
whole = bdget_disk(disk, 0);
@@ -1264,14 +1256,13 @@ static int __blkdev_get(struct block_dev
put_disk(disk);
disk = NULL;
if (bdev->bd_contains == bdev) {
- ret = 0;
- if (bdev->bd_disk->fops->open)
+ if (bdev->bd_disk->fops->open) {
ret = bdev->bd_disk->fops->open(bdev, mode);
- /* the same as first opener case, read comment there */
- if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM))
+ if (ret)
+ goto out_unlock_bdev;
+ }
+ if (bdev->bd_invalidated)
rescan_partitions(bdev->bd_disk, bdev);
- if (ret)
- goto out_unlock_bdev;
}
}
bdev->bd_openers++;
^ permalink raw reply [flat|nested] 64+ messages in thread
* [43/55] cifs: clean up cifs_find_smb_ses (try #2)
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (41 preceding siblings ...)
2011-08-06 0:02 ` [42/55] Revert "block: rescan partitions on invalidated devices on -ENOMEDIA Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [44/55] cifs: fix NULL pointer dereference in cifs_find_smb_ses Greg KH
` (11 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jeff Layton, Steve French,
Moritz Muehlenhoff
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit 4ff67b720c02c36e54d55b88c2931879b7db1cd2 upstream.
This patch replaces the earlier patch by the same name. The only
difference is that MAX_PASSWORD_SIZE has been increased to attempt to
match the limits that windows enforces.
Do a better job of matching sessions by authtype. Matching by username
for a Kerberos session is incorrect, and anonymous sessions need special
handling.
Also, in the case where we do match by username, we also need to match
by password. That ensures that someone else doesn't "borrow" an existing
session without needing to know the password.
Finally, passwords can be longer than 16 bytes. Bump MAX_PASSWORD_SIZE
to 512 to match the size that the userspace mount helper allows.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
[dannf: backported to Debian's 2.6.32]
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/cifs/cifsglob.h | 2 +-
fs/cifs/connect.c | 26 ++++++++++++++++++--------
2 files changed, 19 insertions(+), 9 deletions(-)
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -33,7 +33,7 @@
#define MAX_SHARE_SIZE 64 /* used to be 20, this should still be enough */
#define MAX_USERNAME_SIZE 32 /* 32 is to allow for 15 char names + null
termination then *2 for unicode versions */
-#define MAX_PASSWORD_SIZE 16
+#define MAX_PASSWORD_SIZE 512 /* max for windows seems to be 256 wide chars */
#define CIFS_MIN_RCV_POOL 4
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1588,17 +1588,27 @@ out_err:
}
static struct cifsSesInfo *
-cifs_find_smb_ses(struct TCP_Server_Info *server, char *username)
+cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
{
- struct list_head *tmp;
struct cifsSesInfo *ses;
write_lock(&cifs_tcp_ses_lock);
- list_for_each(tmp, &server->smb_ses_list) {
- ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);
- if (strncmp(ses->userName, username, MAX_USERNAME_SIZE))
- continue;
-
+ list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
+ switch (server->secType) {
+ case Kerberos:
+ if (vol->linux_uid != ses->linux_uid)
+ continue;
+ break;
+ default:
+ /* anything else takes username/password */
+ if (strncmp(ses->userName, vol->username,
+ MAX_USERNAME_SIZE))
+ continue;
+ if (strlen(vol->username) != 0 &&
+ strncmp(ses->password, vol->password,
+ MAX_PASSWORD_SIZE))
+ continue;
+ }
++ses->ses_count;
write_unlock(&cifs_tcp_ses_lock);
return ses;
@@ -2362,7 +2372,7 @@ try_mount_again:
goto out;
}
- pSesInfo = cifs_find_smb_ses(srvTcp, volume_info->username);
+ pSesInfo = cifs_find_smb_ses(srvTcp, volume_info);
if (pSesInfo) {
cFYI(1, ("Existing smb sess found (status=%d)",
pSesInfo->status));
^ permalink raw reply [flat|nested] 64+ messages in thread
* [44/55] cifs: fix NULL pointer dereference in cifs_find_smb_ses
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (42 preceding siblings ...)
2011-08-06 0:02 ` [43/55] cifs: clean up cifs_find_smb_ses (try #2) Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [45/55] cifs: check for NULL session password Greg KH
` (10 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jeff Layton, Steve French
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit fc87a40677bbe0937e2ff0642c7e83c9a4813f3d upstream.
cifs_find_smb_ses assumes that the vol->password field is a valid
pointer, but that's only the case if a password was passed in via
the options string. It's possible that one won't be if there is
no mount helper on the box.
Reported-by: diabel <gacek-2004@wp.pl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/cifs/connect.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1605,7 +1605,8 @@ cifs_find_smb_ses(struct TCP_Server_Info
MAX_USERNAME_SIZE))
continue;
if (strlen(vol->username) != 0 &&
- strncmp(ses->password, vol->password,
+ strncmp(ses->password,
+ vol->password ? vol->password : "",
MAX_PASSWORD_SIZE))
continue;
}
^ permalink raw reply [flat|nested] 64+ messages in thread
* [45/55] cifs: check for NULL session password
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (43 preceding siblings ...)
2011-08-06 0:02 ` [44/55] cifs: fix NULL pointer dereference in cifs_find_smb_ses Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [46/55] gre: fix netns vs proto registration ordering Greg KH
` (9 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jeff Layton, Steve French
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit 24e6cf92fde1f140d8eb0bf7cd24c2c78149b6b2 upstream.
It's possible for a cifsSesInfo struct to have a NULL password, so we
need to check for that prior to running strncmp on it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/cifs/connect.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1605,6 +1605,7 @@ cifs_find_smb_ses(struct TCP_Server_Info
MAX_USERNAME_SIZE))
continue;
if (strlen(vol->username) != 0 &&
+ ses->password != NULL &&
strncmp(ses->password,
vol->password ? vol->password : "",
MAX_PASSWORD_SIZE))
^ permalink raw reply [flat|nested] 64+ messages in thread
* [46/55] gre: fix netns vs proto registration ordering
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (44 preceding siblings ...)
2011-08-06 0:02 ` [45/55] cifs: check for NULL session password Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [47/55] netns xfrm: fixup xfrm6_tunnel error propagation Greg KH
` (8 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alexey Dobriyan,
David S. Miller
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Alexey Dobriyan <adobriyan@gmail.com>
commit c2892f02712e9516d72841d5c019ed6916329794 upstream.
GRE protocol receive hook can be called right after protocol addition is done.
If netns stuff is not yet initialized, we're going to oops in
net_generic().
This is remotely oopsable if ip_gre is compiled as module and packet
comes at unfortunate moment of module loading.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[dannf: backported to Debian's 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/ipv4/ip_gre.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1665,14 +1665,15 @@ static int __init ipgre_init(void)
printk(KERN_INFO "GRE over IPv4 tunneling driver\n");
- if (inet_add_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) {
- printk(KERN_INFO "ipgre init: can't add protocol\n");
- return -EAGAIN;
- }
-
err = register_pernet_gen_device(&ipgre_net_id, &ipgre_net_ops);
if (err < 0)
- goto gen_device_failed;
+ return err;
+
+ err = inet_add_protocol(&ipgre_protocol, IPPROTO_GRE);
+ if (err < 0) {
+ printk(KERN_INFO "ipgre init: can't add protocol\n");
+ goto add_proto_failed;
+ }
err = rtnl_link_register(&ipgre_link_ops);
if (err < 0)
@@ -1688,9 +1689,9 @@ out:
tap_ops_failed:
rtnl_link_unregister(&ipgre_link_ops);
rtnl_link_failed:
- unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
-gen_device_failed:
inet_del_protocol(&ipgre_protocol, IPPROTO_GRE);
+add_proto_failed:
+ unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
goto out;
}
@@ -1698,9 +1699,9 @@ static void __exit ipgre_fini(void)
{
rtnl_link_unregister(&ipgre_tap_ops);
rtnl_link_unregister(&ipgre_link_ops);
- unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0)
printk(KERN_INFO "ipgre close: can't remove protocol\n");
+ unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
}
module_init(ipgre_init);
^ permalink raw reply [flat|nested] 64+ messages in thread
* [47/55] netns xfrm: fixup xfrm6_tunnel error propagation
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (45 preceding siblings ...)
2011-08-06 0:02 ` [46/55] gre: fix netns vs proto registration ordering Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [48/55] tunnels: fix netns vs proto registration ordering Greg KH
` (7 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alexey Dobriyan,
David S. Miller
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Alexey Dobriyan <adobriyan@gmail.com>
commit e924960dacdf85d118a98c7262edf2f99c3015cf upstream.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/ipv6/xfrm6_tunnel.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -344,13 +344,19 @@ static struct xfrm6_tunnel xfrm46_tunnel
static int __init xfrm6_tunnel_init(void)
{
- if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
+ int rv;
+
+ rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6);
+ if (rv < 0)
goto err;
- if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6))
+ rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6);
+ if (rv < 0)
goto unreg;
- if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET))
+ rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET);
+ if (rv < 0)
goto dereg6;
- if (xfrm6_tunnel_spi_init() < 0)
+ rv = xfrm6_tunnel_spi_init();
+ if (rv < 0)
goto dereg46;
return 0;
@@ -361,7 +367,7 @@ dereg6:
unreg:
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
err:
- return -EAGAIN;
+ return rv;
}
static void __exit xfrm6_tunnel_fini(void)
^ permalink raw reply [flat|nested] 64+ messages in thread
* [48/55] tunnels: fix netns vs proto registration ordering
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (46 preceding siblings ...)
2011-08-06 0:02 ` [47/55] netns xfrm: fixup xfrm6_tunnel error propagation Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [49/55] alpha: fix several security issues Greg KH
` (6 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alexey Dobriyan,
David S. Miller
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Alexey Dobriyan <adobriyan@gmail.com>
commit d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978 upstream.
Same stuff as in ip_gre patch: receive hook can be called before netns
setup is done, oopsing in net_generic().
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/ipv4/ipip.c | 13 ++++++-------
net/ipv6/ip6_tunnel.c | 28 +++++++++++++++-------------
net/ipv6/sit.c | 13 ++++++-------
net/ipv6/xfrm6_tunnel.c | 22 +++++++++++-----------
4 files changed, 38 insertions(+), 38 deletions(-)
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -830,15 +830,14 @@ static int __init ipip_init(void)
printk(banner);
- if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) {
+ err = register_pernet_gen_device(&ipip_net_id, &ipip_net_ops);
+ if (err < 0)
+ return err;
+ err = xfrm4_tunnel_register(&ipip_handler, AF_INET);
+ if (err < 0) {
+ unregister_pernet_device(&ipip_net_ops);
printk(KERN_INFO "ipip init: can't register tunnel\n");
- return -EAGAIN;
}
-
- err = register_pernet_gen_device(&ipip_net_id, &ipip_net_ops);
- if (err)
- xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
-
return err;
}
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1466,27 +1466,29 @@ static int __init ip6_tunnel_init(void)
{
int err;
- if (xfrm6_tunnel_register(&ip4ip6_handler, AF_INET)) {
+ err = register_pernet_device(&ip6_tnl_net_ops);
+ if (err < 0)
+ goto out_pernet;
+
+ err = xfrm6_tunnel_register(&ip4ip6_handler, AF_INET);
+ if (err < 0) {
printk(KERN_ERR "ip6_tunnel init: can't register ip4ip6\n");
- err = -EAGAIN;
- goto out;
+ goto out_ip4ip6;
}
- if (xfrm6_tunnel_register(&ip6ip6_handler, AF_INET6)) {
+ err = xfrm6_tunnel_register(&ip6ip6_handler, AF_INET6);
+ if (err < 0) {
printk(KERN_ERR "ip6_tunnel init: can't register ip6ip6\n");
- err = -EAGAIN;
- goto unreg_ip4ip6;
+ goto out_ip6ip6;
}
- err = register_pernet_gen_device(&ip6_tnl_net_id, &ip6_tnl_net_ops);
- if (err < 0)
- goto err_pernet;
return 0;
-err_pernet:
- xfrm6_tunnel_deregister(&ip6ip6_handler, AF_INET6);
-unreg_ip4ip6:
+
+out_ip6ip6:
xfrm6_tunnel_deregister(&ip4ip6_handler, AF_INET);
-out:
+out_ip4ip6:
+ unregister_pernet_device(&ip6_tnl_net_ops);
+out_pernet:
return err;
}
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1086,15 +1086,14 @@ static int __init sit_init(void)
printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n");
- if (xfrm4_tunnel_register(&sit_handler, AF_INET6) < 0) {
- printk(KERN_INFO "sit init: Can't add protocol\n");
- return -EAGAIN;
- }
-
err = register_pernet_gen_device(&sit_net_id, &sit_net_ops);
if (err < 0)
- xfrm4_tunnel_deregister(&sit_handler, AF_INET6);
-
+ return err;
+ err = xfrm4_tunnel_register(&sit_handler, AF_INET6);
+ if (err < 0) {
+ unregister_pernet_device(&sit_net_ops);
+ printk(KERN_INFO "sit init: Can't add protocol\n");
+ }
return err;
}
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -346,36 +346,36 @@ static int __init xfrm6_tunnel_init(void
{
int rv;
- rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6);
+ rv = xfrm6_tunnel_spi_init();
if (rv < 0)
goto err;
+ rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6);
+ if (rv < 0)
+ goto out_type;
rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6);
if (rv < 0)
- goto unreg;
+ goto out_xfrm6;
rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET);
if (rv < 0)
- goto dereg6;
- rv = xfrm6_tunnel_spi_init();
- if (rv < 0)
- goto dereg46;
+ goto out_xfrm46;
return 0;
-dereg46:
- xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
-dereg6:
+out_xfrm46:
xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
-unreg:
+out_xfrm6:
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
+out_type:
+ xfrm6_tunnel_spi_fini();
err:
return rv;
}
static void __exit xfrm6_tunnel_fini(void)
{
- xfrm6_tunnel_spi_fini();
xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
+ xfrm6_tunnel_spi_fini();
}
module_init(xfrm6_tunnel_init);
^ permalink raw reply [flat|nested] 64+ messages in thread
* [49/55] alpha: fix several security issues
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (47 preceding siblings ...)
2011-08-06 0:02 ` [48/55] tunnels: fix netns vs proto registration ordering Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [50/55] proc: restrict access to /proc/PID/io Greg KH
` (5 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Dan Rosenberg,
Richard Henderson, Ivan Kokshaysky, Matt Turner
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit 21c5977a836e399fc710ff2c5367845ed5c2527f upstream.
Fix several security issues in Alpha-specific syscalls. Untested, but
mostly trivial.
1. Signedness issue in osf_getdomainname allows copying out-of-bounds
kernel memory to userland.
2. Signedness issue in osf_sysinfo allows copying large amounts of
kernel memory to userland.
3. Typo (?) in osf_getsysinfo bounds minimum instead of maximum copy
size, allowing copying large amounts of kernel memory to userland.
4. Usage of user pointer in osf_wait4 while under KERNEL_DS allows
privilege escalation via writing return value of sys_wait4 to kernel
memory.
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@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>
---
arch/alpha/kernel/osf_sys.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -431,7 +431,7 @@ SYSCALL_DEFINE2(osf_getdomainname, char
return -EFAULT;
len = namelen;
- if (namelen > 32)
+ if (len > 32)
len = 32;
down_read(&uts_sem);
@@ -618,7 +618,7 @@ SYSCALL_DEFINE3(osf_sysinfo, int, comman
down_read(&uts_sem);
res = sysinfo_table[offset];
len = strlen(res)+1;
- if (len > count)
+ if ((unsigned long)len > (unsigned long)count)
len = count;
if (copy_to_user(buf, res, len))
err = -EFAULT;
@@ -673,7 +673,7 @@ SYSCALL_DEFINE5(osf_getsysinfo, unsigned
return 1;
case GSI_GET_HWRPB:
- if (nbytes < sizeof(*hwrpb))
+ if (nbytes > sizeof(*hwrpb))
return -EINVAL;
if (copy_to_user(buffer, hwrpb, nbytes) != 0)
return -EFAULT;
@@ -1035,6 +1035,7 @@ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, i
{
struct rusage r;
long ret, err;
+ unsigned int status = 0;
mm_segment_t old_fs;
if (!ur)
@@ -1043,13 +1044,15 @@ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, i
old_fs = get_fs();
set_fs (KERNEL_DS);
- ret = sys_wait4(pid, ustatus, options, (struct rusage __user *) &r);
+ ret = sys_wait4(pid, (unsigned int __user *) &status, options,
+ (struct rusage __user *) &r);
set_fs (old_fs);
if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur)))
return -EFAULT;
err = 0;
+ err |= put_user(status, ustatus);
err |= __put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec);
err |= __put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec);
err |= __put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec);
^ permalink raw reply [flat|nested] 64+ messages in thread
* [50/55] proc: restrict access to /proc/PID/io
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (48 preceding siblings ...)
2011-08-06 0:02 ` [49/55] alpha: fix several security issues Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [51/55] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
` (4 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Vasiliy Kulikov
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Vasiliy Kulikov <segoon@openwall.com>
commit 1d1221f375c94ef961ba8574ac4f85c8870ddd51 upstream.
/proc/PID/io may be used for gathering private information. E.g. for
openssh and vsftpd daemons wchars/rchars may be used to learn the
precise password length. Restrict it to processes being able to ptrace
the target process.
ptrace_may_access() is needed to prevent keeping open file descriptor of
"io" file, executing setuid binary and gathering io information of the
setuid'ed process.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/proc/base.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2454,6 +2454,9 @@ static int do_io_accounting(struct task_
struct task_io_accounting acct = task->ioac;
unsigned long flags;
+ if (!ptrace_may_access(task, PTRACE_MODE_READ))
+ return -EACCES;
+
if (whole && lock_task_sighand(task, &flags)) {
struct task_struct *t = task;
@@ -2575,7 +2578,7 @@ static const struct pid_entry tgid_base_
REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations),
#endif
#ifdef CONFIG_TASK_IO_ACCOUNTING
- INF("io", S_IRUGO, proc_tgid_io_accounting),
+ INF("io", S_IRUSR, proc_tgid_io_accounting),
#endif
};
@@ -2910,7 +2913,7 @@ static const struct pid_entry tid_base_s
REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations),
#endif
#ifdef CONFIG_TASK_IO_ACCOUNTING
- INF("io", S_IRUGO, proc_tid_io_accounting),
+ INF("io", S_IRUSR, proc_tid_io_accounting),
#endif
};
^ permalink raw reply [flat|nested] 64+ messages in thread
* [51/55] ALSA: sound/core/pcm_compat.c: adjust array index
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (49 preceding siblings ...)
2011-08-06 0:02 ` [50/55] proc: restrict access to /proc/PID/io Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [52/55] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
` (3 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Julia Lawall, Takashi Iwai
2.6.32-longterm 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
@@ -341,7 +341,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] 64+ messages in thread
* [52/55] dm mpath: fix potential NULL pointer in feature arg processing
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (50 preceding siblings ...)
2011-08-06 0:02 ` [51/55] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [53/55] dm: fix idr leak on module removal Greg KH
` (2 subsequent siblings)
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Mike Snitzer,
Alasdair G Kergon
2.6.32-longterm 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
@@ -778,6 +778,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] 64+ messages in thread
* [53/55] dm: fix idr leak on module removal
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (51 preceding siblings ...)
2011-08-06 0:02 ` [52/55] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [54/55] perf: overflow/perf_count_sw_cpu_clock crashes recent kernels Greg KH
2011-08-06 0:02 ` [55/55] atm: [br2684] allow routed mode operation again Greg KH
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alasdair G Kergon
2.6.32-longterm 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
@@ -36,6 +36,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.
@@ -315,6 +317,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);
}
/*
@@ -1663,8 +1671,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] 64+ messages in thread
* [54/55] perf: overflow/perf_count_sw_cpu_clock crashes recent kernels
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (52 preceding siblings ...)
2011-08-06 0:02 ` [53/55] dm: fix idr leak on module removal Greg KH
@ 2011-08-06 0:02 ` Greg KH
2011-08-06 0:02 ` [55/55] atm: [br2684] allow routed mode operation again Greg KH
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable, Greg KH
Cc: stable-review, torvalds, akpm, alan, Vince Weaver, Ingo Molnar,
Paul Mackerras, Arnaldo Carvalho de Melo, Peter Zijlstra
2.6.32-longterm 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/perf_event.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -3694,12 +3694,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;
- perf_pending_queue(&event->pending,
- perf_pending_event);
- } else
- perf_event_disable(event);
+ event->pending_disable = 1;
+ perf_pending_queue(&event->pending, perf_pending_event);
}
perf_event_output(event, nmi, data, regs);
^ permalink raw reply [flat|nested] 64+ messages in thread
* [55/55] atm: [br2684] allow routed mode operation again
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
` (53 preceding siblings ...)
2011-08-06 0:02 ` [54/55] perf: overflow/perf_count_sw_cpu_clock crashes recent kernels Greg KH
@ 2011-08-06 0:02 ` Greg KH
54 siblings, 0 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Chas Williams - CONTRACTOR,
David S. Miller, Pascal Hambourg
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
commit 2e302ebfeac04beb5a5d6af1ac583c6a1fb76d1a upstream.
in routed mode, we don't have a hardware address so netdev_ops doesnt
need to validate our hardware address via .ndo_validate_addr
Reported-by: Manuel Fuentes <mfuentes@agenciaefe.com>
Signed-off-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Pascal Hambourg <pascal@plouf.fr.eu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/atm/br2684.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -554,6 +554,12 @@ static const struct net_device_ops br268
.ndo_validate_addr = eth_validate_addr,
};
+static const struct net_device_ops br2684_netdev_ops_routed = {
+ .ndo_start_xmit = br2684_start_xmit,
+ .ndo_set_mac_address = br2684_mac_addr,
+ .ndo_change_mtu = eth_change_mtu
+};
+
static void br2684_setup(struct net_device *netdev)
{
struct br2684_dev *brdev = BRPRIV(netdev);
@@ -569,11 +575,10 @@ static void br2684_setup(struct net_devi
static void br2684_setup_routed(struct net_device *netdev)
{
struct br2684_dev *brdev = BRPRIV(netdev);
- brdev->net_dev = netdev;
+ brdev->net_dev = netdev;
netdev->hard_header_len = 0;
-
- netdev->netdev_ops = &br2684_netdev_ops;
+ netdev->netdev_ops = &br2684_netdev_ops_routed;
netdev->addr_len = 0;
netdev->mtu = 1500;
netdev->type = ARPHRD_PPP;
^ permalink raw reply [flat|nested] 64+ messages in thread
* [00/55] 2.6.32.44-longterm review
@ 2011-08-06 0:02 Greg KH
2011-08-06 0:01 ` [01/55] ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values Greg KH
` (54 more replies)
0 siblings, 55 replies; 64+ messages in thread
From: Greg KH @ 2011-08-06 0:02 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan
This is the start of the longterm review cycle for the 2.6.32.44 release.
There are 55 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 Monday, August 8, 2011, 00:00:00 UTC.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/longterm-review/patch-2.6.32.44-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +-
arch/alpha/kernel/osf_sys.c | 11 ++++--
arch/arm/mach-davinci/board-dm365-evm.c | 4 +-
arch/arm/mach-pxa/cm-x300.c | 8 ++--
arch/powerpc/kernel/crash.c | 6 +---
arch/powerpc/platforms/pseries/hvconsole.c | 2 +-
arch/x86/kernel/hpet.c | 53 +++++++++++++++------------
arch/x86/kernel/reboot.c | 8 ++++
arch/x86/kernel/relocate_kernel_32.S | 2 +
arch/x86/kernel/relocate_kernel_64.S | 2 +
arch/xtensa/kernel/ptrace.c | 3 ++
block/blk-core.c | 3 ++
block/blk-exec.c | 7 ++++
drivers/ata/libata-eh.c | 12 ++++--
drivers/block/cciss.h | 2 +-
drivers/hwmon/max1111.c | 11 ++++++
drivers/md/dm-mpath.c | 5 +++
drivers/md/dm.c | 10 ++++-
drivers/media/radio/si4713-i2c.c | 4 +-
drivers/media/video/bt8xx/bttv-driver.c | 2 +-
drivers/media/video/pvrusb2/pvrusb2-hdw.c | 4 ++
drivers/media/video/v4l2-ioctl.c | 6 +++
drivers/net/jme.c | 20 +++++++---
drivers/pci/pci.c | 7 +++-
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/staging/comedi/comedi_fops.c | 4 +-
drivers/usb/gadget/dummy_hcd.c | 1 +
drivers/usb/host/ehci-hub.c | 3 +-
drivers/usb/host/ehci-q.c | 3 +-
drivers/usb/host/ehci.h | 1 +
drivers/usb/host/pci-quirks.c | 28 +++++++++++++++
drivers/usb/musb/musb_core.c | 1 +
drivers/usb/serial/pl2303.c | 2 +
drivers/usb/serial/pl2303.h | 10 +++++-
fs/block_dev.c | 27 +++++---------
fs/cifs/cifsglob.h | 2 +-
fs/cifs/connect.c | 28 ++++++++++----
fs/ext3/xattr.c | 12 +++++-
fs/nfs/nfs4xdr.c | 2 +-
fs/proc/base.c | 7 +++-
include/linux/netdevice.h | 5 ++-
kernel/perf_event.c | 8 +---
net/atm/br2684.c | 11 ++++--
net/bridge/br_private.h | 1 +
net/bridge/br_stp.c | 4 +-
net/ipv4/ip_gre.c | 19 +++++-----
net/ipv4/ipip.c | 13 +++----
net/ipv6/ip6_tunnel.c | 28 ++++++++-------
net/ipv6/sit.c | 13 +++----
net/ipv6/xfrm6_tunnel.c | 32 ++++++++++-------
net/mac80211/mlme.c | 3 ++
net/sunrpc/rpcb_clnt.c | 2 +-
net/sunrpc/sched.c | 27 ++++++--------
net/sunrpc/svc_xprt.c | 11 +++---
sound/core/pcm_compat.c | 2 +-
sound/soc/blackfin/bf5xx-i2s-pcm.c | 13 ++++++-
60 files changed, 351 insertions(+), 182 deletions(-)
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks
2011-08-06 0:01 ` [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks Greg KH
@ 2011-08-07 17:38 ` Ben Hutchings
2011-08-08 17:03 ` Greg KH
0 siblings, 1 reply; 64+ messages in thread
From: Ben Hutchings @ 2011-08-07 17:38 UTC (permalink / raw)
To: Greg KH
Cc: linux-kernel, stable, Trond Myklebust, akpm, torvalds,
stable-review, alan
[-- Attachment #1: Type: text/plain, Size: 625 bytes --]
On Fri, 2011-08-05 at 17:01 -0700, Greg KH wrote:
> 2.6.32-longterm review patch. If anyone has any objections, please let us know.
>
> ------------------
>
> From: Trond Myklebust <Trond.Myklebust@netapp.com>
>
> commit b55c59892e1f3b6c7d4b9ccffb4263e1486fb990 upstream.
>
> Since rpc_killall_tasks may modify the rpc_task's tk_action field
> without any locking, we need to be careful when dereferencing it.
[...]
This isn't nearly careful enough to avoid races. You must at least use
the ACCESS_ONCE macro, otherwise the compiler can just optimise away the
local variable this introduces.
Ben.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [28/55] [SCSI] fix crash in scsi_dispatch_cmd()
[not found] ` <1312739411.2591.1026.camel@deadeye>
@ 2011-08-07 17:51 ` Ben Hutchings
2011-08-08 17:04 ` Greg KH
0 siblings, 1 reply; 64+ messages in thread
From: Ben Hutchings @ 2011-08-07 17:51 UTC (permalink / raw)
To: James Bottomley
Cc: linux-kernel, stable, akpm, torvalds, stable-review, alan,
Greg KH
[-- Attachment #1: Type: text/plain, Size: 854 bytes --]
On Sun, 2011-08-07 at 18:50 +0100, Ben Hutchings wrote:
> On Fri, 2011-08-05 at 17:01 -0700, Greg KH wrote:
> > 2.6.32-longterm 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.
> [...]
>
> This has been reported in 2.6.39.y and 3.0, but not in 2.6.32.y.
That is, AFAIK.
Ben.
> Is the fix really applicable or necessary in 2.6.32.y?
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks
2011-08-07 17:38 ` [Stable-review] " Ben Hutchings
@ 2011-08-08 17:03 ` Greg KH
2011-08-08 18:07 ` Ben Hutchings
0 siblings, 1 reply; 64+ messages in thread
From: Greg KH @ 2011-08-08 17:03 UTC (permalink / raw)
To: Ben Hutchings
Cc: linux-kernel, stable, Trond Myklebust, akpm, torvalds,
stable-review, alan
On Sun, Aug 07, 2011 at 06:38:01PM +0100, Ben Hutchings wrote:
> On Fri, 2011-08-05 at 17:01 -0700, Greg KH wrote:
> > 2.6.32-longterm review patch. If anyone has any objections, please let us know.
> >
> > ------------------
> >
> > From: Trond Myklebust <Trond.Myklebust@netapp.com>
> >
> > commit b55c59892e1f3b6c7d4b9ccffb4263e1486fb990 upstream.
> >
> > Since rpc_killall_tasks may modify the rpc_task's tk_action field
> > without any locking, we need to be careful when dereferencing it.
> [...]
>
> This isn't nearly careful enough to avoid races. You must at least use
> the ACCESS_ONCE macro, otherwise the compiler can just optimise away the
> local variable this introduces.
Well, that's an upstream issue as well, right? Not much I can do here
in the stable updates :)
greg k-h
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [28/55] [SCSI] fix crash in scsi_dispatch_cmd()
2011-08-07 17:51 ` [Stable-review] " Ben Hutchings
@ 2011-08-08 17:04 ` Greg KH
2011-08-08 18:10 ` Ben Hutchings
0 siblings, 1 reply; 64+ messages in thread
From: Greg KH @ 2011-08-08 17:04 UTC (permalink / raw)
To: Ben Hutchings
Cc: James Bottomley, linux-kernel, stable, akpm, torvalds,
stable-review, alan
On Sun, Aug 07, 2011 at 06:51:24PM +0100, Ben Hutchings wrote:
> On Sun, 2011-08-07 at 18:50 +0100, Ben Hutchings wrote:
> > On Fri, 2011-08-05 at 17:01 -0700, Greg KH wrote:
> > > 2.6.32-longterm 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.
> > [...]
> >
> > This has been reported in 2.6.39.y and 3.0, but not in 2.6.32.y.
>
> That is, AFAIK.
Oops, good catch, I've dropped this from the .32 and .33 queue now, it's
not needed there at all.
greg k-h
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks
2011-08-08 17:03 ` Greg KH
@ 2011-08-08 18:07 ` Ben Hutchings
0 siblings, 0 replies; 64+ messages in thread
From: Ben Hutchings @ 2011-08-08 18:07 UTC (permalink / raw)
To: Greg KH
Cc: linux-kernel, stable, Trond Myklebust, akpm, torvalds,
stable-review, alan
On Mon, Aug 08, 2011 at 10:03:00AM -0700, Greg KH wrote:
> On Sun, Aug 07, 2011 at 06:38:01PM +0100, Ben Hutchings wrote:
> > On Fri, 2011-08-05 at 17:01 -0700, Greg KH wrote:
> > > 2.6.32-longterm review patch. If anyone has any objections, please let us know.
> > >
> > > ------------------
> > >
> > > From: Trond Myklebust <Trond.Myklebust@netapp.com>
> > >
> > > commit b55c59892e1f3b6c7d4b9ccffb4263e1486fb990 upstream.
> > >
> > > Since rpc_killall_tasks may modify the rpc_task's tk_action field
> > > without any locking, we need to be careful when dereferencing it.
> > [...]
> >
> > This isn't nearly careful enough to avoid races. You must at least use
> > the ACCESS_ONCE macro, otherwise the compiler can just optimise away the
> > local variable this introduces.
>
> Well, that's an upstream issue as well, right? Not much I can do here
> in the stable updates :)
Right, but if it doesn't fix a bug then it is not suitable for
stable.
Ben.
--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [28/55] [SCSI] fix crash in scsi_dispatch_cmd()
2011-08-08 17:04 ` Greg KH
@ 2011-08-08 18:10 ` Ben Hutchings
2011-08-08 19:17 ` Dave Jones
2011-08-09 20:22 ` James Bottomley
0 siblings, 2 replies; 64+ messages in thread
From: Ben Hutchings @ 2011-08-08 18:10 UTC (permalink / raw)
To: Greg KH
Cc: James Bottomley, linux-kernel, stable, akpm, torvalds,
stable-review, alan
On Mon, Aug 08, 2011 at 10:04:24AM -0700, Greg KH wrote:
> On Sun, Aug 07, 2011 at 06:51:24PM +0100, Ben Hutchings wrote:
> > On Sun, 2011-08-07 at 18:50 +0100, Ben Hutchings wrote:
> > > On Fri, 2011-08-05 at 17:01 -0700, Greg KH wrote:
> > > > 2.6.32-longterm 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.
> > > [...]
> > >
> > > This has been reported in 2.6.39.y and 3.0, but not in 2.6.32.y.
> >
> > That is, AFAIK.
>
> Oops, good catch, I've dropped this from the .32 and .33 queue now, it's
> not needed there at all.
Well, it is entirely possible that I am confusing multiple bugs (I
actualy attempted to delete this message from my outgoing mail queue
as I was becoming less confident about it). I assume James can
confirm one way or the other.
Ben.
--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [28/55] [SCSI] fix crash in scsi_dispatch_cmd()
2011-08-08 18:10 ` Ben Hutchings
@ 2011-08-08 19:17 ` Dave Jones
2011-08-09 20:22 ` James Bottomley
1 sibling, 0 replies; 64+ messages in thread
From: Dave Jones @ 2011-08-08 19:17 UTC (permalink / raw)
To: Ben Hutchings
Cc: Greg KH, James Bottomley, linux-kernel, stable, akpm, torvalds,
stable-review, alan
On Mon, Aug 08, 2011 at 07:10:11PM +0100, Ben Hutchings wrote:
> > > > This has been reported in 2.6.39.y and 3.0, but not in 2.6.32.y.
> > >
> > > That is, AFAIK.
> >
> > Oops, good catch, I've dropped this from the .32 and .33 queue now, it's
> > not needed there at all.
>
> Well, it is entirely possible that I am confusing multiple bugs (I
> actualy attempted to delete this message from my outgoing mail queue
> as I was becoming less confident about it). I assume James can
> confirm one way or the other.
fwiw, we only started seeing the bugs that this fixed in Fedora from 2.6.38.x onwards.
Our previous shipped kernel was 2.6.35, which never seemed to have any of
those problems.
Dave
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [Stable-review] [28/55] [SCSI] fix crash in scsi_dispatch_cmd()
2011-08-08 18:10 ` Ben Hutchings
2011-08-08 19:17 ` Dave Jones
@ 2011-08-09 20:22 ` James Bottomley
1 sibling, 0 replies; 64+ messages in thread
From: James Bottomley @ 2011-08-09 20:22 UTC (permalink / raw)
To: Ben Hutchings
Cc: Greg KH, linux-kernel@vger.kernel.org, stable@kernel.org,
akpm@linux-foundation.org, torvalds@linux-foundation.org,
stable-review@kernel.org, alan@lxorguk.ukuu.org.uk
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1811 bytes --]
On Mon, 2011-08-08 at 19:10 +0100, Ben Hutchings wrote:
> On Mon, Aug 08, 2011 at 10:04:24AM -0700, Greg KH wrote:
> > On Sun, Aug 07, 2011 at 06:51:24PM +0100, Ben Hutchings wrote:
> > > On Sun, 2011-08-07 at 18:50 +0100, Ben Hutchings wrote:
> > > > On Fri, 2011-08-05 at 17:01 -0700, Greg KH wrote:
> > > > > 2.6.32-longterm 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.
> > > > [...]
> > > >
> > > > This has been reported in 2.6.39.y and 3.0, but not in 2.6.32.y.
> > >
> > > That is, AFAIK.
> >
> > Oops, good catch, I've dropped this from the .32 and .33 queue now, it's
> > not needed there at all.
>
> Well, it is entirely possible that I am confusing multiple bugs (I
> actualy attempted to delete this message from my outgoing mail queue
> as I was becoming less confident about it). I assume James can
> confirm one way or the other.
No ... There is an original bug somewhere that might permeate to 2.6.32
which the patch series fixes, but I don't think all the precursors were
stable tagged and it's a race condition which only started showing up in
2.6.38.
James
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 64+ messages in thread
end of thread, other threads:[~2011-08-09 20:22 UTC | newest]
Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-06 0:02 [00/55] 2.6.32.44-longterm review Greg KH
2011-08-06 0:01 ` [01/55] ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values Greg KH
2011-08-06 0:01 ` [02/55] [media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner Greg KH
2011-08-06 0:01 ` [03/55] [media] pvrusb2: fix g/s_tuner support Greg KH
2011-08-06 0:01 ` [04/55] [media] bttv: fix s_tuner for radio Greg KH
2011-08-06 0:01 ` [05/55] gro: Only reset frag0 when skb can be pulled Greg KH
2011-08-06 0:01 ` [06/55] NFSv4.1: update nfs4_fattr_bitmap_maxsz Greg KH
2011-08-06 0:01 ` [07/55] SUNRPC: Fix a race between work-queue and rpc_killall_tasks Greg KH
2011-08-07 17:38 ` [Stable-review] " Ben Hutchings
2011-08-08 17:03 ` Greg KH
2011-08-08 18:07 ` Ben Hutchings
2011-08-06 0:01 ` [08/55] SUNRPC: Fix use of static variable in rpcb_getport_async Greg KH
2011-08-06 0:01 ` [09/55] si4713-i2c: avoid potential buffer overflow on si4713 Greg KH
2011-08-06 0:01 ` [10/55] hwmon: (max1111) Fix race condition causing NULL pointer exception Greg KH
2011-08-06 0:01 ` [11/55] bridge: send proper message_age in config BPDU Greg KH
2011-08-06 0:01 ` [12/55] davinci: DM365 EVM: fix video input mux bits Greg KH
2011-08-06 0:01 ` [13/55] libata: fix unexpectedly frozen port after ata_eh_reset() Greg KH
2011-08-06 0:01 ` [14/55] x86: Make Dell Latitude E5420 use reboot=pci Greg KH
2011-08-06 0:01 ` [15/55] USB: pl2303: add AdLink ND-6530 USB IDs Greg KH
2011-08-06 0:01 ` [16/55] USB: pl2303.h: checkpatch cleanups Greg KH
2011-08-06 0:01 ` [17/55] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
2011-08-06 0:01 ` [18/55] staging: comedi: fix infoleak to userspace Greg KH
2011-08-06 0:01 ` [19/55] USB: OHCI: fix another regression for NVIDIA controllers Greg KH
2011-08-06 0:01 ` [20/55] usb: musb: restore INDEX register in resume path Greg KH
2011-08-06 0:01 ` [21/55] USB: dummy-hcd needs the has_tt flag Greg KH
2011-08-06 0:01 ` [22/55] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
2011-08-06 0:01 ` [23/55] jme: Fix unmap error (Causing system freeze) Greg KH
2011-08-06 0:01 ` [24/55] [SCSI] libsas: remove expander from dev list on error Greg KH
2011-08-06 0:01 ` [25/55] mac80211: Restart STA timers only on associated state Greg KH
2011-08-06 0:01 ` [26/55] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
2011-08-06 0:01 ` [27/55] [SCSI] ses: requesting a fault indication Greg KH
2011-08-06 0:01 ` [28/55] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
[not found] ` <1312739411.2591.1026.camel@deadeye>
2011-08-07 17:51 ` [Stable-review] " Ben Hutchings
2011-08-08 17:04 ` Greg KH
2011-08-08 18:10 ` Ben Hutchings
2011-08-08 19:17 ` Dave Jones
2011-08-09 20:22 ` James Bottomley
2011-08-06 0:01 ` [29/55] [SCSI] pmcraid: reject negative request size Greg KH
2011-08-06 0:02 ` [30/55] kexec, x86: Fix incorrect jump back address if not Greg KH
2011-08-06 0:02 ` [31/55] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
2011-08-06 0:02 ` [32/55] PCI: ARI is a PCIe v2 feature Greg KH
2011-08-06 0:02 ` [33/55] cciss: do not attempt to read from a write-only register Greg KH
2011-08-06 0:02 ` [34/55] xtensa: prevent arbitrary read in ptrace Greg KH
2011-08-06 0:02 ` [35/55] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
2011-08-06 0:02 ` [36/55] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
2011-08-06 0:02 ` [37/55] EHCI: only power off port if over-current is active Greg KH
2011-08-06 0:02 ` [38/55] EHCI: fix direction handling for interrupt data toggles Greg KH
2011-08-06 0:02 ` [39/55] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
2011-08-06 0:02 ` [40/55] x86: Hpet: Avoid the comparator readback penalty Greg KH
2011-08-06 0:02 ` [41/55] x86: HPET: Chose a paranoid safe value for the ETIME check Greg KH
2011-08-06 0:02 ` [42/55] Revert "block: rescan partitions on invalidated devices on -ENOMEDIA Greg KH
2011-08-06 0:02 ` [43/55] cifs: clean up cifs_find_smb_ses (try #2) Greg KH
2011-08-06 0:02 ` [44/55] cifs: fix NULL pointer dereference in cifs_find_smb_ses Greg KH
2011-08-06 0:02 ` [45/55] cifs: check for NULL session password Greg KH
2011-08-06 0:02 ` [46/55] gre: fix netns vs proto registration ordering Greg KH
2011-08-06 0:02 ` [47/55] netns xfrm: fixup xfrm6_tunnel error propagation Greg KH
2011-08-06 0:02 ` [48/55] tunnels: fix netns vs proto registration ordering Greg KH
2011-08-06 0:02 ` [49/55] alpha: fix several security issues Greg KH
2011-08-06 0:02 ` [50/55] proc: restrict access to /proc/PID/io Greg KH
2011-08-06 0:02 ` [51/55] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
2011-08-06 0:02 ` [52/55] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
2011-08-06 0:02 ` [53/55] dm: fix idr leak on module removal Greg KH
2011-08-06 0:02 ` [54/55] perf: overflow/perf_count_sw_cpu_clock crashes recent kernels Greg KH
2011-08-06 0:02 ` [55/55] atm: [br2684] allow routed mode operation again Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox