2.6.15.2 -stable review
Subsystems (5)
PATCH 1/12 usb-audio: don't use empty packets at start of playback
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
Some widespread USB interface chips with adaptive iso endpoints hang after receiving a series of empty packets when they expect data. This completely disables audio playback on those devices. To avoid this, we have to send packets containing silence (zero samples) instead.
ALSA bug: http://bugtrack.alsa-project.org/alsa-bug/view.php?id=1585
--- sound/usb/usbaudio.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
sound/usb/usbaudio.c +21 -5
@@ -480,22 +480,38 @@ static int retire_playback_sync_urb_hs(s/* * Prepare urb for streaming before playback starts. * -* We don't care about (or have) any data, so we just send a transfer delimiter. +* We don't yet have data, so we send a frame of silence. */ static int prepare_startup_playback_urb (snd_usb_substream_t *subs,snd_pcm_runtime_t *runtime,struct urb *urb) { -unsigned int i; +unsigned int i, offs, counts;snd_urb_ctx_t *ctx = urb->context; +int stride = runtime->frame_bits >>3 ; + offs =0 ; urb->dev = ctx->subs->dev; urb->number_of_packets = subs->packs_per_ms;for (i =0 ; i < subs->packs_per_ms; ++i) { - urb->iso_frame_desc[i].offset =0 ; - urb->iso_frame_desc[i].length =0 ; +/* calculate the size of a packet */ +if (subs->fill_max) + counts = subs->maxframesize;/* fixed */ +else { + subs->phase = (subs->phase &0xffff ) + + (subs->freqm << subs->datainterval); + counts = subs->phase >>16 ; +if (counts > subs->maxframesize) + counts = subs->maxframesize; + } + urb->iso_frame_desc[i].offset = offs * stride; + urb->iso_frame_desc[i].length = counts * stride; + offs += counts; } - urb->transfer_buffer_length =0 ; + urb->transfer_buffer_length = offs * stride; +memset (urb->transfer_buffer, + subs->cur_audiofmt->format ==SNDRV_PCM_FORMAT_U8 ?0x80 :0 , + offs * stride);return 0 ; }
--
PATCH 6/12 elevator=as back-compatibility
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Chuck Ebbert <[email protected]>
As of 2.6.15 you need to use "anticipatory" instead of "as". Fix that up so that `elevator=as' still works.
--- block/elevator.c | 7 +++++++ 1 file changed, 7 insertions(+)
block/elevator.c +7 -0
@@ -150,6 +150,13 @@ static void elevator_setup_default(void)if (!chosen_elevator[0 ])strcpy (chosen_elevator,CONFIG_DEFAULT_IOSCHED ); +/* +* Be backwards-compatible with previous kernels, so users +* won't get the wrong elevator. +*/ +if (!strcmp (chosen_elevator,"as" )) +strcpy (chosen_elevator,"anticipatory" ); +/* * If the given scheduler is not available, fall back to no-op. */
--
PATCH 11/12 Fix i2o_scsi oops on abort
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Markus Lidel <[email protected]>
Quoted 1 line
When a scsi command failed, an oops would result.
Back-to-back SMART queries would make the Seagate drives unhappy. The second SMART query would timeout, and the command would be aborted.
From: Markus Lidel <[email protected]>
--- drivers/message/i2o/i2o_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/message/i2o/i2o_scsi.c +1 -1
@@ -729,7 +729,7 @@ static int i2o_scsi_abort(struct scsi_cm &msg->u.head[1]);writel (i2o_cntxt_list_get_ptr (c, SCpnt), &msg->body[0 ]); -if (i2o_msg_post_wait (c, m,I2O_TIMEOUT_SCSI_SCB_ABORT )) +if (!i2o_msg_post_wait (c, msg,I2O_TIMEOUT_SCSI_SCB_ABORT )) status =SUCCESS ;return status;
--
cover 2.6.15.2 -stable review
This is the start of the stable review cycle for the 2.6.11.5.2 release. There are 12 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.
These patches are sent out with a number of different people on the Cc:
line. If you wish to be a reviewer, please email [email protected] to add your name to the list. If you want to be off the reviewer list, also email us.
Responses should be made by Monday, January 30, 00:00:00 UTC. Anything received after that time, might be too late.
thanks,
the -stable release team
PATCH 5/12 Fix oops in ufs_fill_super at mount time
2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Evgeniy <[email protected]>
There's a lack of parenthesis in fs/ufs/utils.h, so instead of the 512th byte of buffer, the usb2 pointer will point to the nth structure of type ufs_super_block_second.
This can cause a mount-time oops if you're unlucky (especially with DEBUG_PAGEALLOC, which is how Alexey Dobriyan saw this problem)
--- fs/ufs/util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ufs/util.h +2 -2
@@ -255,8 +255,8 @@ extern void _ubh_memcpyubh_(struct ufs_s ((struct ufs_super_block_first *)((ubh)->bh[0]->b_data))#define ubh_get_usb_second (ubh) \ - ((struct ufs_super_block_second *)(ubh)-> \ - bh[UFS_SECTOR_SIZE >> uspi->s_fshift]->b_data + (UFS_SECTOR_SIZE & ~uspi->s_fmask)) + ((struct ufs_super_block_second *)((ubh)->\ + bh[UFS_SECTOR_SIZE >> uspi->s_fshift]->b_data + (UFS_SECTOR_SIZE & ~uspi->s_fmask)))#define ubh_get_usb_third (ubh) \ ((struct ufs_super_block_third *)((ubh)-> \
--
PATCH 7/12 Fix timekeeping on sparc64 ultra-IIe machines
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Mortimer <[email protected]>
[SPARC64]: Eliminate race condition reading Hummingbird STICK register
Ensure a consistent value is read from the STICK register by ensuring that both high and low are read without high changing due to a roll over of the low register.
Various Debian/SPARC users (myself include) have noticed problems with Hummingbird based systems. The symptoms are that the system time is seen to jump forward 3 days, 6 hours, 11 minutes give or take a few seconds. In many cases the system then hangs some time afterwards.
I've spotted a race condition in the code to read the STICK register. I could not work out why 3d, 6h, 11m is important but guess that it is due to the 2^32 jump of STICK (forwards on one read and then the next read will seem to be backwards) during a timer interrupt. I'm guessing that a change of -2^32 will get converted to a large unsigned increment after the arithmetic manipulation between STICK, nanoseconds, jiffies etc.
I did a test where I modified __hbird_read_stick to artificially inject rollover faults forcefully every few seconds. With this I saw the clock jump over 6 times in 12 hours compared to once every month or so.
--- arch/sparc64/kernel/time.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
arch/sparc64/kernel/time.c +11 -11
@@ -280,9 +280,9 @@ static struct sparc64_tick_ops stick_ope* Since STICK is constantly updating, we have to access it carefully. * * The sequence we use to read is: -* 1) read low -* 2) read high -* 3) read low again, if it rolled over increment high by 1 +* 1) read high +* 2) read low +* 3) read high again, if it rolled re-read both low and high again. * * Writing STICK safely is also tricky: * 1) write low to zero
@@ -295,18 +295,18 @@ static struct sparc64_tick_ops stick_opestatic unsigned long __hbird_read_stick (void ) {unsigned long ret, tmp1, tmp2, tmp3; -unsigned long addr =HBIRD_STICK_ADDR ; +unsigned long addr =HBIRD_STICK_ADDR +8 ; - __asm__ __volatile__("ldxa [%1] %5, %2\n\t" -"add %1, 0x8, %1\n\t" -"ldxa [%1] %5, %3\n\t" + __asm__ __volatile__("ldxa [%1] %5, %2\n" +"1:\n\t" "sub %1, 0x8, %1\n\t" +"ldxa [%1] %5, %3\n\t" +"add %1, 0x8, %1\n\t" "ldxa [%1] %5, %4\n\t" "cmp %4, %2\n\t" -"blu,a,pn %%xcc, 1f\n\t" -" add %3, 1, %3\n" -"1:\n\t" -"sllx %3, 32, %3\n\t" +"bne,a,pn %%xcc, 1b\n\t" +" mov %4, %2\n\t" +"sllx %4, 32, %4\n\t" "or %3, %4, %0\n\t" :"=&r" (ret),"=&r" (addr), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3)
--
PATCH 8/12 : Make second arg to skb_reserved() signed.
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
Some subsystems, such as PPP, can send negative values here. It just happened to work correctly on 32-bit with an unsigned value, but on 64-bit this explodes.
Figured out by Paul Mackerras based upon several PPP crash reports.
--- include/linux/skbuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/skbuff.h +1 -1
@@ -927,7 +927,7 @@ static inline int skb_tailroom(const str* Increase the headroom of an empty &sk_buff by reducing the tail * room. This is only allowed for an empty buffer. */ -static inline void skb_reserve (struct sk_buff *skb,unsigned int len) +static inline void skb_reserve (struct sk_buff *skb,int len) { skb->data += len; skb->tail += len;
--
PATCH 9/12 Mask off GFP flags before swiotlb_alloc_coherent
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Andi Kleen <[email protected]>
Mask off GFP flags before swiotlb_alloc_coherent
--- arch/x86_64/kernel/pci-gart.c | 1 + 1 file changed, 1 insertion(+)
arch/x86_64/kernel/pci-gart.c +1 -0
@@ -244,6 +244,7 @@ dma_alloc_coherent(struct device *dev, s get_order(size));if (swiotlb) { + gfp &= ~(GFP_DMA32 |GFP_DMA );return swiotlb_alloc_coherent(dev, size, dma_handle,
--
PATCH 2/12 Kill blk_attempt_remerge()
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Jens Axboe <[email protected]>
[BLOCK] Kill blk_attempt_remerge()
It's a broken interface, it's done way too late. And apparently it triggers slab problems in recent kernels as well (most likely after the generic dispatch code was merged). So kill it, ide-cd is the only user of it.
chrisw: backport to 2.6.15 tree
--- block/ll_rw_blk.c | 24 ------------------------ drivers/ide/ide-cd.c | 10 ---------- include/linux/blkdev.h | 1 - 3 files changed, 35 deletions(-)
block/ll_rw_blk.c +0 -24
@@ -2609,30 +2609,6 @@ static inline int attempt_front_merge(rereturn 0 ; } -/** -* blk_attempt_remerge - attempt to remerge active head with next request -* @q: The &request_queue_t belonging to the device -* @rq: The head request (usually) -* -* Description: -* For head-active devices, the queue can easily be unplugged so quickly -* that proper merging is not done on the front request. This may hurt -* performance greatly for some devices. The block layer cannot safely -* do merging on that first request for these queues, but the driver can -* call this function and make it happen any way. Only the driver knows -* when it is safe to do so. -**/ -void blk_attempt_remerge (request_queue_t *q,struct request *rq) -{ -unsigned long flags; - -spin_lock_irqsave (q->queue_lock, flags); -attempt_back_merge (q, rq); -spin_unlock_irqrestore (q->queue_lock, flags); -} - -EXPORT_SYMBOL (blk_attempt_remerge); -static int __make_request (request_queue_t *q,struct bio *bio) {struct request *req;
drivers/ide/ide-cd.c +0 -10
@@ -1332,8 +1332,6 @@ static ide_startstop_t cdrom_start_readif (cdrom_read_from_buffer (drive))return ide_stopped; -blk_attempt_remerge (drive->queue, rq); -/* Clear the local sector buffer. */ info->nsectors_buffered =0 ;
@@ -1874,14 +1872,6 @@ static ide_startstop_t cdrom_start_writereturn ide_stopped; } -/* -* for dvd-ram and such media, it's a really big deal to get -* big writes all the time. so scour the queue and attempt to -* remerge requests, often the plugging will not have had time -* to do this properly -*/ -blk_attempt_remerge (drive->queue, rq); - info->nsectors_buffered =0 ;/* use dma, if possible. we don't need to check more, since we
include/linux/blkdev.h +0 -1
@@ -559,7 +559,6 @@ extern void register_disk(struct gendiskextern void generic_make_request (struct bio *bio);extern void blk_put_request (struct request *);extern void blk_end_sync_rq (struct request *rq); -extern void blk_attempt_remerge (request_queue_t *,struct request *);extern struct request *blk_get_request (request_queue_t *,int ,gfp_t );extern void blk_insert_request (request_queue_t *,struct request *,int ,void *);extern void blk_requeue_request (request_queue_t *,struct request *);
--
PATCH 12/12 Fix mkiss locking bug
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Ralf Baechle DL5RB <[email protected]>
ax_encaps() forgot to drop the bufferlock at the end of the function. Patch is already in 2.6.16-rc1.
--- drivers/net/hamradio/mkiss.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/hamradio/mkiss.c +1 -0
@@ -515,6 +515,7 @@ static void ax_encaps(struct net_device count =kiss_esc (p, (unsigned char *)ax->xbuff, len); } } +spin_unlock_bh (&ax->buflock);set_bit (TTY_DO_WRITE_WAKEUP , &ax->tty->flags); actual = ax->tty->driver->write (ax->tty, ax->xbuff, count);
--
PATCH 10/12 Someone broke reiserfs v3 mount options and this fixes it
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Vitaly Fertman <[email protected]>
--- fs/reiserfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/super.c +1 -1
@@ -1131,7 +1131,7 @@ static void handle_attrs(struct super_blREISERFS_SB (s)->s_mount_opt &= ~(1 <<REISERFS_ATTRS ); } }else if (le32_to_cpu (rs->s_flags) & reiserfs_attrs_cleared) { -REISERFS_SB (s)->s_mount_opt |=REISERFS_ATTRS ; +REISERFS_SB (s)->s_mount_opt |= (1 <<REISERFS_ATTRS ); } }
--
PATCH 3/12 Input: HID - fix an oops in PID initialization code
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Dmitry Torokhov <[email protected]>
Input: HID - fix an oops in PID initialization code
--- drivers/usb/input/pid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/input/pid.c +1 -1
@@ -259,7 +259,7 @@ static int hid_pid_upload_effect(structint hid_pid_init (struct hid_device *hid) {struct hid_ff_pid *private; - struct hid_input *hidinput = list_entry(&hid->inputs, struct hid_input, list); + struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);struct input_dev *input_dev = hidinput->input; private = hid->ff_private =kzalloc (sizeof (struct hid_ff_pid ),GFP_KERNEL );
--
PATCH 4/12 Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open (CVE-2005-3356)
In reply to Greg KH2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexander Viro <[email protected]>
Fixed the refcounting on failure exits in sys_mq_open() and cleaned the logics up. Rules are actually pretty simple - dentry_open() expects vfsmount and dentry to be pinned down and it either transfers them into created struct file or drops them. Old code had been very confused in that area - if dentry_open() had failed either in do_open() or do_create(), we ended up dentry and mqueue_mnt dropped twice, once by dentry_open() cleanup and then by sys_mq_open().
Fix consists of making the rules for do_create() and do_open() same as for dentry_open() and updating the sys_mq_open() accordingly; that actually leads to more straightforward code and less work on normal path.
--- ipc/mqueue.c | 59 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 26 deletions(-)
ipc/mqueue.c +33 -26
@@ -598,15 +598,16 @@ static int mq_attr_ok(struct mq_attr *atstatic struct file *do_create (struct dentry *dir,struct dentry *dentry,int oflag,mode_t mode,struct mq_attr __user *u_attr) { -struct file *filp;struct mq_attr attr;int ret; -if (u_attr !=NULL ) { +if (u_attr) { + ret = -EFAULT ;if (copy_from_user (&attr, u_attr,sizeof (attr))) -return ERR_PTR (-EFAULT ); + goto out; + ret = -EINVAL ;if (!mq_attr_ok (&attr)) -return ERR_PTR (-EINVAL ); + goto out;/* store for use during create */ dentry->d_fsdata = &attr; }
@@ -615,13 +616,14 @@ static struct file *do_create(struct den ret =vfs_create (dir->d_inode, dentry, mode,NULL ); dentry->d_fsdata =NULL ;if (ret) -return ERR_PTR (ret); + goto out; - filp =dentry_open (dentry, mqueue_mnt, oflag); -if (!IS_ERR (filp)) -dget (dentry); +return dentry_open (dentry, mqueue_mnt, oflag); -return filp; +out: +dput (dentry); +mntput (mqueue_mnt); +return ERR_PTR (ret); }/* Opens existing queue */
@@ -629,20 +631,20 @@ static struct file *do_open(struct dentr {static int oflag2acc[O_ACCMODE ] = {MAY_READ ,MAY_WRITE ,MAY_READ |MAY_WRITE }; -struct file *filp; -if ((oflag &O_ACCMODE ) == (O_RDWR |O_WRONLY )) +if ((oflag &O_ACCMODE ) == (O_RDWR |O_WRONLY )) { +dput (dentry); +mntput (mqueue_mnt);return ERR_PTR (-EINVAL ); + } -if (permission (dentry->d_inode, oflag2acc[oflag &O_ACCMODE ],NULL )) +if (permission (dentry->d_inode, oflag2acc[oflag &O_ACCMODE ],NULL )) { +dput (dentry); +mntput (mqueue_mnt);return ERR_PTR (-EACCES ); + } - filp =dentry_open (dentry, mqueue_mnt, oflag); - -if (!IS_ERR (filp)) -dget (dentry); - -return filp; +return dentry_open (dentry, mqueue_mnt, oflag); } asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
@@ -670,17 +672,20 @@ asmlinkage long sys_mq_open(const char _if (oflag &O_CREAT ) {if (dentry->d_inode) {/* entry already exists */ - filp = (oflag &O_EXCL ) ?ERR_PTR (-EEXIST ) : -do_open (dentry, oflag); + error = -EEXIST ; +if (oflag &O_EXCL ) + goto out; + filp =do_open (dentry, oflag); }else { filp =do_create (mqueue_mnt->mnt_root, dentry, oflag, mode, u_attr); } - }else - filp = (dentry->d_inode) ?do_open (dentry, oflag) : -ERR_PTR (-ENOENT ); - -dput (dentry); + }else { + error = -ENOENT ; +if (!dentry->d_inode) + goto out; + filp =do_open (dentry, oflag); + }if (IS_ERR (filp)) { error =PTR_ERR (filp);
@@ -691,8 +696,10 @@ asmlinkage long sys_mq_open(const char _fd_install (fd, filp); goto out_upsem; -out_putfd: +out: +dput (dentry);mntput (mqueue_mnt); +out_putfd:put_unused_fd (fd); out_err: fd = error;
--
Re: [patch 09/12] Mask off GFP flags before swiotlb_alloc_coherent
In reply to Greg KHQuoted 2 lines · Greg KH
2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
That patch isn't in mainline yet and shouldn't be merged to stable before that happens.
-Andi
Quoted 27 lines
------------------
From: Andi Kleen <[email protected]>
Mask off GFP flags before
swiotlb_alloc_coherentSigned-off-by Andi Kleen <[email protected]>Signed-off-by Chris Wright <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/x86_64/kernel/pci-gart.c | 1 + 1 file changed, 1 insertion(+)arch/x86_64/kernel/pci-gart.c +1
-1@@ -244,6 +244,7 @@ dma_alloc_coherent(struct device *dev, s get_order(size));if (swiotlb) { + gfp &= ~(GFP_DMA32 |GFP_DMA );return swiotlb_alloc_coherent(dev, size, dma_handle, --
Re: [patch 09/12] Mask off GFP flags before swiotlb_alloc_coherent
Quoted 7 lines · Andi Kleen
Quoted 2 lines · Greg KH
2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
That patch isn't in mainline yet and shouldn't be merged to stable before that happens.
But this patch will never go into mainline - pci-gart.c was radically altered in 2.6.16-rc1.
Re: [patch 09/12] Mask off GFP flags before swiotlb_alloc_coherent
Quoted 11 lines · Andrew Morton
Quoted 7 lines · Andi Kleen
Quoted 2 lines · Greg KH
2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
That patch isn't in mainline yet and shouldn't be merged to stable before that happens.
But this patch will never go into mainline -
pci-gart.cwas radically altered in 2.6.16-rc1.
It has an direct equivalent in the mainline version. It's ftp://ftp.firstfloor.org/pub/ak/x86_64/quilt/swiotlb-dma32
-Andi
P.S.: I already have quite a lot of pure bug fixes for x86-64 (+ 1 late but important feature). There will be a relatively big late x86-64 syncup for 2.6.16 soon.
Re: [patch 06/12] elevator=as back-compatibility
In reply to Greg KHQuoted 2 lines · Greg KH
2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
Well the patch is trivial enough, but I don't see it fitting the stable criteria to be honest. You would have needed this since 2.6.10 stable, and it's not fixing an oops or anything.
So I'd NAK this for 2.6.15.x
Signature · 1 line
Jens Axboe
Re: [stable] Re: [patch 06/12] elevator=as back-compatibility
Quoted 9 lines · Jens Axboe
Quoted 2 lines · Greg KH
2.6.15.2 -stable review patch. If anyone has any objections, please let us know.
Well the patch is trivial enough, but I don't see it fitting the stable criteria to be honest. You would have needed this since 2.6.10 stable, and it's not fixing an oops or anything.
So I'd NAK this for 2.6.15.x
Ok, I dropped it.
thanks,
greg k-h