Linux 3.4.101
Greg KH
maintainerI'm announcing the release of the 3.4.101 kernel.
All users of the 3.4 kernel series must upgrade.
The updated 3.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.4.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 4 +++- arch/s390/kernel/ptrace.c | 9 +++++++-- arch/x86/kernel/entry_32.S | 9 +++++---- block/blk-tag.c | 33 +++++++-------------------------- drivers/ata/ahci.c | 1 + drivers/ata/libata-core.c | 12 ++++++++++-- fs/ceph/snap.c | 2 +- include/drm/drm_mem_util.h | 4 ++-- include/linux/kernel.h | 1 + include/linux/libata.h | 1 + include/linux/slab.h | 2 +- mm/hugetlb.c | 1 + mm/kmemleak.c | 4 +++- mm/vmalloc.c | 14 ++++++++++---- 14 files changed, 53 insertions(+), 44 deletions(-)
Catalin Marinas (1):
mm: kmemleak: avoid false negatives on vmalloc'ed objects
Christoph Hellwig (1):
block: don't assume last put of shared tags is for the host
Greg Kroah-Hartman (1):
Linux 3.4.101
Kevin Hao (1):
libata: support the ata host which implements a queue depth less than 32
Linus Torvalds (1):
Fix gcc-4.9.0 miscompilation of load_balance() in scheduler
Martin Schwidefsky (1):
s390/ptrace: fix PSW mask check
Naoya Horiguchi (1):
mm: hugetlb: fix copy_hugetlb_page_range()
Romain Degez (1):
ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode)
Sven Wegener (1):
x86_32, entry: Store badsys error code in %eax
Tejun Heo (1):
libata: introduce ata_host->n_tags to avoid oops on SAS controllers
Xi Wang (1):
introduce SIZE_MAX
Greg KH
maintainerMakefile +3 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 4 -SUBLEVEL = 100 +SUBLEVEL = 101 EXTRAVERSION = NAME = Saber-toothed Squirrel
@@ -592,6 +592,8 @@ KBUILD_CFLAGS += -fomit-frame-pointer endif endif +KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments) + ifdef CONFIG_DEBUG_INFO KBUILD_CFLAGS += -g KBUILD_AFLAGS += -gdwarf-2
arch/s390/kernel/ptrace.c +7 -2
@@ -292,7 +292,9 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)* psw and gprs are stored on the stack */ if (addr == (addr_t) &dummy->regs.psw.mask && - ((data & ~PSW_MASK_USER ) != psw_user_bits || + (((data^psw_user_bits) & ~PSW_MASK_USER ) || + (((data^psw_user_bits) &PSW_MASK_ASC ) && + ((data|psw_user_bits) &PSW_MASK_ASC ) ==PSW_MASK_ASC ) || ((data &PSW_MASK_EA ) && !(data &PSW_MASK_BA ))))/* Invalid psw mask. */ return -EINVAL ;
@@ -595,7 +597,10 @@ static int __poke_user_compat(struct task_struct *child,*/ if (addr == (addr_t) &dummy32->regs.psw.mask) {/* Build a 64 bit psw mask from 31 bit mask. */ -if ((tmp & ~PSW32_MASK_USER ) != psw32_user_bits) +if (((tmp^psw32_user_bits) & ~PSW32_MASK_USER ) || + (((tmp^psw32_user_bits) &PSW32_MASK_ASC ) && + ((tmp|psw32_user_bits) &PSW32_MASK_ASC ) + ==PSW32_MASK_ASC ))/* Invalid psw mask. */ return -EINVAL ; regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
arch/x86/kernel/entry_32.S +5 -4
@@ -428,8 +428,8 @@ sysenter_do_call: cmpl $(NR_syscalls), %eax jae sysenter_badsys call *sys_call_table(,%eax,4) - movl %eax,PT_EAX(%esp) sysenter_after_call: + movl %eax,PT_EAX(%esp) LOCKDEP_SYS_EXIT DISABLE_INTERRUPTS(CLBR_ANY) TRACE_IRQS_OFF
@@ -510,6 +510,7 @@ ENTRY(system_call) jae syscall_badsys syscall_call: call *sys_call_table(,%eax,4) +syscall_after_call: movl %eax,PT_EAX(%esp) # store the return value syscall_exit: LOCKDEP_SYS_EXIT
@@ -678,12 +679,12 @@ syscall_fault: END(syscall_fault) syscall_badsys: - movl $-ENOSYS,PT_EAX(%esp) - jmp syscall_exit + movl $-ENOSYS,%eax + jmp syscall_after_call END(syscall_badsys) sysenter_badsys: - movl $-ENOSYS,PT_EAX(%esp) + movl $-ENOSYS,%eax jmp sysenter_after_call END(syscall_badsys) CFI_ENDPROC
block/blk-tag.c +7 -26
@@ -27,18 +27,15 @@ struct request *blk_queue_find_tag(struct request_queue *q, int tag)EXPORT_SYMBOL (blk_queue_find_tag);/** -* __blk_free_tags - release a given set of tag maintenance info +* blk_free_tags - release a given set of tag maintenance info * @bqt: the tag map to free * -* Tries to free the specified @bqt. Returns true if it was -* actually freed and false if there are still references using it +* Drop the reference count on @bqt and frees it when the last reference +* is dropped. */ -static int __blk_free_tags (struct blk_queue_tag *bqt) +void blk_free_tags (struct blk_queue_tag *bqt) { -int retval; - - retval =atomic_dec_and_test (&bqt->refcnt); -if (retval) { +if (atomic_dec_and_test (&bqt->refcnt)) {BUG_ON (find_first_bit (bqt->tag_map, bqt->max_depth) < bqt->max_depth);
@@ -50,9 +47,8 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)kfree (bqt); } - -return retval; } +EXPORT_SYMBOL (blk_free_tags);/** * __blk_queue_free_tags - release tag maintenance info
@@ -69,28 +65,13 @@ void __blk_queue_free_tags(struct request_queue *q)if (!bqt)return ; -__blk_free_tags (bqt); +blk_free_tags (bqt); q->queue_tags =NULL ;queue_flag_clear_unlocked (QUEUE_FLAG_QUEUED , q); }/** -* blk_free_tags - release a given set of tag maintenance info -* @bqt: the tag map to free -* -* For externally managed @bqt frees the map. Callers of this -* function must guarantee to have released all the queues that -* might have been using this tag map. -*/ -void blk_free_tags (struct blk_queue_tag *bqt) -{ -if (unlikely (!__blk_free_tags (bqt))) -BUG (); -} -EXPORT_SYMBOL (blk_free_tags); - -/** * blk_queue_free_tags - release tag maintenance info * @q: the request queue for the device *
drivers/ata/ahci.c +1 -0
@@ -446,6 +446,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {/* Promise */ { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ + { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode *//* Asmedia */ { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */
drivers/ata/libata-core.c +10 -2
@@ -4693,6 +4693,10 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)* ata_qc_new - Request an available ATA command, for queueing * @ap: target port * +* Some ATA host controllers may implement a queue depth which is less +* than ATA_MAX_QUEUE. So we shouldn't allocate a tag which is beyond +* the hardware limitation. +* * LOCKING: * None. */
@@ -4700,14 +4704,15 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)static struct ata_queued_cmd *ata_qc_new (struct ata_port *ap) {struct ata_queued_cmd *qc =NULL ; +unsigned int max_queue = ap->host->n_tags;unsigned int i, tag;/* no command while frozen */ if (unlikely (ap->pflags &ATA_PFLAG_FROZEN ))return NULL ; -for (i =0 ; i <ATA_MAX_QUEUE ; i++) { - tag = (i + ap->last_tag +1 ) %ATA_MAX_QUEUE ; +for (i =0 , tag = ap->last_tag +1 ; i < max_queue; i++, tag++) { + tag = tag < max_queue ? tag :0 ;/* the last tag is reserved for internal command. */ if (tag ==ATA_TAG_INTERNAL )
@@ -5959,6 +5964,7 @@ void ata_host_init(struct ata_host *host, struct device *dev, {spin_lock_init (&host->lock);mutex_init (&host->eh_mutex); + host->n_tags =ATA_MAX_QUEUE -1 ; host->dev = dev; host->flags = flags; host->ops = ops;
@@ -6041,6 +6047,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) {int i, rc; + host->n_tags =clamp (sht->can_queue,1 ,ATA_MAX_QUEUE -1 ); +/* host must have been started */ if (!(host->flags &ATA_HOST_STARTED )) {dev_err (host->dev,"BUG: trying to register unstarted host\n" );
fs/ceph/snap.c +1 -1
@@ -331,7 +331,7 @@ static int build_snap_context(struct ceph_snap_realm *realm)/* alloc new snap context */ err = -ENOMEM ; -if (num > (ULONG_MAX -sizeof (*snapc)) /sizeof (u64)) +if (num > (SIZE_MAX -sizeof (*snapc)) /sizeof (u64)) goto fail; snapc =kzalloc (sizeof (*snapc) + num*sizeof (u64),GFP_NOFS );if (!snapc)
include/drm/drm_mem_util.h +2 -2
@@ -31,7 +31,7 @@static __inline__void *drm_calloc_large (size_t nmemb,size_t size) { -if (size !=0 && nmemb >ULONG_MAX / size) +if (size !=0 && nmemb >SIZE_MAX / size)return NULL ;if (size * nmemb <=PAGE_SIZE )
@@ -44,7 +44,7 @@ static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)/* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */ static __inline__void *drm_malloc_ab (size_t nmemb,size_t size) { -if (size !=0 && nmemb >ULONG_MAX / size) +if (size !=0 && nmemb >SIZE_MAX / size)return NULL ;if (size * nmemb <=PAGE_SIZE )
include/linux/kernel.h +1 -0
@@ -35,6 +35,7 @@#define LLONG_MAX ((long long)(~0ULL>>1))#define LLONG_MIN (-LLONG_MAX - 1)#define ULLONG_MAX (~0ULL) +#define SIZE_MAX (~(size_t)0)#define STACK_MAGIC 0xdeadbeef
include/linux/libata.h +1 -0
@@ -539,6 +539,7 @@ struct ata_host {struct device *dev;void __iomem *const *iomap;unsigned int n_ports; +unsigned int n_tags;/* nr of NCQ tags */ void *private_data;struct ata_port_operations *ops;unsigned long flags;
include/linux/slab.h +1 -1
@@ -242,7 +242,7 @@ size_t ksize(const void *);*/ static inline void *kmalloc_array (size_t n,size_t size,gfp_t flags) { -if (size !=0 && n >ULONG_MAX / size) +if (size !=0 && n >SIZE_MAX / size)return NULL ;return __kmalloc (n * size, flags); }
mm/hugetlb.c +1 -0
@@ -2348,6 +2348,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, }else {if (cow)huge_ptep_set_wrprotect (src, addr, src_pte); + entry =huge_ptep_get (src_pte); ptepage =pte_page (entry);get_page (ptepage);page_dup_rmap (ptepage);
mm/kmemleak.c +3 -1
@@ -750,7 +750,9 @@ static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp) }spin_lock_irqsave (&object->lock, flags); -if (ptr + size > object->pointer + object->size) { +if (size ==SIZE_MAX ) { + size = object->pointer + object->size - ptr; + }else if (ptr + size > object->pointer + object->size) {kmemleak_warn ("Scan area larger than object 0x%08lx\n" , ptr);dump_object_info (object);kmem_cache_free (scan_area_cache, area);
mm/vmalloc.c +10 -4
@@ -349,6 +349,12 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,if (unlikely (!va))return ERR_PTR (-ENOMEM ); +/* +* Only scan the relevant parts containing pointers to other objects +* to avoid false negatives. +*/ +kmemleak_scan_area (&va->rb_node,SIZE_MAX , gfp_mask &GFP_RECLAIM_MASK ); + retry:spin_lock (&vmap_area_lock);/*
@@ -1669,11 +1675,11 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,insert_vmalloc_vmlist (area);/* -* A ref_count = 3 is needed because the vm_struct and vmap_area -* structures allocated in the __get_vm_area_node() function contain -* references to the virtual address of the vmalloc'ed block. +* A ref_count = 2 is needed because vm_struct allocated in +* __get_vm_area_node() contains a reference to the virtual address of +* the vmalloc'ed block. */ -kmemleak_alloc (addr, real_size,3 , gfp_mask); +kmemleak_alloc (addr, real_size,2 , gfp_mask);return addr;