Linux 5.13.7
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 13 -SUBLEVEL = 6 +SUBLEVEL = 7 EXTRAVERSION = NAME = Opossums on Parade
arch/arm/boot/dts/versatile-ab.dts +2 -3
@@ -195,16 +195,15 @@ amba { #size-cells = <1>; ranges; - vic: intc@10140000 { + vic: interrupt-controller@10140000 { compatible = "arm,versatile-vic"; interrupt-controller; #interrupt-cells = <1>; reg = <0x10140000 0x1000>; - clear-mask = <0xffffffff>; valid-mask = <0xffffffff>; }; - sic: intc@10003000 { + sic: interrupt-controller@10003000 { compatible = "arm,versatile-sic"; interrupt-controller; #interrupt-cells = <1>;
arch/arm/boot/dts/versatile-pb.dts +1 -1
@@ -7,7 +7,7 @@ / { amba { /* The Versatile PB is using more SIC IRQ lines than the AB */ - sic: intc@10003000 { + sic: interrupt-controller@10003000 { clear-mask = <0xffffffff>; /* * Valid interrupt lines mask according to
drivers/firmware/arm_scmi/driver.c +7 -5
@@ -47,7 +47,6 @@ enum scmi_error_codes {SCMI_ERR_GENERIC =-8 ,/* Generic Error */ SCMI_ERR_HARDWARE =-9 ,/* Hardware Error */ SCMI_ERR_PROTOCOL = -10,/* Protocol Error */ - SCMI_ERR_MAX };/* List of all SCMI devices active in system */
@@ -166,8 +165,10 @@ static const int scmi_linux_errmap[] = {static inline int scmi_to_linux_errno (int errno) { -if (errno <SCMI_SUCCESS && errno >SCMI_ERR_MAX ) -return scmi_linux_errmap[-errno]; +int err_idx = -errno; + +if (err_idx >=SCMI_SUCCESS && err_idx <ARRAY_SIZE (scmi_linux_errmap)) +return scmi_linux_errmap[err_idx];return -EIO ; }
@@ -1029,8 +1030,9 @@ static int __scmi_xfer_info_init(struct scmi_info *sinfo,const struct scmi_desc *desc = sinfo->desc;/* Pre-allocated messages, no more than what hdr.seq can support */ -if (WARN_ON (desc->max_msg >=MSG_TOKEN_MAX )) { -dev_err (dev,"Maximum message of %d exceeds supported %ld\n" , +if (WARN_ON (!desc->max_msg || desc->max_msg >MSG_TOKEN_MAX )) { +dev_err (dev, +"Invalid maximum messages %d, not in range [1 - %lu]\n" , desc->max_msg,MSG_TOKEN_MAX );return -EINVAL ; }
drivers/gpu/drm/ttm/ttm_range_manager.c +3 -0
@@ -146,6 +146,9 @@ int ttm_range_man_fini(struct ttm_device *bdev,struct drm_mm *mm = &rman->mm;int ret; +if (!man) +return 0 ; +ttm_resource_manager_set_used (man, false); ret =ttm_resource_manager_evict_all (bdev, man);
drivers/nvme/host/pci.c +58 -8
131 lines not on this page · raw message
fs/cifs/smb2ops.c +2 -2
@@ -555,8 +555,8 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, p = buf;while (bytes_left >=sizeof (*p)) { info->speed =le64_to_cpu (p->LinkSpeed); - info->rdma_capable =le32_to_cpu (p->Capability &RDMA_CAPABLE ); - info->rss_capable =le32_to_cpu (p->Capability &RSS_CAPABLE ); + info->rdma_capable =le32_to_cpu (p->Capability &RDMA_CAPABLE ) ?1 :0 ; + info->rss_capable =le32_to_cpu (p->Capability &RSS_CAPABLE ) ?1 :0 ;cifs_dbg (FYI ,"%s: adding iface %zu\n" , __func__, *iface_count);cifs_dbg (FYI ,"%s: speed %zu bps\n" , __func__, info->speed);
fs/hfs/bfind.c +13 -1
@@ -25,7 +25,19 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) fd->key = ptr + tree->max_key_len +2 ;hfs_dbg (BNODE_REFS ,"find_init: %d (%p)\n" , tree->cnid,__builtin_return_address (0 )); -mutex_lock (&tree->tree_lock); +switch (tree->cnid) { +case HFS_CAT_CNID : +mutex_lock_nested (&tree->tree_lock,CATALOG_BTREE_MUTEX ); +break ; +case HFS_EXT_CNID : +mutex_lock_nested (&tree->tree_lock,EXTENTS_BTREE_MUTEX ); +break ; +case HFS_ATTR_CNID : +mutex_lock_nested (&tree->tree_lock,ATTR_BTREE_MUTEX ); +break ; +default : +return -EINVAL ; + }return 0 ; }
fs/hfs/bnode.c +20 -5
@@ -15,16 +15,31 @@#include "btree.h" -void hfs_bnode_read (struct hfs_bnode *node,void *buf, -int off,int len) +void hfs_bnode_read (struct hfs_bnode *node,void *buf,int off,int len) {struct page *page; +int pagenum; +int bytes_read; +int bytes_to_read; +void *vaddr; off += node->page_offset; - page = node->page[0 ]; + pagenum = off >>PAGE_SHIFT ; + off &= ~PAGE_MASK ;/* compute page offset for the first page */ -memcpy (buf,kmap (page) + off, len); -kunmap (page); +for (bytes_read =0 ; bytes_read < len; bytes_read += bytes_to_read) { +if (pagenum >= node->tree->pages_per_bnode) +break ; + page = node->page[pagenum]; + bytes_to_read =min_t (int, len - bytes_read,PAGE_SIZE - off); + + vaddr =kmap_atomic (page); +memcpy (buf + bytes_read, vaddr + off, bytes_to_read); +kunmap_atomic (vaddr); + + pagenum++; + off =0 ;/* page offset only applies to the first page */ + } }u16 hfs_bnode_read_u16 (struct hfs_bnode *node,int off)
fs/hfs/btree.h +7 -0
@@ -13,6 +13,13 @@ typedef int (*btree_keycmp)(const btree_key *, const btree_key *);#define NODE_HASH_SIZE 256 +/* B-tree mutex nested subclasses */ +enum hfs_btree_mutex_classes { +CATALOG_BTREE_MUTEX , +EXTENTS_BTREE_MUTEX , +ATTR_BTREE_MUTEX , +}; +/* A HFS BTree held in memory */ struct hfs_btree {struct super_block *sb;
fs/hfs/super.c +5 -5
@@ -420,14 +420,12 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)if (!res) {if (fd.entrylength >sizeof (rec) || fd.entrylength <0 ) { res = -EIO ; - goto bail; + goto bail_hfs_find; }hfs_bnode_read (fd.bnode, &rec, fd.entryoffset, fd.entrylength); } -if (res) { -hfs_find_exit (&fd); - goto bail_no_root; - } +if (res) + goto bail_hfs_find; res = -EINVAL ; root_inode =hfs_iget (sb, &fd.search_key->cat, &rec);hfs_find_exit (&fd);
@@ -443,6 +441,8 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)/* everything's okay */ return 0 ; +bail_hfs_find: +hfs_find_exit (&fd); bail_no_root:pr_err ("get root inode failed\n" ); bail:
fs/internal.h +0 -1
@@ -61,7 +61,6 @@ extern void __init chrdev_init(void);*/ extern const struct fs_context_operations legacy_fs_context_ops;extern int parse_monolithic_mount_data (struct fs_context *,void *); -extern void fc_drop_locked (struct fs_context *);extern void vfs_clean_context (struct fs_context *fc);extern int finish_clean_context (struct fs_context *fc);
fs/iomap/seek.c +9 -16
@@ -35,23 +35,20 @@ loff_t iomap_seek_hole(struct inode *inode, loff_t offset, const struct iomap_ops *ops) { loff_t size = i_size_read(inode); -loff_t length = size - offset;loff_t ret;/* Nothing to be found before or beyond the end of the file. */ if (offset <0 || offset >= size)return -ENXIO ; -while (length >0 ) { - ret =iomap_apply (inode, offset, length,IOMAP_REPORT , ops, - &offset, iomap_seek_hole_actor); +while (offset < size) { + ret =iomap_apply (inode, offset, size - offset,IOMAP_REPORT , + ops, &offset, iomap_seek_hole_actor);if (ret <0 )return ret;if (ret ==0 )break ; - offset += ret; - length -= ret; }return offset;
@@ -83,27 +80,23 @@ loff_t iomap_seek_data(struct inode *inode, loff_t offset, const struct iomap_ops *ops) { loff_t size = i_size_read(inode); -loff_t length = size - offset;loff_t ret;/* Nothing to be found before or beyond the end of the file. */ if (offset <0 || offset >= size)return -ENXIO ; -while (length >0 ) { - ret =iomap_apply (inode, offset, length,IOMAP_REPORT , ops, - &offset, iomap_seek_data_actor); +while (offset < size) { + ret =iomap_apply (inode, offset, size - offset,IOMAP_REPORT , + ops, &offset, iomap_seek_data_actor);if (ret <0 )return ret;if (ret ==0 ) -break ; - +return offset; offset += ret; - length -= ret; } -if (length <=0 ) -return -ENXIO ; -return offset; +/* We've reached the end of the file without finding data */ +return -ENXIO ; }EXPORT_SYMBOL_GPL (iomap_seek_data);
include/linux/fs_context.h +1 -0
@@ -139,6 +139,7 @@ extern int vfs_parse_fs_string(struct fs_context *fc, const char *key,extern int generic_parse_monolithic (struct fs_context *fc,void *data);extern int vfs_get_tree (struct fs_context *fc);extern void put_fs_context (struct fs_context *fc); +extern void fc_drop_locked (struct fs_context *fc);/* * sget() wrappers to be called from the ->get_tree() op.
include/net/busy_poll.h +1 -1
@@ -38,7 +38,7 @@ static inline bool net_busy_loop_on(void)static inline bool sk_can_busy_loop (const struct sock *sk) { -return sk->sk_ll_usec && !signal_pending (current); +return READ_ONCE (sk->sk_ll_usec) && !signal_pending (current); }bool sk_busy_loop_end (void *p,unsigned long start_time);
include/net/sctp/constants.h +1 -3
@@ -342,8 +342,7 @@ enum {#define SCTP_SCOPE_POLICY_MAX SCTP_SCOPE_POLICY_LINK/* Based on IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>, -* SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 198.18.0.0/24, -* 192.88.99.0/24. +* SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 192.88.99.0/24. * Also, RFC 8.4, non-unicast addresses are not considered valid SCTP * addresses. */
@@ -351,7 +350,6 @@ enum { ((htonl (INADDR_BROADCAST ) == a) || \ipv4_is_multicast (a) || \ipv4_is_zeronet (a) || \ -ipv4_is_test_198 (a) || \ipv4_is_anycast_6to4 (a))/* Flags used for the bind address copy functions. */
kernel/cgroup/cgroup-v1.c +1 -3
@@ -1225,9 +1225,7 @@ int cgroup1_get_tree(struct fs_context *fc) ret =cgroup_do_get_tree (fc);if (!ret &&percpu_ref_is_dying (&ctx->root->cgrp.self.refcnt)) { -struct super_block *sb = fc->root->d_sb; -dput (fc->root); -deactivate_locked_super (sb); +fc_drop_locked (fc); ret =1 ; }
kernel/rcu/tasks.h +2 -4
@@ -908,10 +908,9 @@ static bool trc_inspect_reader(struct task_struct *t, void *arg) in_qs =likely (!t->trc_reader_nesting); } -// Mark as checked. Because this is called from the grace-period -// kthread, also remove the task from the holdout list. +// Mark as checked so that the grace-period kthread will +// remove it from the holdout list. t->trc_reader_checked = true; -trc_del_holdout (t);if (in_qs)return true;// Already in quiescent state, done!!!
@@ -938,7 +937,6 @@ static void trc_wait_for_one_reader(struct task_struct *t,// The current task had better be in a quiescent state. if (t == current) { t->trc_reader_checked = true; -trc_del_holdout (t);WARN_ON_ONCE (t->trc_reader_nesting);return ; }
kernel/workqueue.c +13 -7
@@ -3676,15 +3676,21 @@ static void pwq_unbound_release_workfn(struct work_struct *work) unbound_release_work);struct workqueue_struct *wq = pwq->wq;struct worker_pool *pool = pwq->pool; -bool is_last; +bool is_last = false; -if (WARN_ON_ONCE (!(wq->flags &WQ_UNBOUND ))) -return ; +/* +* when @pwq is not linked, it doesn't hold any reference to the +* @wq, and @wq is invalid to access. +*/ +if (!list_empty (&pwq->pwqs_node)) { +if (WARN_ON_ONCE (!(wq->flags &WQ_UNBOUND ))) +return ; -mutex_lock (&wq->mutex); -list_del_rcu (&pwq->pwqs_node); - is_last =list_empty (&wq->pwqs); -mutex_unlock (&wq->mutex); +mutex_lock (&wq->mutex); +list_del_rcu (&pwq->pwqs_node); + is_last =list_empty (&wq->pwqs); +mutex_unlock (&wq->mutex); + }mutex_lock (&wq_pool_mutex);put_unbound_pool (pool);
net/802/garp.c +14 -0
@@ -203,6 +203,19 @@ static void garp_attr_destroy(struct garp_applicant *app, struct garp_attr *attrkfree (attr); } +static void garp_attr_destroy_all (struct garp_applicant *app) +{ +struct rb_node *node, *next; +struct garp_attr *attr; + +for (node =rb_first (&app->gid); + next = node ?rb_next (node) :NULL , node !=NULL ; + node = next) { + attr = rb_entry(node, struct garp_attr, node); +garp_attr_destroy (app, attr); + } +} +static int garp_pdu_init (struct garp_applicant *app) {struct sk_buff *skb;
@@ -609,6 +622,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *applspin_lock_bh (&app->lock);garp_gid_event (app,GARP_EVENT_TRANSMIT_PDU ); +garp_attr_destroy_all (app);garp_pdu_queue (app);spin_unlock_bh (&app->lock);
net/802/mrp.c +14 -0
@@ -292,6 +292,19 @@ static void mrp_attr_destroy(struct mrp_applicant *app, struct mrp_attr *attr)kfree (attr); } +static void mrp_attr_destroy_all (struct mrp_applicant *app) +{ +struct rb_node *node, *next; +struct mrp_attr *attr; + +for (node =rb_first (&app->mad); + next = node ?rb_next (node) :NULL , node !=NULL ; + node = next) { + attr = rb_entry(node, struct mrp_attr, node); +mrp_attr_destroy (app, attr); + } +} +static int mrp_pdu_init (struct mrp_applicant *app) {struct sk_buff *skb;
@@ -895,6 +908,7 @@ void mrp_uninit_applicant(struct net_device *dev, struct mrp_application *appl)spin_lock_bh (&app->lock);mrp_mad_event (app,MRP_EVENT_TX ); +mrp_attr_destroy_all (app);mrp_pdu_queue (app);spin_unlock_bh (&app->lock);
net/core/sock.c +1 -1
@@ -1172,7 +1172,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,if (val <0 ) ret = -EINVAL ;else - sk->sk_ll_usec = val; +WRITE_ONCE (sk->sk_ll_usec, val); }break ;case SO_PREFER_BUSY_POLL :
net/ipv6/ip6_output.c +28 -0
@@ -60,10 +60,38 @@ static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff * {struct dst_entry *dst =skb_dst (skb);struct net_device *dev = dst->dev; +unsigned int hh_len =LL_RESERVED_SPACE (dev); +int delta = hh_len -skb_headroom (skb);const struct in6_addr *nexthop;struct neighbour *neigh;int ret; +/* Be paranoid, rather than too clever. */ +if (unlikely (delta >0 ) && dev->header_ops) { +/* pskb_expand_head() might crash, if skb is shared */ +if (skb_shared (skb)) { +struct sk_buff *nskb =skb_clone (skb,GFP_ATOMIC ); + +if (likely (nskb)) { +if (skb->sk) +skb_set_owner_w (nskb, skb->sk); +consume_skb (skb); + }else { +kfree_skb (skb); + } + skb = nskb; + } +if (skb && +pskb_expand_head (skb,SKB_DATA_ALIGN (delta),0 ,GFP_ATOMIC )) { +kfree_skb (skb); + skb =NULL ; + } +if (!skb) { +IP6_INC_STATS (net,ip6_dst_idev (dst),IPSTATS_MIB_OUTDISCARDS ); +return -ENOMEM ; + } + } +if (ipv6_addr_is_multicast (&ipv6_hdr (skb)->daddr)) {struct inet6_dev *idev =ip6_dst_idev (skb_dst (skb));
net/sctp/protocol.c +2 -1
@@ -398,7 +398,8 @@ static enum sctp_scope sctp_v4_scope(union sctp_addr *addr) retval =SCTP_SCOPE_LINK ; }else if (ipv4_is_private_10 (addr->v4.sin_addr.s_addr) ||ipv4_is_private_172 (addr->v4.sin_addr.s_addr) || -ipv4_is_private_192 (addr->v4.sin_addr.s_addr)) { +ipv4_is_private_192 (addr->v4.sin_addr.s_addr) || +ipv4_is_test_198 (addr->v4.sin_addr.s_addr)) { retval =SCTP_SCOPE_PRIVATE ; }else { retval =SCTP_SCOPE_GLOBAL ;
net/unix/af_unix.c +49 -2
69 lines not on this page · raw message
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.13.7 kernel.
All users of the 5.13 kernel series must upgrade.
The updated 5.13.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.13.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/arm/boot/dts/versatile-ab.dts | 5 -- arch/arm/boot/dts/versatile-pb.dts | 2 drivers/firmware/arm_scmi/driver.c | 12 +++-- drivers/gpu/drm/ttm/ttm_range_manager.c | 3 + drivers/nvme/host/pci.c | 66 ++++++++++++++++++++++++++++---- fs/cifs/smb2ops.c | 4 - fs/hfs/bfind.c | 14 ++++++ fs/hfs/bnode.c | 25 +++++++++--- fs/hfs/btree.h | 7 +++ fs/hfs/super.c | 10 ++-- fs/internal.h | 1 fs/iomap/seek.c | 25 ++++-------- include/linux/fs_context.h | 1 include/net/busy_poll.h | 2 include/net/sctp/constants.h | 4 - kernel/cgroup/cgroup-v1.c | 4 - kernel/rcu/tasks.h | 6 -- kernel/workqueue.c | 20 ++++++--- net/802/garp.c | 14 ++++++ net/802/mrp.c | 14 ++++++ net/core/sock.c | 2 net/ipv6/ip6_output.c | 28 +++++++++++++ net/sctp/protocol.c | 3 - net/unix/af_unix.c | 51 +++++++++++++++++++++++- 25 files changed, 255 insertions(+), 70 deletions(-)
Casey Chen (1):
nvme-pci: fix multiple races in nvme_setup_io_queues
Christoph Hellwig (2):
iomap: remove the length variable in iomap_seek_data
iomap: remove the length variable in iomap_seek_hole
Cristian Marussi (1):
firmware: arm_scmi: Fix range check for the maximum number of pending messages
Desmond Cheong Zhi Xi (3):
hfs: add missing clean-up in hfs_fill_super
hfs: fix high memory mapping in hfs_bnode_read
hfs: add lock nesting notation to hfs_find_init
Eric Dumazet (1):
net: annotate data race around sk_ll_usec
Greg Kroah-Hartman (1):
Linux 5.13.7
Hyunchul Lee (1):
cifs: fix the out of range assignment to bit fields in parse_server_interfaces
Miklos Szeredi (1):
af_unix: fix garbage collect vs MSG_PEEK
Paul E. McKenney (2):
rcu-tasks: Don't delete holdouts within trc_inspect_reader()
rcu-tasks: Don't delete holdouts within trc_wait_for_one_reader()
Paul Gortmaker (1):
cgroup1: fix leaked context root causing sporadic NULL deref in LTP
Sudeep Holla (2):
firmware: arm_scmi: Fix possible scmi_linux_errmap buffer overflow
ARM: dts: versatile: Fix up interrupt controller node names
Vasily Averin (2):
ipv6: allocate enough headroom in ip6_finish_output2()
ipv6: ip6_finish_output2: set sk into newly allocated nskb
Xin Long (1):
sctp: move 198 addresses from unusable to private scope
Yang Yingliang (3):
workqueue: fix UAF in pwq_unbound_release_workfn() net/802/mrp: fix memleak in mrp_request_join() net/802/garp: fix memleak in garp_request_join()
Zheyu Ma (1):
drm/ttm: add a check against null pointer dereference