Linux 3.18.59
Greg KH
maintainerI'm announcing the release of the 3.18.59 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.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 | 2 - arch/powerpc/kernel/kprobes.c | 11 +++++ arch/powerpc/kvm/book3s_hv.c | 21 ++++++++++ arch/powerpc/mm/slb_low.S | 10 +++++ drivers/input/serio/i8042-x86ia64io.h | 7 +++ drivers/mtd/spi-nor/spi-nor.c | 7 +++ drivers/net/phy/marvell.c | 2 - drivers/of/fdt.c | 9 +++- drivers/target/target_core_internal.h | 2 - drivers/target/target_core_tmr.c | 16 ++++---- drivers/target/target_core_transport.c | 9 +++- drivers/usb/gadget/function/f_fs.c | 10 ++--- fs/autofs4/dev-ioctl.c | 2 - fs/cifs/smb1ops.c | 9 +++- fs/cifs/smb2ops.c | 4 +- fs/exec.c | 28 ++++++++++++-- kernel/signal.c | 20 +++++++--- lib/cmdline.c | 6 +-- net/mac80211/wpa.c | 5 +- net/rxrpc/ar-key.c | 64 +++++++++++++++++---------------- 20 files changed, 171 insertions(+), 73 deletions(-)
Daniel Drake (1):
Input: i8042 - add Fujitsu Lifebook AH544 to notimeout list
David Howells (1):
rxrpc: Fix several cases where a padded len isn't checked in ticket decode
Eric W. Biederman (1):
signal: Only reschedule timers on signals timers have sent
Greg Kroah-Hartman (1):
Linux 3.18.59
Ilya Matveychikov (1):
lib/cmdline.c: fix get_options() overflow while parsing ranges
Jason A. Donenfeld (1):
mac80211/wpa: use constant time memory comparison for MACs
Joël Esponde (1):
mtd: spi-nor: fix spansion quad enable
Kees Cook (1):
fs/exec.c: account for argv/envp pointers
Michael Ellerman (1):
powerpc/slb: Force a full SLB flush when we insert for a bad EA
Naveen N. Rao (1):
powerpc/kprobes: Pause function_graph tracing during jprobes handling
NeilBrown (1):
autofs: sanity check status reported with AUTOFS_DEV_IOCTL_FAIL
Nicholas Bellinger (1):
target: Fix kref->refcount underflow in transport_cmd_finish_abort
Paul Mackerras (1):
KVM: PPC: Book3S HV: Preserve userspace HTM state properly
Pavel Shilovsky (1):
CIFS: Improve readdir verbosity
Russell King (1):
net: phy: fix marvell phy status reading
Tobias Wolf (1):
of: Add check to of_scan_flat_dt() before accessing initial_boot_params
William Wu (1):
usb: gadget: f_fs: avoid out of bounds access on comp_desc
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 58 +SUBLEVEL = 59 EXTRAVERSION = NAME = Diseased Newt
arch/powerpc/kernel/kprobes.c +11 -0
@@ -514,6 +514,15 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)#endif #endif +/* +* jprobes use jprobe_return() which skips the normal return +* path of the function, and this messes up the accounting of the +* function graph tracer. +* +* Pause function graph tracing while performing the jprobe function. +*/ +pause_graph_tracing (); +return 1 ; }
@@ -536,6 +545,8 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)* saved regs... */ memcpy (regs, &kcb->jprobe_saved_regs,sizeof (struct pt_regs )); +/* It's OK to start function graph tracing again */ +unpause_graph_tracing ();preempt_enable_no_resched ();return 1 ; }
arch/powerpc/kvm/book3s_hv.c +21 -0
@@ -1956,6 +1956,27 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)return -EINVAL ; } +/* +* Don't allow entry with a suspended transaction, because +* the guest entry/exit code will lose it. +* If the guest has TM enabled, save away their TM-related SPRs +* (they will get restored by the TM unavailable interrupt). +*/ +#ifdef CONFIG_PPC_TRANSACTIONAL_MEM +if (cpu_has_feature (CPU_FTR_TM ) && current->thread.regs && + (current->thread.regs->msr &MSR_TM )) { +if (MSR_TM_ACTIVE (current->thread.regs->msr)) { + run->exit_reason =KVM_EXIT_FAIL_ENTRY ; + run->fail_entry.hardware_entry_failure_reason =0 ; +return -EINVAL ; + } + current->thread.tm_tfhar =mfspr (SPRN_TFHAR ); + current->thread.tm_tfiar =mfspr (SPRN_TFIAR ); + current->thread.tm_texasr =mfspr (SPRN_TEXASR ); + current->thread.regs->msr &= ~MSR_TM ; + } +#endif +kvmppc_core_prepare_to_enter (vcpu);/* No need to go into the guest when all we'll do is come back out */
arch/powerpc/mm/slb_low.S +10 -0
@@ -179,6 +179,16 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) b slb_finish_load 8: /* invalid EA */ + /* + * It's possible the bad EA is too large to fit in the SLB cache, which + * would mean we'd fail to invalidate it on context switch. So mark the + * SLB cache as full so we force a full flush. We also set cr7+eq to + * mark the address as a kernel address, so slb_finish_load() skips + * trying to insert it into the SLB cache. + */ + li r9,SLB_CACHE_ENTRIES + 1 + sth r9,PACASLBCACHEPTR(r13) + crset 4*cr7+eq li r10,0 /* BAD_VSID */ li r9,0 /* BAD_VSID */ li r11,SLB_VSID_USER /* flags don't much matter */
drivers/input/serio/i8042-x86ia64io.h +7 -0
@@ -688,6 +688,13 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"), }, }, + { + /* Fujitsu UH554 laptop */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"), + }, + }, { } };
drivers/mtd/spi-nor/spi-nor.c +7 -0
@@ -864,6 +864,13 @@ static int spansion_quad_enable(struct spi_nor *nor)return -EINVAL ; } + ret =spi_nor_wait_till_ready (nor); +if (ret) { +dev_err (nor->dev, +"timeout while writing configuration register\n" ); +return ret; + } +/* read back and check it */ ret =read_cr (nor);if (!(ret >0 && (ret &CR_QUAD_EN_SPAN ))) {
drivers/net/phy/marvell.c +0 -2
@@ -737,8 +737,6 @@ static int marvell_read_status(struct phy_device *phydev)if (adv <0 )return adv; - lpa &= adv; -if (status &MII_M1011_PHY_STATUS_FULLDUPLEX ) phydev->duplex =DUPLEX_FULL ;else
drivers/of/fdt.c +6 -3
@@ -585,9 +585,12 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,const char *pathp;int offset, rc =0 , depth =-1 ; -for (offset =fdt_next_node (blob,-1 , &depth); - offset >=0 && depth >=0 && !rc; - offset =fdt_next_node (blob, offset, &depth)) { +if (!blob) +return 0 ; + +for (offset =fdt_next_node (blob,-1 , &depth); + offset >=0 && depth >=0 && !rc; + offset =fdt_next_node (blob, offset, &depth)) { pathp =fdt_get_name (blob, offset,NULL );if (*pathp =='/' )
drivers/target/target_core_internal.h +1 -1
@@ -92,7 +92,7 @@ int init_se_kmem_caches(void);void release_se_kmem_caches (void );u32 scsi_get_new_index (scsi_index_t );void transport_subsystem_check_init (void ); -void transport_cmd_finish_abort (struct se_cmd *,int ); +int transport_cmd_finish_abort (struct se_cmd *,int );unsigned char *transport_dump_cmd_direction (struct se_cmd *);void transport_dump_dev_state (struct se_device *,char *,int *); void transport_dump_dev_info(struct se_device *, struct se_lun *,
drivers/target/target_core_tmr.c +8 -8
@@ -78,7 +78,7 @@ void core_tmr_release_req(struct se_tmr_req *tmr)kfree (tmr); } -static void core_tmr_handle_tas_abort (struct se_cmd *cmd,int tas) +static int core_tmr_handle_tas_abort (struct se_cmd *cmd,int tas) {unsigned long flags;bool remove = true, send_tas;
@@ -94,7 +94,7 @@ static void core_tmr_handle_tas_abort(struct se_cmd *cmd, int tas)transport_send_task_abort (cmd); } -transport_cmd_finish_abort (cmd, remove); +return transport_cmd_finish_abort (cmd, remove); } static int target_check_cdb_and_preempt(struct list_head *list,
@@ -190,8 +190,8 @@ void core_tmr_abort_task(cancel_work_sync (&se_cmd->work);transport_wait_for_tasks (se_cmd); -transport_cmd_finish_abort (se_cmd, true); -target_put_sess_cmd (se_cmd); +if (!transport_cmd_finish_abort (se_cmd, true)) +target_put_sess_cmd (se_cmd);printk ("ABORT_TASK: Sending TMR_FUNCTION_COMPLETE for" " ref_tag: %d\n" , ref_tag);
@@ -291,8 +291,8 @@ static void core_tmr_drain_tmr_list(cancel_work_sync (&cmd->work);transport_wait_for_tasks (cmd); -transport_cmd_finish_abort (cmd,1 ); -target_put_sess_cmd (cmd); +if (!transport_cmd_finish_abort (cmd,1 )) +target_put_sess_cmd (cmd); } }
@@ -390,8 +390,8 @@ static void core_tmr_drain_state_list(cancel_work_sync (&cmd->work);transport_wait_for_tasks (cmd); -core_tmr_handle_tas_abort (cmd, tas); -target_put_sess_cmd (cmd); +if (!core_tmr_handle_tas_abort (cmd, tas)) +target_put_sess_cmd (cmd); } }
drivers/target/target_core_transport.c +6 -3
@@ -604,9 +604,10 @@ static void transport_lun_remove_cmd(struct se_cmd *cmd)percpu_ref_put (&lun->lun_ref); } -void transport_cmd_finish_abort (struct se_cmd *cmd,int remove) +int transport_cmd_finish_abort (struct se_cmd *cmd,int remove) {bool ack_kref = (cmd->se_cmd_flags &SCF_ACK_KREF ); +int ret =0 ;if (cmd->se_cmd_flags &SCF_SE_LUN_CMD )transport_lun_remove_cmd (cmd);
@@ -618,9 +619,11 @@ void transport_cmd_finish_abort(struct se_cmd *cmd, int remove) cmd->se_tfo->aborted_task (cmd);if (transport_cmd_check_stop_to_fabric (cmd)) -return ; +return 1 ;if (remove && ack_kref) -transport_put_cmd (cmd); + ret =transport_put_cmd (cmd); + +return ret; }static void target_complete_failure_work (struct work_struct *work)
drivers/usb/gadget/function/f_fs.c +5 -5
@@ -1674,12 +1674,12 @@ static int ffs_func_eps_enable(struct ffs_function *func) ep->ep->driver_data = ep; ep->ep->desc = ds; - comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + -USB_DT_ENDPOINT_SIZE ); - ep->ep->maxburst = comp_desc->bMaxBurst +1 ; - -if (needs_comp_desc) +if (needs_comp_desc) { + comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + +USB_DT_ENDPOINT_SIZE ); + ep->ep->maxburst = comp_desc->bMaxBurst +1 ; ep->ep->comp_desc = comp_desc; + } ret =usb_ep_enable (ep->ep);if (likely (!ret)) {
fs/autofs4/dev-ioctl.c +1 -1
@@ -331,7 +331,7 @@ static int autofs_dev_ioctl_fail(struct file *fp,int status; token = (autofs_wqt_t ) param->fail.token; - status = param->fail.status ? param->fail.status : -ENOENT ; + status = param->fail.status <0 ? param->fail.status : -ENOENT ;return autofs4_wait_release (sbi, token, status); }
fs/cifs/smb1ops.c +7 -2
@@ -849,8 +849,13 @@ cifs_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *fid, __u16 search_flags, struct cifs_search_info *srch_inf) { - return CIFSFindFirst(xid, tcon, path, cifs_sb, - &fid->netfid, search_flags, srch_inf, true); + int rc; + + rc =CIFSFindFirst (xid, tcon, path, cifs_sb, + &fid->netfid, search_flags, srch_inf, true); +if (rc) +cifs_dbg (FYI ,"find first failed=%d\n" , rc); +return rc; } static int
fs/cifs/smb2ops.c +2 -2
@@ -842,7 +842,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, rc =SMB2_open (xid, &oparms, utf16_path, &oplock,NULL ,NULL );kfree (utf16_path);if (rc) { -cifs_dbg (VFS ,"open dir failed\n" ); +cifs_dbg (FYI ,"open dir failed rc=%d\n" , rc);return rc; }
@@ -852,7 +852,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, rc =SMB2_query_directory (xid, tcon, fid->persistent_fid, fid->volatile_fid,0 , srch_inf);if (rc) { -cifs_dbg (VFS ,"query directory failed\n" ); +cifs_dbg (FYI ,"query directory failed rc=%d\n" , rc);SMB2_close (xid, tcon, fid->persistent_fid, fid->volatile_fid); }return rc;
fs/exec.c +24 -4
@@ -199,8 +199,26 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,if (write) {unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start; +unsigned long ptr_size;struct rlimit *rlim; +/* +* Since the stack will hold pointers to the strings, we +* must account for them as well. +* +* The size calculation is the entire vma while each arg page is +* built, so each time we get here it's calculating how far it +* is currently (rather than each call being just the newly +* added size from the arg page). As a result, we need to +* always add the entire size of the pointers, so that on the +* last call to get_arg_page() we'll actually have the entire +* correct size. +*/ + ptr_size = (bprm->argc + bprm->envc) *sizeof (void *); +if (ptr_size >ULONG_MAX - size) + goto fail; + size += ptr_size; +acct_arg_size (bprm, size /PAGE_SIZE );/*
@@ -218,13 +236,15 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,* to work from. */ rlim = current->signal->rlim; -if (size >ACCESS_ONCE (rlim[RLIMIT_STACK ].rlim_cur) /4 ) { -put_page (page); -return NULL ; - } +if (size >READ_ONCE (rlim[RLIMIT_STACK ].rlim_cur) /4 ) + goto fail; }return page; + +fail: +put_page (page); +return NULL ; }static void put_arg_page (struct page *page)
kernel/signal.c +14 -6
@@ -543,7 +543,8 @@ unblock_all_signals(void)spin_unlock_irqrestore (¤t->sighand->siglock, flags); } -static void collect_signal (int sig,struct sigpending *list,siginfo_t *info) +static void collect_signal (int sig,struct sigpending *list,siginfo_t *info, +bool *resched_timer) {struct sigqueue *q, *first =NULL ;
@@ -565,6 +566,12 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info) still_pending:list_del_init (&first->list);copy_siginfo (info, &first->info); + + *resched_timer = + (first->flags &SIGQUEUE_PREALLOC ) && + (info->si_code ==SI_TIMER ) && + (info->si_sys_private); +__sigqueue_free (first); }else {/*
@@ -581,7 +588,7 @@ still_pending: }static int __dequeue_signal (struct sigpending *pending,sigset_t *mask, -siginfo_t *info) +siginfo_t *info,bool *resched_timer) {int sig =next_signal (pending, mask);
@@ -595,7 +602,7 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, } } -collect_signal (sig, pending, info); +collect_signal (sig, pending, info, resched_timer); }return sig;
@@ -609,15 +616,16 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask,*/ int dequeue_signal (struct task_struct *tsk,sigset_t *mask,siginfo_t *info) { +bool resched_timer = false;int signr;/* We only dequeue private signals from ourselves, we don't let * signalfd steal them */ - signr =__dequeue_signal (&tsk->pending, mask, info); + signr =__dequeue_signal (&tsk->pending, mask, info, &resched_timer);if (!signr) { signr =__dequeue_signal (&tsk->signal->shared_pending, - mask, info); + mask, info, &resched_timer);/* * itimer signal ? *
@@ -662,7 +670,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)*/ current->jobctl |=JOBCTL_STOP_DEQUEUED ; } -if ((info->si_code & __SI_MASK) == __SI_TIMER && info->si_sys_private) { +if (resched_timer) {/* * Release the siglock to ensure proper locking order * of timer locks outside of siglocks. Note, we leave
lib/cmdline.c +3 -3
@@ -22,14 +22,14 @@* the values[M, M+1, ..., N] into the ints array in get_options. */ -static int get_range (char **str,int *pint) +static int get_range (char **str,int *pint,int n) {int x, inc_counter, upper_range; (*str)++; upper_range =simple_strtol ((*str),NULL ,0 ); inc_counter = upper_range - *pint; -for (x = *pint; x < upper_range; x++) +for (x = *pint; n && x < upper_range; x++, n--) *pint++ = x;return inc_counter; }
@@ -96,7 +96,7 @@ char *get_options(const char *str, int nints, int *ints)break ;if (res ==3 ) {int range_nums; - range_nums =get_range ((char **)&str, ints + i); + range_nums =get_range ((char **)&str, ints + i, nints - i);if (range_nums <0 )break ;/*
net/mac80211/wpa.c +3 -2
@@ -16,6 +16,7 @@#include <asm/unaligned.h> #include <net/mac80211.h> #include <crypto/aes.h> +#include <crypto/algapi.h> #include "ieee80211_i.h" #include "michael.h"
@@ -150,7 +151,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) data_len = skb->len - hdrlen -MICHAEL_MIC_LEN ; key = &rx->key->conf.key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY ];michael_mic (key, hdr, data, data_len, mic); -if (memcmp (mic, data + data_len,MICHAEL_MIC_LEN ) !=0 ) +if (crypto_memneq (mic, data + data_len,MICHAEL_MIC_LEN )) goto mic_fail;/* remove Michael MIC from payload */
@@ -771,7 +772,7 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)bip_aad (skb, aad);ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, skb->data +24 , skb->len -24 , mic); -if (memcmp (mic, mmie->mic,sizeof (mmie->mic)) !=0 ) { +if (crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_cmac.icverrors++;return RX_DROP_UNUSABLE ; }
net/rxrpc/ar-key.c +34 -30
156 lines not on this page · raw message