Linux 4.19.176
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.176 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.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 arch/x86/kvm/svm.c | 18 +-- block/blk-mq.c | 7 - block/elevator.c | 14 -- block/genhd.c | 10 + drivers/crypto/chelsio/chtls/chtls_cm.c | 7 - drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 3 drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 11 + drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 5 drivers/regulator/core.c | 84 ++++++++++----- drivers/remoteproc/qcom_q6v5_pil.c | 11 + fs/fs-writeback.c | 2 fs/nfs/pnfs.c | 8 + fs/squashfs/export.c | 41 +++++-- fs/squashfs/id.c | 40 +++++-- fs/squashfs/squashfs_fs_sb.h | 1 fs/squashfs/super.c | 6 - fs/squashfs/xattr.h | 10 + fs/squashfs/xattr_id.c | 66 ++++++++++- include/linux/backing-dev.h | 10 + include/linux/kprobes.h | 2 include/linux/string.h | 4 include/linux/sunrpc/xdr.h | 3 include/trace/events/writeback.h | 35 +++--- init/init_task.c | 3 kernel/kprobes.c | 34 ++++-- kernel/trace/ftrace.c | 2 kernel/trace/trace_kprobe.c | 4 lib/string.c | 47 +++++++- mm/backing-dev.c | 1 net/key/af_key.c | 6 - net/sunrpc/auth_gss/auth_gss.c | 30 ----- net/sunrpc/auth_gss/auth_gss_internal.h | 45 ++++++++ net/sunrpc/auth_gss/gss_krb5_mech.c | 31 ----- 35 files changed, 410 insertions(+), 196 deletions(-)
Cong Wang (1):
af_key: relax availability checks for skb size calculation
Dave Wysochanski (2):
SUNRPC: Move simple_get_bytes and simple_get_netobj into private header
SUNRPC: Handle 0 length opaque XDR object data properly
David Collins (1):
regulator: core: avoid regulator_resolve_supply() race condition
Douglas Anderson (1):
regulator: core: Clean enabling always-on regulators + their supplies
Emmanuel Grumbach (1):
iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap
Greg Kroah-Hartman (1):
Linux 4.19.176
Johannes Berg (3):
iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time()
iwlwifi: pcie: fix context info memory leak
iwlwifi: mvm: guard against device removal in reprobe
Mark Brown (1):
regulator: Fix lockdep warning resolving supplies
Masami Hiramatsu (1):
tracing/kprobe: Fix to support kretprobe events on unloaded modules
Ming Lei (2):
block: don't hold q->sysfs_lock in elevator_init_mq
blk-mq: don't hold q->sysfs_lock in blk_mq_map_swqueueOlliver Schinagl (1):
regulator: core: enable power when setting up constraints
Pan Bian (1):
chtls: Fix potential resource leak
Peter Gonda (1):
Fix unsynchronized access to sev members through svm_register_enc_region
Phillip Lougher (3):
squashfs: add more sanity checks in id lookup
squashfs: add more sanity checks in inode lookup
squashfs: add more sanity checks in xattr id lookup
Qian Cai (1):
include/trace/events/writeback.h: fix -Wstringop-truncation warnings
Sibi Sankar (2):
remoteproc: qcom_q6v5_mss: Validate modem blob firmware size before load
remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load
Steven Rostedt (VMware) (1):
fgraph: Initialize tracing_graph_pause at task creation
Theodore Ts'o (1):
memcg: fix a crash in wb_workfn when a device disappears
Tobin C. Harding (1):
lib/string: Add strscpy_pad() function
Trond Myklebust (1):
pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process()
zhengbin (1):
block: fix NULL pointer dereference in register_disk
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 175 +SUBLEVEL = 176 EXTRAVERSION = NAME = "People's Front"
arch/x86/kvm/svm.c +11 -7
@@ -1832,6 +1832,8 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr,struct page **pages;unsigned long first, last; +lockdep_assert_held (&kvm->lock); +if (ulen ==0 || uaddr + ulen < uaddr)return NULL ;
@@ -7084,12 +7086,21 @@ static int svm_register_enc_region(struct kvm *kvm,if (!region)return -ENOMEM ; +mutex_lock (&kvm->lock); region->pages =sev_pin_memory (kvm, range->addr, range->size, ®ion->npages,1 );if (!region->pages) { ret = -ENOMEM ; +mutex_unlock (&kvm->lock); goto e_free; } + region->uaddr = range->addr; + region->size = range->size; + +mutex_lock (&kvm->lock); +list_add_tail (®ion->list, &sev->regions_list); +mutex_unlock (&kvm->lock); +/* * The guest may change the memory encryption attribute from C=0 -> C=1 * or vice versa for this memory range. Lets make sure caches are
@@ -7098,13 +7109,6 @@ static int svm_register_enc_region(struct kvm *kvm,*/ sev_clflush_pages (region->pages, region->npages); - region->uaddr = range->addr; - region->size = range->size; - -mutex_lock (&kvm->lock); -list_add_tail (®ion->list, &sev->regions_list); -mutex_unlock (&kvm->lock); -return ret; e_free:
block/blk-mq.c +0 -7
@@ -2324,11 +2324,6 @@ static void blk_mq_map_swqueue(struct request_queue *q)struct blk_mq_ctx *ctx;struct blk_mq_tag_set *set = q->tag_set; -/* -* Avoid others reading imcomplete hctx->cpumask through sysfs -*/ -mutex_lock (&q->sysfs_lock); -queue_for_each_hw_ctx (q, hctx, i) {cpumask_clear (hctx->cpumask); hctx->nr_ctx =0 ;
@@ -2362,8 +2357,6 @@ static void blk_mq_map_swqueue(struct request_queue *q) hctx->ctxs[hctx->nr_ctx++] = ctx; } -mutex_unlock (&q->sysfs_lock); -queue_for_each_hw_ctx (q, hctx, i) {/* * If no software queues are mapped to this hardware queue,
block/elevator.c +5 -9
@@ -980,23 +980,19 @@ int elevator_init_mq(struct request_queue *q)if (q->nr_hw_queues !=1 )return 0 ; -/* -* q->sysfs_lock must be held to provide mutual exclusion between -* elevator_switch() and here. -*/ -mutex_lock (&q->sysfs_lock); +WARN_ON_ONCE (test_bit (QUEUE_FLAG_REGISTERED , &q->queue_flags)); +if (unlikely (q->elevator)) - goto out_unlock; + goto out; e =elevator_get (q,"mq-deadline" , false);if (!e) - goto out_unlock; + goto out; err =blk_mq_init_sched (q, e);if (err)elevator_put (e); -out_unlock: -mutex_unlock (&q->sysfs_lock); +out:return err; }
block/genhd.c +6 -4
@@ -652,10 +652,12 @@ static void register_disk(struct device *parent, struct gendisk *disk)kobject_uevent (&part_to_dev (part)->kobj,KOBJ_ADD );disk_part_iter_exit (&piter); - err =sysfs_create_link (&ddev->kobj, - &disk->queue->backing_dev_info->dev->kobj, -"bdi" ); -WARN_ON (err); +if (disk->queue->backing_dev_info->dev) { + err =sysfs_create_link (&ddev->kobj, + &disk->queue->backing_dev_info->dev->kobj, +"bdi" ); +WARN_ON (err); + } }/**
drivers/crypto/chelsio/chtls/chtls_cm.c +3 -4
@@ -1051,11 +1051,9 @@ static struct sock *chtls_recv_sock(struct sock *lsk, tcph = (struct tcphdr *)(iph +1 ); n =dst_neigh_lookup (dst, &iph->saddr);if (!n || !n->dev) - goto free_sk; + goto free_dst; ndev = n->dev; -if (!ndev) - goto free_dst;if (is_vlan_dev (ndev)) ndev =vlan_dev_real_dev (ndev);
@@ -1117,7 +1115,8 @@ static struct sock *chtls_recv_sock(struct sock *lsk, free_csk:chtls_sock_release (&csk->kref); free_dst: -neigh_release (n); +if (n) +neigh_release (n);dst_release (dst); free_sk:inet_csk_prepare_forced_close (newsk);
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +3 -0
@@ -520,7 +520,10 @@ static ssize_t iwl_dbgfs_os_device_timediff_read(struct file *file,const size_t bufsz =sizeof (buf);int pos =0 ; +mutex_lock (&mvm->mutex);iwl_mvm_get_sync_time (mvm, &curr_gp2, &curr_os); +mutex_unlock (&mvm->mutex); +do_div (curr_os,NSEC_PER_USEC ); diff = curr_os - curr_gp2; pos +=scnprintf (buf + pos, bufsz - pos,"diff=%lld\n" , diff);
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +2 -1
@@ -1192,6 +1192,7 @@ static void iwl_mvm_reprobe_wk(struct work_struct *wk) reprobe = container_of(wk, struct iwl_mvm_reprobe, work);if (device_reprobe (reprobe->dev))dev_err (reprobe->dev,"reprobe failed!\n" ); +put_device (reprobe->dev);kfree (reprobe);module_put (THIS_MODULE ); }
@@ -1242,7 +1243,7 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)module_put (THIS_MODULE );return ; } - reprobe->dev = mvm->trans->dev; + reprobe->dev =get_device (mvm->trans->dev);INIT_WORK (&reprobe->work, iwl_mvm_reprobe_wk);schedule_work (&reprobe->work); } else if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR &&
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +9 -2
@@ -159,8 +159,10 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,/* Allocate IML */ iml_img =dma_alloc_coherent (trans->dev, trans->iml_len, &trans_pcie->iml_dma_addr,GFP_KERNEL ); -if (!iml_img) -return -ENOMEM ; +if (!iml_img) { + ret = -ENOMEM ; + goto err_free_ctxt_info; + }memcpy (iml_img, trans->iml, trans->iml_len);
@@ -177,6 +179,11 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,return 0 ; +err_free_ctxt_info: +dma_free_coherent (trans->dev,sizeof (*trans_pcie->ctxt_info_gen3), + trans_pcie->ctxt_info_gen3, + trans_pcie->ctxt_info_dma_addr); + trans_pcie->ctxt_info_gen3 =NULL ; err_free_prph_info: dma_free_coherent(trans->dev, sizeof(*prph_info),
drivers/net/wireless/intel/iwlwifi/pcie/tx.c +5 -0
@@ -631,6 +631,11 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id)struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);struct iwl_txq *txq = trans_pcie->txq[txq_id]; +if (!txq) { +IWL_ERR (trans,"Trying to free a queue that wasn't allocated?\n" ); +return ; + } +spin_lock_bh (&txq->lock);while (txq->write_ptr != txq->read_ptr) { IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n",
drivers/regulator/core.c +60 -24
151 lines not on this page · raw message
drivers/remoteproc/qcom_q6v5_pil.c +8 -3
@@ -340,6 +340,12 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw) {struct q6v5 *qproc = rproc->priv; +/* MBA is restricted to a maximum size of 1M */ +if (fw->size > qproc->mba_size || fw->size >SZ_1M ) { +dev_err (qproc->dev,"MBA firmware load failed\n" ); +return -EINVAL ; + } +memcpy (qproc->mba_region, fw->data, fw->size);return 0 ;
@@ -739,14 +745,13 @@ static int q6v5_mpss_load(struct q6v5 *qproc)if (phdr->p_filesz) {snprintf (seg_name,sizeof (seg_name),"modem.b%02d" , i); - ret =request_firmware (&seg_fw, seg_name, qproc->dev); + ret =request_firmware_into_buf (&seg_fw, seg_name, qproc->dev, + ptr, phdr->p_filesz);if (ret) {dev_err (qproc->dev,"failed to load %s\n" , seg_name); goto release_firmware; } -memcpy (ptr, seg_fw->data, seg_fw->size); -release_firmware (seg_fw); }
fs/fs-writeback.c +1 -1
@@ -1986,7 +1986,7 @@ void wb_workfn(struct work_struct *work) struct bdi_writeback, dwork);long pages_written; -set_worker_desc ("flush-%s" ,dev_name (wb->bdi->dev)); +set_worker_desc ("flush-%s" ,bdi_dev_name (wb->bdi)); current->flags |=PF_SWAPWRITE ; if (likely(!current_is_workqueue_rescuer() ||
fs/nfs/pnfs.c +7 -1
@@ -2301,7 +2301,13 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)* We got an entirely new state ID. Mark all segments for the * inode invalid, and retry the layoutget */ -pnfs_mark_layout_stateid_invalid (lo, &free_me); +struct pnfs_layout_range range = { + .iomode =IOMODE_ANY , + .length =NFS4_MAX_UINT64 , + }; +pnfs_set_plh_return_info (lo,IOMODE_ANY ,0 ); +pnfs_mark_matching_lsegs_return (lo, &lo->plh_return_segs, + &range,0 ); goto out_forget; }
fs/squashfs/export.c +33 -8
72 lines not on this page · raw message
fs/squashfs/id.c +32 -8
@@ -48,10 +48,15 @@ int squashfs_get_id(struct super_block *sb, unsigned int index,struct squashfs_sb_info *msblk = sb->s_fs_info;int block =SQUASHFS_ID_BLOCK (index);int offset =SQUASHFS_ID_BLOCK_OFFSET (index); -u64 start_block =le64_to_cpu (msblk->id_table[block]); +u64 start_block;__le32 disk_id;int err; +if (index >= msblk->ids) +return -EINVAL ; + + start_block =le64_to_cpu (msblk->id_table[block]); + err =squashfs_read_metadata (sb, &disk_id, &start_block, &offset,sizeof (disk_id));if (err <0 )
@@ -69,7 +74,10 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb, u64 id_table_start, u64 next_table, unsigned short no_ids) { unsigned int length = SQUASHFS_ID_BLOCK_BYTES(no_ids); +unsigned int indexes =SQUASHFS_ID_BLOCKS (no_ids); +int n;__le64 *table; +u64 start, end;TRACE ("In read_id_index_table, length %d\n" , length);
@@ -80,20 +88,36 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb,return ERR_PTR (-EINVAL );/* -* length bytes should not extend into the next table - this check -* also traps instances where id_table_start is incorrectly larger -* than the next table start +* The computed size of the index table (length bytes) should exactly +* match the table start and end points */ -if (id_table_start + length > next_table) +if (length != (next_table - id_table_start))return ERR_PTR (-EINVAL ); table =squashfs_read_table (sb, id_table_start, length); +if (IS_ERR (table)) +return table;/* -* table[0] points to the first id lookup table metadata block, this -* should be less than id_table_start +* table[0], table[1], ... table[indexes - 1] store the locations +* of the compressed id blocks. Each entry should be less than +* the next (i.e. table[0] < table[1]), and the difference between them +* should be SQUASHFS_METADATA_SIZE or less. table[indexes - 1] +* should be less than id_table_start, and again the difference +* should be SQUASHFS_METADATA_SIZE or less */ -if (!IS_ERR (table) &&le64_to_cpu (table[0 ]) >= id_table_start) { +for (n =0 ; n < (indexes -1 ); n++) { + start =le64_to_cpu (table[n]); + end =le64_to_cpu (table[n +1 ]); + +if (start >= end || (end - start) >SQUASHFS_METADATA_SIZE ) { +kfree (table); +return ERR_PTR (-EINVAL ); + } + } + + start =le64_to_cpu (table[indexes -1 ]); +if (start >= id_table_start || (id_table_start - start) >SQUASHFS_METADATA_SIZE ) {kfree (table);return ERR_PTR (-EINVAL ); }
fs/squashfs/squashfs_fs_sb.h +1 -0
@@ -77,5 +77,6 @@ struct squashfs_sb_info {unsigned int inodes;unsigned int fragments;int xattr_ids; + unsigned int ids; };#endif
fs/squashfs/super.c +3 -3
@@ -176,6 +176,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent) msblk->directory_table =le64_to_cpu (sblk->directory_table_start); msblk->inodes =le32_to_cpu (sblk->inodes); msblk->fragments =le32_to_cpu (sblk->fragments); + msblk->ids =le16_to_cpu (sblk->no_ids); flags =le16_to_cpu (sblk->flags);TRACE ("Found valid superblock on %pg\n" , sb->s_bdev);
@@ -187,7 +188,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)TRACE ("Block size %d\n" , msblk->block_size);TRACE ("Number of inodes %d\n" , msblk->inodes);TRACE ("Number of fragments %d\n" , msblk->fragments); -TRACE ("Number of ids %d\n" ,le16_to_cpu (sblk->no_ids)); +TRACE ("Number of ids %d\n" , msblk->ids);TRACE ("sblk->inode_table_start %llx\n" , msblk->inode_table);TRACE ("sblk->directory_table_start %llx\n" , msblk->directory_table); TRACE("sblk->fragment_table_start %llx\n",
@@ -244,8 +245,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent) allocate_id_index_table:/* Allocate and read id index table */ msblk->id_table =squashfs_read_id_index_table (sb, -le64_to_cpu (sblk->id_table_start), next_table, -le16_to_cpu (sblk->no_ids)); +le64_to_cpu (sblk->id_table_start), next_table, msblk->ids);if (IS_ERR (msblk->id_table)) {ERROR ("unable to read id index table\n" ); err =PTR_ERR (msblk->id_table);
fs/squashfs/xattr.h +9 -1
@@ -30,8 +30,16 @@ extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *,static inline __le64 *squashfs_read_xattr_id_table (struct super_block *sb,u64 start,u64 *xattr_table_start,int *xattr_ids) { +struct squashfs_xattr_id_table *id_table; + + id_table =squashfs_read_table (sb, start,sizeof (*id_table)); +if (IS_ERR (id_table)) +return (__le64 *) id_table; + + *xattr_table_start =le64_to_cpu (id_table->xattr_table_start); +kfree (id_table); +ERROR ("Xattrs in filesystem, these will be ignored\n" ); - *xattr_table_start = start;return ERR_PTR (-ENOTSUPP ); }
fs/squashfs/xattr_id.c +57 -9
93 lines not on this page · raw message
include/linux/backing-dev.h +10 -0
@@ -13,6 +13,7 @@#include <linux/fs.h> #include <linux/sched.h> #include <linux/blkdev.h> +#include <linux/device.h> #include <linux/writeback.h> #include <linux/blk-cgroup.h> #include <linux/backing-dev-defs.h>
@@ -498,4 +499,13 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) (1 << WB_async_congested)); } +extern const char *bdi_unknown_name; + +static inline const char *bdi_dev_name (struct backing_dev_info *bdi) +{ +if (!bdi || !bdi->dev) +return bdi_unknown_name; +return dev_name (bdi->dev); +} +#endif /* _LINUX_BACKING_DEV_H */
include/linux/kprobes.h +1 -1
@@ -245,7 +245,7 @@ extern void kprobes_inc_nmissed_count(struct kprobe *p);extern bool arch_within_kprobe_blacklist (unsigned long addr);extern int arch_populate_kprobe_blacklist (void );extern bool arch_kprobe_on_func_entry (unsigned long offset); -extern bool kprobe_on_func_entry (kprobe_opcode_t *addr,const char *sym,unsigned long offset); +extern int kprobe_on_func_entry (kprobe_opcode_t *addr,const char *sym,unsigned long offset);extern bool within_kprobe_blacklist (unsigned long addr);extern int kprobe_add_ksym_blacklist (unsigned long entry);
include/linux/string.h +4 -0
@@ -31,6 +31,10 @@ size_t strlcpy(char *, const char *, size_t);#ifndef __HAVE_ARCH_STRSCPYssize_t strscpy (char *,const char *,size_t );#endif + +/* Wraps calls to strscpy()/memset(), no arch specific code required */ +ssize_t strscpy_pad (char *dest,const char *src,size_t count); +#ifndef __HAVE_ARCH_STRCATextern char *strcat (char *,const char *);#endif
include/linux/sunrpc/xdr.h +1 -2
@@ -26,8 +26,7 @@ struct rpc_rqst;#define XDR_QUADLEN (l) (((l) + 3) >> 2)/* -* Generic opaque `network object.' At the kernel level, this type -* is used only by lockd. +* Generic opaque `network object.' */ #define XDR_MAX_NETOBJ 1024struct xdr_netobj {
include/trace/events/writeback.h +17 -18
@@ -65,8 +65,9 @@ TRACE_EVENT(writeback_dirty_page, ),TP_fast_assign ( -strncpy (__entry->name, - mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)", 32); +strscpy_pad (__entry->name, +bdi_dev_name (mapping ?inode_to_bdi (mapping->host) : + NULL), 32); __entry->ino = mapping ? mapping->host->i_ino :0 ; __entry->index = page->index; ),
@@ -95,8 +96,7 @@ DECLARE_EVENT_CLASS(writeback_dirty_inode_template,struct backing_dev_info *bdi =inode_to_bdi (inode);/* may be called for files on pseudo FSes w/ unregistered bdi */ -strncpy (__entry->name, - bdi->dev ?dev_name (bdi->dev) :"(unknown)" ,32 ); +strscpy_pad (__entry->name,bdi_dev_name (bdi),32 ); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->flags = flags;
@@ -175,8 +175,8 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, ),TP_fast_assign ( -strncpy (__entry->name, - dev_name(inode_to_bdi(inode)->dev), 32); +strscpy_pad (__entry->name, + bdi_dev_name(inode_to_bdi(inode)), 32); __entry->ino = inode->i_ino; __entry->sync_mode = wbc->sync_mode; __entry->cgroup_ino =__trace_wbc_assign_cgroup (wbc);
@@ -219,8 +219,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, __field(unsigned int, cgroup_ino) ),TP_fast_assign ( - strncpy(__entry->name, - wb->bdi->dev ? dev_name(wb->bdi->dev) : "(unknown)", 32); + strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32); __entry->nr_pages = work->nr_pages; __entry->sb_dev = work->sb ? work->sb->s_dev :0 ; __entry->sync_mode = work->sync_mode;
@@ -273,7 +272,7 @@ DECLARE_EVENT_CLASS(writeback_class, __field(unsigned int, cgroup_ino) ),TP_fast_assign ( - strncpy(__entry->name, dev_name(wb->bdi->dev), 32); + strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32); __entry->cgroup_ino =__trace_wb_assign_cgroup (wb); ), TP_printk("bdi %s: cgroup_ino=%u",
@@ -295,7 +294,7 @@ TRACE_EVENT(writeback_bdi_register,__array (char, name,32 ) ),TP_fast_assign ( - strncpy(__entry->name, dev_name(bdi->dev), 32); + strscpy_pad(__entry->name, bdi_dev_name(bdi), 32); ),TP_printk ("bdi %s" , __entry->name
@@ -320,7 +319,7 @@ DECLARE_EVENT_CLASS(wbc_class, ), TP_fast_assign( - strncpy(__entry->name, dev_name(bdi->dev), 32); + strscpy_pad(__entry->name, bdi_dev_name(bdi), 32); __entry->nr_to_write = wbc->nr_to_write; __entry->pages_skipped = wbc->pages_skipped; __entry->sync_mode = wbc->sync_mode;
@@ -371,7 +370,7 @@ TRACE_EVENT(writeback_queue_io, __field(unsigned int, cgroup_ino) ),TP_fast_assign ( - strncpy(__entry->name, dev_name(wb->bdi->dev), 32); + strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32); __entry->older = dirtied_before; __entry->age = (jiffies - dirtied_before) *1000 /HZ ; __entry->moved = moved;
@@ -456,7 +455,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, ),TP_fast_assign ( - strlcpy(__entry->bdi, dev_name(wb->bdi->dev), 32); + strscpy_pad(__entry->bdi, bdi_dev_name(wb->bdi), 32); __entry->write_bw =KBps (wb->write_bandwidth); __entry->avg_write_bw =KBps (wb->avg_write_bandwidth); __entry->dirty_rate =KBps (dirty_rate);
@@ -521,7 +520,7 @@ TRACE_EVENT(balance_dirty_pages, TP_fast_assign( unsigned long freerun = (thresh + bg_thresh) / 2; -strlcpy (__entry->bdi,dev_name (wb->bdi->dev),32 ); +strscpy_pad (__entry->bdi,bdi_dev_name (wb->bdi),32 ); __entry->limit = global_wb_domain.dirty_limit; __entry->setpoint = (global_wb_domain.dirty_limit +
@@ -581,8 +580,8 @@ TRACE_EVENT(writeback_sb_inodes_requeue, ),TP_fast_assign ( -strncpy (__entry->name, - dev_name(inode_to_bdi(inode)->dev), 32); +strscpy_pad (__entry->name, + bdi_dev_name(inode_to_bdi(inode)), 32); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->dirtied_when = inode->dirtied_when;
@@ -655,8 +654,8 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, ),TP_fast_assign ( -strncpy (__entry->name, - dev_name(inode_to_bdi(inode)->dev), 32); +strscpy_pad (__entry->name, + bdi_dev_name(inode_to_bdi(inode)), 32); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->dirtied_when = inode->dirtied_when;
init/init_task.c +2 -1
@@ -168,7 +168,8 @@ struct task_struct init_task .lockdep_recursion = 0,#endif #ifdef CONFIG_FUNCTION_GRAPH_TRACER - .ret_stack = NULL, + .ret_stack = NULL, + .tracing_graph_pause = ATOMIC_INIT(0),#endif #if defined(CONFIG_TRACING ) && defined(CONFIG_PREEMPT ) .trace_recursion = 0,
kernel/kprobes.c +25 -9
@@ -1921,29 +1921,45 @@ bool __weak arch_kprobe_on_func_entry(unsigned long offset)return !offset; } -bool kprobe_on_func_entry (kprobe_opcode_t *addr,const char *sym,unsigned long offset) +/** +* kprobe_on_func_entry() -- check whether given address is function entry +* @addr: Target address +* @sym: Target symbol name +* @offset: The offset from the symbol or the address +* +* This checks whether the given @addr+@offset or @sym+@offset is on the +* function entry address or not. +* This returns 0 if it is the function entry, or -EINVAL if it is not. +* And also it returns -ENOENT if it fails the symbol or address lookup. +* Caller must pass @addr or @sym (either one must be NULL), or this +* returns -EINVAL. +*/ +int kprobe_on_func_entry (kprobe_opcode_t *addr,const char *sym,unsigned long offset) {kprobe_opcode_t *kp_addr =_kprobe_addr (addr, sym, offset);if (IS_ERR (kp_addr)) -return false; +return PTR_ERR (kp_addr); -if (!kallsyms_lookup_size_offset ((unsigned long )kp_addr,NULL , &offset) || - !arch_kprobe_on_func_entry (offset)) -return false; +if (!kallsyms_lookup_size_offset ((unsigned long )kp_addr,NULL , &offset)) +return -ENOENT ; -return true; +if (!arch_kprobe_on_func_entry (offset)) +return -EINVAL ; + +return 0 ; }int register_kretprobe (struct kretprobe *rp) { -int ret =0 ; +int ret;struct kretprobe_instance *inst;int i;void *addr; -if (!kprobe_on_func_entry (rp->kp.addr, rp->kp.symbol_name, rp->kp.offset)) -return -EINVAL ; + ret =kprobe_on_func_entry (rp->kp.addr, rp->kp.symbol_name, rp->kp.offset); +if (ret) +return ret;/* If only rp->kp.addr is specified, check reregistering kprobes */ if (rp->kp.addr &&check_kprobe_rereg (&rp->kp))
kernel/trace/ftrace.c +0 -2
@@ -6875,7 +6875,6 @@ static int alloc_retstack_tasklist(struct ftrace_ret_stack **ret_stack_list) }if (t->ret_stack ==NULL ) { -atomic_set (&t->tracing_graph_pause,0 );atomic_set (&t->trace_overrun,0 ); t->curr_ret_stack =-1 ; t->curr_ret_depth =-1 ;
@@ -7088,7 +7087,6 @@ static DEFINE_PER_CPU(struct ftrace_ret_stack *, idle_ret_stack);static void graph_init_task (struct task_struct *t,struct ftrace_ret_stack *ret_stack) { -atomic_set (&t->tracing_graph_pause,0 );atomic_set (&t->trace_overrun,0 ); t->ftrace_timestamp =0 ;/* make curr_ret_stack visible before we add the ret_stack */
kernel/trace/trace_kprobe.c +2 -2
@@ -112,9 +112,9 @@ bool trace_kprobe_on_func_entry(struct trace_event_call *call) {struct trace_kprobe *tk = (struct trace_kprobe *)call->data; -return kprobe_on_func_entry (tk->rp.kp.addr, +return (kprobe_on_func_entry (tk->rp.kp.addr, tk->rp.kp.addr ?NULL : tk->rp.kp.symbol_name, - tk->rp.kp.addr ?0 : tk->rp.kp.offset); + tk->rp.kp.addr ?0 : tk->rp.kp.offset) ==0 ); }bool trace_kprobe_error_injectable (struct trace_event_call *call)
lib/string.c +40 -7
65 lines not on this page · raw message
mm/backing-dev.c +1 -0
@@ -19,6 +19,7 @@ struct backing_dev_info noop_backing_dev_info = {EXPORT_SYMBOL_GPL (noop_backing_dev_info);static struct class *bdi_class; +const char *bdi_unknown_name ="(unknown)" ;/* * bdi_lock protects updates to bdi_list. bdi_list has RCU reader side
net/key/af_key.c +3 -3
@@ -2908,7 +2908,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t)break ;if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg) && aalg->available) +if (aalg_tmpl_set (t, aalg)) sz +=sizeof (struct sadb_comb ); }return sz +sizeof (struct sadb_prop );
@@ -2926,7 +2926,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!ealg->pfkey_supported)continue ; -if (!(ealg_tmpl_set (t, ealg) && ealg->available)) +if (!(ealg_tmpl_set (t, ealg)))continue ;for (k =1 ; ; k++) {
@@ -2937,7 +2937,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg) && aalg->available) +if (aalg_tmpl_set (t, aalg)) sz +=sizeof (struct sadb_comb ); } }
net/sunrpc/auth_gss/auth_gss.c +1 -29
@@ -53,6 +53,7 @@#include <linux/uaccess.h> #include <linux/hashtable.h> +#include "auth_gss_internal.h" #include "../netns.h" static const struct rpc_authops authgss_ops;
@@ -147,35 +148,6 @@ gss_cred_set_ctx(struct rpc_cred *cred, struct gss_cl_ctx *ctx)clear_bit (RPCAUTH_CRED_NEW , &cred->cr_flags); } -static const void * -simple_get_bytes (const void *p,const void *end,void *res,size_t len) -{ -const void *q = (const void *)((const char *)p + len); -if (unlikely (q > end || q < p)) -return ERR_PTR (-EFAULT ); -memcpy (res, p, len); -return q; -} - -static inline const void * -simple_get_netobj (const void *p,const void *end,struct xdr_netobj *dest) -{ -const void *q; -unsigned int len; - - p =simple_get_bytes (p, end, &len,sizeof (len)); -if (IS_ERR (p)) -return p; - q = (const void *)((const char *)p + len); -if (unlikely (q > end || q < p)) -return ERR_PTR (-EFAULT ); - dest->data =kmemdup (p, len,GFP_NOFS ); -if (unlikely (dest->data ==NULL )) -return ERR_PTR (-ENOMEM ); - dest->len = len; -return q; -} -static struct gss_cl_ctx *gss_cred_get_ctx (struct rpc_cred *cred) {
net/sunrpc/auth_gss/auth_gss_internal.h new file +45 -0
45 lines not on this page · raw message
net/sunrpc/auth_gss/gss_krb5_mech.c +2 -29
@@ -46,6 +46,8 @@#include <linux/sunrpc/xdr.h> #include <linux/sunrpc/gss_krb5_enctypes.h> +#include "auth_gss_internal.h" +#if IS_ENABLED (CONFIG_SUNRPC_DEBUG )# define RPCDBG_FACILITY RPCDBG_AUTH#endif
@@ -187,35 +189,6 @@ get_gss_krb5_enctype(int etype)return NULL ; } -static const void * -simple_get_bytes (const void *p,const void *end,void *res,int len) -{ -const void *q = (const void *)((const char *)p + len); -if (unlikely (q > end || q < p)) -return ERR_PTR (-EFAULT ); -memcpy (res, p, len); -return q; -} - -static const void * -simple_get_netobj (const void *p,const void *end,struct xdr_netobj *res) -{ -const void *q; -unsigned int len; - - p =simple_get_bytes (p, end, &len,sizeof (len)); -if (IS_ERR (p)) -return p; - q = (const void *)((const char *)p + len); -if (unlikely (q > end || q < p)) -return ERR_PTR (-EFAULT ); - res->data =kmemdup (p, len,GFP_NOFS ); -if (unlikely (res->data ==NULL )) -return ERR_PTR (-ENOMEM ); - res->len = len; -return q; -} -static inline const void *get_key (const void *p,const void *end,struct krb5_ctx *ctx,struct crypto_skcipher **res)