Linux 4.9.317
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.9.317 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 +- block/bio.c | 2 +- drivers/char/tpm/tpm_ibmvtpm.c | 1 + drivers/gpu/drm/i915/intel_pm.c | 2 +- drivers/i2c/busses/i2c-thunderx-pcidrv.c | 1 + drivers/md/dm-crypt.c | 15 +++++++++++---- drivers/md/dm-stats.c | 8 ++++++++ drivers/md/dm-verity-target.c | 1 + fs/exec.c | 17 +++++++++++++++++ fs/nfsd/nfs4state.c | 12 ++++-------- lib/assoc_array.c | 8 ++++++++ net/core/filter.c | 4 ++-- net/key/af_key.c | 6 +++--- 13 files changed, 59 insertions(+), 20 deletions(-)
Chuck Lever (1):
NFSD: Fix possible sleep during nfsd4_release_lockowner()
Greg Kroah-Hartman (1):
Linux 4.9.317
Gustavo A. R. Silva (1):
drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()
Haimin Zhang (1):
block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern
Kees Cook (1):
exec: Force single empty string when argv is empty
Liu Jian (1):
bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes
Mikulas Patocka (2):
dm crypt: make printing of the key constant-time dm stats: add cond_resched when looping over entries
Piyush Malgujar (1):
drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers
Sarthak Kukreti (1):
dm verity: set DM_TARGET_IMMUTABLE feature flag
Stephen Brennan (1):
assoc_array: Fix BUG_ON during garbage collect
Thomas Bartschies (1):
net: af_key: check encryption module availability consistency
Xiu Jianfeng (1):
tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe()
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 316 +SUBLEVEL = 317 EXTRAVERSION = NAME = Roaring Lionus
block/bio.c +1 -1
@@ -1538,7 +1538,7 @@ struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len,if (bytes > len) bytes = len; - page =alloc_page (q->bounce_gfp | gfp_mask); + page =alloc_page (q->bounce_gfp | __GFP_ZERO | gfp_mask);if (!page) goto cleanup;
drivers/char/tpm/tpm_ibmvtpm.c +1 -0
@@ -653,6 +653,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,if (!wait_event_timeout (ibmvtpm->crq_queue.wq, ibmvtpm->rtce_buf !=NULL ,HZ )) { + rc = -ENODEV ;dev_err (dev,"CRQ response timed out\n" ); goto init_irq_cleanup; }
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -2083,7 +2083,7 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)PIPE_WM_LINETIME_TIME (linetime); } -static void intel_read_wm_latency (struct drm_device *dev,uint16_t wm[8 ]) +static void intel_read_wm_latency (struct drm_device *dev,uint16_t wm[]) {struct drm_i915_private *dev_priv =to_i915 (dev);
drivers/i2c/busses/i2c-thunderx-pcidrv.c +1 -0
@@ -208,6 +208,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev, i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info; i2c->adap.dev.parent = dev; i2c->adap.dev.of_node = pdev->dev.of_node; + i2c->adap.dev.fwnode = dev->fwnode;snprintf (i2c->adap.name,sizeof (i2c->adap.name),"Cavium ThunderX i2c adapter at %s" ,dev_name (dev));i2c_set_adapdata (&i2c->adap, i2c);
drivers/md/dm-crypt.c +11 -4
@@ -1943,6 +1943,11 @@ static int crypt_map(struct dm_target *ti, struct bio *bio)return DM_MAPIO_SUBMITTED ; } +static char hex2asc (unsigned char c) +{ +return c +'0' + ((unsigned )(9 - c) >>4 &0x27 ); +} +static void crypt_status (struct dm_target *ti,status_type_t type,unsigned status_flags,char *result,unsigned maxlen) {
@@ -1958,10 +1963,12 @@ static void crypt_status(struct dm_target *ti, status_type_t type,case STATUSTYPE_TABLE :DMEMIT ("%s " , cc->cipher_string); -if (cc->key_size >0 ) -for (i =0 ; i < cc->key_size; i++) -DMEMIT ("%02x" , cc->key[i]); -else +if (cc->key_size >0 ) { +for (i =0 ; i < cc->key_size; i++) { +DMEMIT ("%c%c" ,hex2asc (cc->key[i] >>4 ), +hex2asc (cc->key[i] &0xf )); + } + }else DMEMIT ("-" ); DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset,
drivers/md/dm-stats.c +8 -0
@@ -228,6 +228,7 @@ void dm_stats_cleanup(struct dm_stats *stats)atomic_read (&shared->in_flight[READ ]), atomic_read(&shared->in_flight[WRITE])); } +cond_resched (); }dm_stat_free (&s->rcu_head); }
@@ -316,6 +317,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,for (ni =0 ; ni < n_entries; ni++) {atomic_set (&s->stat_shared[ni].in_flight[READ ],0 );atomic_set (&s->stat_shared[ni].in_flight[WRITE ],0 ); +cond_resched (); }if (s->n_histogram_entries) {
@@ -328,6 +330,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,for (ni =0 ; ni < n_entries; ni++) { s->stat_shared[ni].tmp.histogram = hi; hi += s->n_histogram_entries +1 ; +cond_resched (); } }
@@ -348,6 +351,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,for (ni =0 ; ni < n_entries; ni++) { p[ni].histogram = hi; hi += s->n_histogram_entries +1 ; +cond_resched (); } } }
@@ -477,6 +481,7 @@ static int dm_stats_list(struct dm_stats *stats, const char *program, }DMEMIT ("\n" ); } +cond_resched (); }mutex_unlock (&stats->mutex);
@@ -753,6 +758,7 @@ static void __dm_stat_clear(struct dm_stat *s, size_t idx_start, size_t idx_end,local_irq_enable (); } } +cond_resched (); } }
@@ -868,6 +874,8 @@ static int dm_stats_print(struct dm_stats *stats, int id,if (unlikely (sz +1 >= maxlen)) goto buffer_overflow; + +cond_resched (); }if (clear)
drivers/md/dm-verity-target.c +1 -0
@@ -1056,6 +1056,7 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv)static struct target_type verity_target = { .name ="verity" , + .features =DM_TARGET_IMMUTABLE , .version = {1 ,3 ,0 }, .module =THIS_MODULE , .ctr = verity_ctr,
fs/exec.c +17 -0
@@ -1758,6 +1758,9 @@ static int do_execveat_common(int fd, struct filename *filename, goto out_unmark; bprm->argc =count (argv,MAX_ARG_STRINGS ); +if (bprm->argc ==0 ) +pr_warn_once ("process '%s' launched '%s' with NULL argv: empty string added\n" , + current->comm, bprm->filename);if ((retval = bprm->argc) <0 ) goto out;
@@ -1782,6 +1785,20 @@ static int do_execveat_common(int fd, struct filename *filename,if (retval <0 ) goto out; +/* +* When argv is empty, add an empty string ("") as argv[0] to +* ensure confused userspace programs that start processing +* from argv[1] won't end up walking envp. See also +* bprm_stack_limits(). +*/ +if (bprm->argc ==0 ) { +const char *argv[] = {"" ,NULL }; + retval =copy_strings_kernel (1 , argv, bprm); +if (retval <0 ) + goto out; + bprm->argc =1 ; + } + retval =exec_binprm (bprm);if (retval <0 ) goto out;
fs/nfsd/nfs4state.c +4 -8
@@ -6342,16 +6342,12 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,if (sop->so_is_open_owner || !same_owner_str (sop, owner))continue ; -/* see if there are still any locks associated with it */ - lo =lockowner (sop); -list_for_each_entry (stp, &sop->so_stateids, st_perstateowner) { -if (check_for_locks (stp->st_stid.sc_file, lo)) { - status = nfserr_locks_held; -spin_unlock (&clp->cl_lock); -return status; - } +if (atomic_read (&sop->so_count) !=1 ) { +spin_unlock (&clp->cl_lock); +return nfserr_locks_held; } + lo =lockowner (sop);nfs4_get_stateowner (sop);break ; }
lib/assoc_array.c +8 -0
@@ -1478,6 +1478,7 @@ int assoc_array_gc(struct assoc_array *array,struct assoc_array_ptr *cursor, *ptr;struct assoc_array_ptr *new_root, *new_parent, **new_ptr_pp;unsigned long nr_leaves_on_tree; +bool retained;int keylen, slot, nr_free, next_slot, i;pr_devel ("-->%s()\n" , __func__);
@@ -1554,6 +1555,7 @@ int assoc_array_gc(struct assoc_array *array, goto descend; } +retry_compress:pr_devel ("-- compress node %p --\n" , new_n);/* Count up the number of empty slots in this node and work out the
@@ -1571,6 +1573,7 @@ int assoc_array_gc(struct assoc_array *array,pr_devel ("free=%d, leaves=%lu\n" , nr_free, new_n->nr_leaves_on_branch);/* See what we can fold in */ + retained = false; next_slot =0 ;for (slot =0 ; slot <ASSOC_ARRAY_FAN_OUT ; slot++) {struct assoc_array_shortcut *s;
@@ -1620,9 +1623,14 @@ int assoc_array_gc(struct assoc_array *array,pr_devel ("[%d] retain node %lu/%d [nx %d]\n" , slot, child->nr_leaves_on_branch, nr_free +1 , next_slot); + retained = true; } } +if (retained && new_n->nr_leaves_on_branch <=ASSOC_ARRAY_FAN_OUT ) { +pr_devel ("internal nodes remain despite enough space, retrying\n" ); + goto retry_compress; + }pr_devel ("after: %lu\n" , new_n->nr_leaves_on_branch); nr_leaves_on_tree = new_n->nr_leaves_on_branch;
net/core/filter.c +2 -2
@@ -1388,7 +1388,7 @@ BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,if (unlikely (flags & ~(BPF_F_RECOMPUTE_CSUM |BPF_F_INVALIDATE_HASH )))return -EINVAL ; -if (unlikely (offset >0xffff )) +if (unlikely (offset >INT_MAX ))return -EFAULT ;if (unlikely (bpf_try_make_writable (skb, offset + len)))return -EFAULT ;
@@ -1423,7 +1423,7 @@ BPF_CALL_4(bpf_skb_load_bytes, const struct sk_buff *, skb, u32, offset, {void *ptr; -if (unlikely (offset >0xffff )) +if (unlikely (offset >INT_MAX )) goto err_clear; ptr =skb_header_pointer (skb, offset, len, to);
net/key/af_key.c +3 -3
@@ -2935,7 +2935,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t)break ;if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg)) +if (aalg_tmpl_set (t, aalg) && aalg->available) sz +=sizeof (struct sadb_comb ); }return sz +sizeof (struct sadb_prop );
@@ -2953,7 +2953,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!ealg->pfkey_supported)continue ; -if (!(ealg_tmpl_set (t, ealg))) +if (!(ealg_tmpl_set (t, ealg) && ealg->available))continue ;for (k =1 ; ; k++) {
@@ -2964,7 +2964,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg)) +if (aalg_tmpl_set (t, aalg) && aalg->available) sz +=sizeof (struct sadb_comb ); } }