Linux 4.4.278
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.4.278 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.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 arch/arm/kernel/signal.c | 14 +- arch/x86/include/asm/proto.h | 2 drivers/net/can/usb/ems_usb.c | 14 ++ drivers/net/can/usb/esd_usb2.c | 16 ++ drivers/net/can/usb/usb_8dev.c | 15 ++ drivers/net/ethernet/dec/tulip/winbond-840.c | 7 - drivers/net/ethernet/mellanox/mlx4/main.c | 1 drivers/net/ethernet/sis/sis900.c | 7 - drivers/net/ethernet/sun/niu.c | 3 fs/hfs/bfind.c | 14 ++ fs/hfs/bnode.c | 25 +++- fs/hfs/btree.h | 7 + fs/hfs/super.c | 10 - fs/ocfs2/file.c | 103 ++++++++++------- include/linux/string.h | 30 +++++ include/net/af_unix.h | 1 include/net/llc_pdu.h | 31 +++-- include/net/sctp/constants.h | 4 kernel/workqueue.c | 20 ++- lib/string.c | 66 +++++++++++ net/802/garp.c | 14 ++ net/802/mrp.c | 14 ++ net/Makefile | 2 net/llc/af_llc.c | 10 + net/llc/llc_s_ac.c | 2 net/netfilter/nft_nat.c | 4 net/sctp/protocol.c | 3 net/tipc/socket.c | 9 - net/unix/Kconfig | 5 net/unix/Makefile | 2 net/unix/af_unix.c | 115 +++++++------------ net/unix/garbage.c | 68 ----------- net/unix/scm.c | 161 +++++++++++++++++++++++++++ net/unix/scm.h | 10 + net/wireless/scan.c | 6 - 38 files changed, 578 insertions(+), 246 deletions(-)
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
Greg Kroah-Hartman (1):
Linux 4.4.278
Hoang Le (1):
tipc: fix sleeping in tipc accept routine
Jan Kiszka (1):
x86/asm: Ensure asm/proto.h can be included stand-alone
Jens Axboe (1):
net: split out functions related to registering inflight socket files
Jiapeng Chong (1):
mlx4: Fix missing error code in mlx4_load_one()
Junxiao Bi (2):
ocfs2: fix zero out valid data
ocfs2: issue zeroout to EOF blocks
Matthew Wilcox (1):
lib/string.c: add multibyte memset functions
Miklos Szeredi (1):
af_unix: fix garbage collect vs MSG_PEEK
Nguyen Dinh Phi (1):
cfg80211: Fix possible memory leak in function cfg80211_bss_update
Pablo Neira Ayuso (1):
netfilter: nft_nat: allow to specify layer 4 protocol NAT only
Paul Jakma (1):
NIU: fix incorrect error return, missed in previous revert
Pavel Skripkin (4):
can: usb_8dev: fix memory leak
can: ems_usb: fix memory leak
can: esd_usb2: fix memory leak
net: llc: fix skb_over_panic
Russell King (1):
ARM: ensure the signal page contains defined contents
Sudeep Holla (1):
ARM: dts: versatile: Fix up interrupt controller node names
Wang Hai (2):
tulip: windbond-840: Fix missing pci_disable_device() in probe and remove
sis900: Fix missing pci_disable_device() in probe and remove
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()
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 277 +SUBLEVEL = 278 EXTRAVERSION = NAME = Blurry Fish Butt
arch/arm/boot/dts/versatile-ab.dts +2 -3
@@ -93,16 +93,15 @@ #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
@@ -6,7 +6,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
arch/arm/kernel/signal.c +8 -6
@@ -625,18 +625,20 @@ struct page *get_signal_page(void) addr =page_address (page); +/* Poison the entire page */ +memset32 (addr,__opcode_to_mem_arm (0xe7fddef1 ), +PAGE_SIZE /sizeof (u32)); +/* Give the signal return code some randomness */ offset =0x200 + (get_random_int () &0x7fc ); signal_return_offset = offset; -/* -* Copy signal return handlers into the vector page, and -* set sigreturn to be a pointer to these. -*/ +/* Copy signal return handlers into the page */ memcpy (addr + offset, sigreturn_codes,sizeof (sigreturn_codes)); - ptr = (unsigned long )addr + offset; -flush_icache_range (ptr, ptr +sizeof (sigreturn_codes)); +/* Flush out all instructions in this page */ + ptr = (unsigned long )addr; +flush_icache_range (ptr, ptr +PAGE_SIZE );return page; }
arch/x86/include/asm/proto.h +2 -0
@@ -3,6 +3,8 @@#include <asm/ldt.h> +struct task_struct ; +/* misc architecture specific prototypes */ void syscall_init (void );
drivers/net/can/usb/ems_usb.c +13 -1
@@ -267,6 +267,8 @@ struct ems_usb {unsigned int free_slots;/* remember number of available slots */ struct ems_cpc_msg active_params;/* active controller parameters */ +void *rxbuf[MAX_RX_URBS ]; +dma_addr_t rxbuf_dma[MAX_RX_URBS ]; };static void ems_usb_read_interrupt_callback (struct urb *urb)
@@ -600,6 +602,7 @@ static int ems_usb_start(struct ems_usb *dev)for (i =0 ; i <MAX_RX_URBS ; i++) {struct urb *urb =NULL ;u8 *buf =NULL ; +dma_addr_t buf_dma;/* create a URB, and a buffer for it */ urb =usb_alloc_urb (0 ,GFP_KERNEL );
@@ -610,7 +613,7 @@ static int ems_usb_start(struct ems_usb *dev) } buf =usb_alloc_coherent (dev->udev,RX_BUFFER_SIZE ,GFP_KERNEL , - &urb->transfer_dma); + &buf_dma);if (!buf) {netdev_err (netdev,"No memory left for USB buffer\n" );usb_free_urb (urb);
@@ -618,6 +621,8 @@ static int ems_usb_start(struct ems_usb *dev)break ; } + urb->transfer_dma = buf_dma; +usb_fill_bulk_urb (urb, dev->udev,usb_rcvbulkpipe (dev->udev,2 ), buf,RX_BUFFER_SIZE , ems_usb_read_bulk_callback, dev);
@@ -633,6 +638,9 @@ static int ems_usb_start(struct ems_usb *dev)break ; } + dev->rxbuf[i] = buf; + dev->rxbuf_dma[i] = buf_dma; +/* Drop reference, USB core will take care of freeing it */ usb_free_urb (urb); }
@@ -698,6 +706,10 @@ static void unlink_all_urbs(struct ems_usb *dev)usb_kill_anchored_urbs (&dev->rx_submitted); +for (i =0 ; i <MAX_RX_URBS ; ++i) +usb_free_coherent (dev->udev,RX_BUFFER_SIZE , + dev->rxbuf[i], dev->rxbuf_dma[i]); +usb_kill_anchored_urbs (&dev->tx_submitted);atomic_set (&dev->active_tx_urbs,0 );
drivers/net/can/usb/esd_usb2.c +15 -1
@@ -207,6 +207,8 @@ struct esd_usb2 {int net_count;u32 version;int rxinitdone; +void *rxbuf[MAX_RX_URBS ]; +dma_addr_t rxbuf_dma[MAX_RX_URBS ]; };struct esd_usb2_net_priv {
@@ -556,6 +558,7 @@ static int esd_usb2_setup_rx_urbs(struct esd_usb2 *dev)for (i =0 ; i <MAX_RX_URBS ; i++) {struct urb *urb =NULL ;u8 *buf =NULL ; +dma_addr_t buf_dma;/* create a URB, and a buffer for it */ urb =usb_alloc_urb (0 ,GFP_KERNEL );
@@ -567,7 +570,7 @@ static int esd_usb2_setup_rx_urbs(struct esd_usb2 *dev) } buf =usb_alloc_coherent (dev->udev,RX_BUFFER_SIZE ,GFP_KERNEL , - &urb->transfer_dma); + &buf_dma);if (!buf) {dev_warn (dev->udev->dev.parent,"No memory left for USB buffer\n" );
@@ -575,6 +578,8 @@ static int esd_usb2_setup_rx_urbs(struct esd_usb2 *dev) goto freeurb; } + urb->transfer_dma = buf_dma; + usb_fill_bulk_urb(urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), buf, RX_BUFFER_SIZE,
@@ -587,8 +592,12 @@ static int esd_usb2_setup_rx_urbs(struct esd_usb2 *dev)usb_unanchor_urb (urb);usb_free_coherent (dev->udev,RX_BUFFER_SIZE , buf, urb->transfer_dma); + goto freeurb; } + dev->rxbuf[i] = buf; + dev->rxbuf_dma[i] = buf_dma; + freeurb:/* Drop reference, USB core will take care of freeing it */ usb_free_urb (urb);
@@ -676,6 +685,11 @@ static void unlink_all_urbs(struct esd_usb2 *dev)int i, j;usb_kill_anchored_urbs (&dev->rx_submitted); + +for (i =0 ; i <MAX_RX_URBS ; ++i) +usb_free_coherent (dev->udev,RX_BUFFER_SIZE , + dev->rxbuf[i], dev->rxbuf_dma[i]); +for (i =0 ; i < dev->net_count; i++) { priv = dev->nets[i];if (priv) {
drivers/net/can/usb/usb_8dev.c +13 -2
@@ -148,7 +148,8 @@ struct usb_8dev_priv {u8 *cmd_msg_buffer;struct mutex usb_8dev_cmd_lock; - +void *rxbuf[MAX_RX_URBS ]; +dma_addr_t rxbuf_dma[MAX_RX_URBS ]; };/* tx frame */
@@ -746,6 +747,7 @@ static int usb_8dev_start(struct usb_8dev_priv *priv)for (i =0 ; i <MAX_RX_URBS ; i++) {struct urb *urb =NULL ;u8 *buf; +dma_addr_t buf_dma;/* create a URB, and a buffer for it */ urb =usb_alloc_urb (0 ,GFP_KERNEL );
@@ -756,7 +758,7 @@ static int usb_8dev_start(struct usb_8dev_priv *priv) } buf =usb_alloc_coherent (priv->udev,RX_BUFFER_SIZE ,GFP_KERNEL , - &urb->transfer_dma); + &buf_dma);if (!buf) {netdev_err (netdev,"No memory left for USB buffer\n" );usb_free_urb (urb);
@@ -764,6 +766,8 @@ static int usb_8dev_start(struct usb_8dev_priv *priv)break ; } + urb->transfer_dma = buf_dma; + usb_fill_bulk_urb(urb, priv->udev, usb_rcvbulkpipe(priv->udev, USB_8DEV_ENDP_DATA_RX),
@@ -781,6 +785,9 @@ static int usb_8dev_start(struct usb_8dev_priv *priv)break ; } + priv->rxbuf[i] = buf; + priv->rxbuf_dma[i] = buf_dma; +/* Drop reference, USB core will take care of freeing it */ usb_free_urb (urb); }
@@ -850,6 +857,10 @@ static void unlink_all_urbs(struct usb_8dev_priv *priv)usb_kill_anchored_urbs (&priv->rx_submitted); +for (i =0 ; i <MAX_RX_URBS ; ++i) +usb_free_coherent (priv->udev,RX_BUFFER_SIZE , + priv->rxbuf[i], priv->rxbuf_dma[i]); +usb_kill_anchored_urbs (&priv->tx_submitted);atomic_set (&priv->active_tx_urbs,0 );
drivers/net/ethernet/dec/tulip/winbond-840.c +2 -5
@@ -368,7 +368,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)int i, option = find_cnt <MAX_UNITS ? options[find_cnt] :0 ;void __iomem *ioaddr; - i =pci_enable_device (pdev); + i =pcim_enable_device (pdev);if (i)return i;pci_set_master (pdev);
@@ -390,7 +390,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) ioaddr =pci_iomap (pdev,TULIP_BAR , netdev_res_size);if (!ioaddr) - goto err_out_free_res; + goto err_out_netdev;for (i =0 ; i <3 ; i++) ((__le16 *)dev->dev_addr)[i] =cpu_to_le16 (eeprom_read (ioaddr, i));
@@ -469,8 +469,6 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) err_out_cleardev:pci_iounmap (pdev, ioaddr); -err_out_free_res: -pci_release_regions (pdev); err_out_netdev:free_netdev (dev);return -ENODEV ;
@@ -1537,7 +1535,6 @@ static void w840_remove1(struct pci_dev *pdev)if (dev) {struct netdev_private *np =netdev_priv (dev);unregister_netdev (dev); -pci_release_regions (pdev);pci_iounmap (pdev, np->base_addr);free_netdev (dev); }
drivers/net/ethernet/mellanox/mlx4/main.c +1 -0
@@ -3222,6 +3222,7 @@ slave_start:if (!SRIOV_VALID_STATE (dev->flags)) {mlx4_err (dev,"Invalid SRIOV state\n" ); + err = -EINVAL ; goto err_close; } }
drivers/net/ethernet/sis/sis900.c +2 -5
@@ -442,7 +442,7 @@ static int sis900_probe(struct pci_dev *pci_dev,#endif /* setup various bits in PCI command register */ - ret =pci_enable_device (pci_dev); + ret =pcim_enable_device (pci_dev);if (ret)return ret; i =pci_set_dma_mask (pci_dev,DMA_BIT_MASK (32 ));
@@ -468,7 +468,7 @@ static int sis900_probe(struct pci_dev *pci_dev, ioaddr =pci_iomap (pci_dev,0 ,0 );if (!ioaddr) { ret = -ENOMEM ; - goto err_out_cleardev; + goto err_out; } sis_priv =netdev_priv (net_dev);
@@ -576,8 +576,6 @@ err_unmap_tx: sis_priv->tx_ring_dma); err_out_unmap:pci_iounmap (pci_dev, ioaddr); -err_out_cleardev: -pci_release_regions (pci_dev); err_out:free_netdev (net_dev);return ret;
@@ -2425,7 +2423,6 @@ static void sis900_remove(struct pci_dev *pci_dev) sis_priv->tx_ring_dma);pci_iounmap (pci_dev, sis_priv->ioaddr);free_netdev (net_dev); -pci_release_regions (pci_dev); }#ifdef CONFIG_PM
drivers/net/ethernet/sun/niu.c +2 -1
@@ -8213,8 +8213,9 @@ static int niu_pci_vpd_fetch(struct niu *np, u32 start) err =niu_pci_vpd_scan_props (np, here, end);if (err <0 )return err; +/* ret == 1 is not an error */ if (err ==1 ) -return -EINVAL ; +return 0 ; }return 0 ; }
fs/hfs/bfind.c +13 -1
@@ -24,7 +24,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
@@ -14,16 +14,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
@@ -12,6 +12,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
@@ -426,14 +426,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);
@@ -449,6 +447,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/ocfs2/file.c +62 -41
145 lines not on this page · raw message
include/linux/string.h +30 -0
@@ -102,6 +102,36 @@ extern __kernel_size_t strcspn(const char *,const char *);#ifndef __HAVE_ARCH_MEMSETextern void *memset (void *,int ,__kernel_size_t );#endif + +#ifndef __HAVE_ARCH_MEMSET16 +extern void *memset16 (uint16_t *,uint16_t ,__kernel_size_t ); +#endif + +#ifndef __HAVE_ARCH_MEMSET32 +extern void *memset32 (uint32_t *,uint32_t ,__kernel_size_t ); +#endif + +#ifndef __HAVE_ARCH_MEMSET64 +extern void *memset64 (uint64_t *,uint64_t ,__kernel_size_t ); +#endif + +static inline void *memset_l (unsigned long *p,unsigned long v, +__kernel_size_t n) +{ +if (BITS_PER_LONG ==32 ) +return memset32 ((uint32_t *)p, v, n); +else +return memset64 ((uint64_t *)p, v, n); +} + +static inline void *memset_p (void **p,void *v,__kernel_size_t n) +{ +if (BITS_PER_LONG ==32 ) +return memset32 ((uint32_t *)p, (uintptr_t )v, n); +else +return memset64 ((uint64_t *)p, (uintptr_t )v, n); +} +#ifndef __HAVE_ARCH_MEMCPYextern void *memcpy (void *,const void *,__kernel_size_t );#endif
include/net/af_unix.h +1 -0
@@ -8,6 +8,7 @@void unix_inflight (struct user_struct *user,struct file *fp);void unix_notinflight (struct user_struct *user,struct file *fp); +void unix_destruct_scm (struct sk_buff *skb);void unix_gc (void );void wait_for_unix_gc (void );struct sock *unix_get_socket (struct file *filp);
include/net/llc_pdu.h +23 -8
@@ -15,9 +15,11 @@#include <linux/if_ether.h> /* Lengths of frame formats */ -#define LLC_PDU_LEN_I 4/* header and 2 control bytes */ -#define LLC_PDU_LEN_S 4 -#define LLC_PDU_LEN_U 3/* header and 1 control byte */ +#define LLC_PDU_LEN_I 4/* header and 2 control bytes */ +#define LLC_PDU_LEN_S 4 +#define LLC_PDU_LEN_U 3/* header and 1 control byte */ +/* header and 1 control byte and XID info */ +#define LLC_PDU_LEN_U_XID (LLC_PDU_LEN_U + sizeof(struct llc_xid_info))/* Known SAP addresses */ #define LLC_GLOBAL_SAP 0xFF#define LLC_NULL_SAP 0x00/* not network-layer visible */
@@ -50,9 +52,10 @@#define LLC_PDU_TYPE_U_MASK 0x03/* 8-bit control field */ #define LLC_PDU_TYPE_MASK 0x03 -#define LLC_PDU_TYPE_I 0/* first bit */ -#define LLC_PDU_TYPE_S 1/* first two bits */ -#define LLC_PDU_TYPE_U 3/* first two bits */ +#define LLC_PDU_TYPE_I 0/* first bit */ +#define LLC_PDU_TYPE_S 1/* first two bits */ +#define LLC_PDU_TYPE_U 3/* first two bits */ +#define LLC_PDU_TYPE_U_XID 4/* private type for detecting XID commands */ #define LLC_PDU_TYPE_IS_I (pdu) \ ((!(pdu->ctrl_1 & LLC_PDU_TYPE_I_MASK)) ? 1 : 0)
@@ -230,9 +233,18 @@ static inline struct llc_pdu_un *llc_pdu_un_hdr(struct sk_buff *skb)static inline void llc_pdu_header_init (struct sk_buff *skb,u8 type,u8 ssap,u8 dsap,u8 cr) { -const int hlen = type ==LLC_PDU_TYPE_U ?3 :4 ; +int hlen =4 ;/* default value for I and S types */ struct llc_pdu_un *pdu; +switch (type) { +case LLC_PDU_TYPE_U : + hlen =3 ; +break ; +case LLC_PDU_TYPE_U_XID : + hlen =6 ; +break ; + } +skb_push (skb, hlen);skb_reset_network_header (skb); pdu =llc_pdu_un_hdr (skb);
@@ -374,7 +386,10 @@ static inline void llc_pdu_init_as_xid_cmd(struct sk_buff *skb, xid_info->fmt_id =LLC_XID_FMT_ID ;/* 0x81 */ xid_info->type = svcs_supported; xid_info->rw = rx_window <<1 ;/* size of receive window */ -skb_put (skb,sizeof (struct llc_xid_info )); + +/* no need to push/put since llc_pdu_header_init() has already +* pushed 3 + 3 bytes +*/ }/**
include/net/sctp/constants.h +1 -3
@@ -344,8 +344,7 @@ typedef enum { } sctp_scope_policy_t;/* 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. */
@@ -353,7 +352,6 @@ typedef 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/workqueue.c +13 -7
@@ -3309,15 +3309,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);
lib/string.c +66 -0
72 lines not on this page · raw message
net/802/garp.c +14 -0
@@ -206,6 +206,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;
@@ -612,6 +625,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
@@ -295,6 +295,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;
@@ -900,6 +913,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/Makefile +1 -1
@@ -16,7 +16,7 @@ obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/ obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_INET) += ipv4/ obj-$(CONFIG_XFRM) += xfrm/ -obj-$(CONFIG_UNIX) += unix/ +obj-$(CONFIG_UNIX_SCM) += unix/ obj-$(CONFIG_NET) += ipv6/ obj-$(CONFIG_PACKET) += packet/ obj-$(CONFIG_NET_KEY) += key/
net/llc/af_llc.c +9 -1
@@ -96,8 +96,16 @@ static inline u8 llc_ui_header_len(struct sock *sk, struct sockaddr_llc *addr) {u8 rc =LLC_PDU_LEN_U ; -if (addr->sllc_test || addr->sllc_xid) +if (addr->sllc_test) rc =LLC_PDU_LEN_U ; +else if (addr->sllc_xid) +/* We need to expand header to sizeof(struct llc_xid_info) +* since llc_pdu_init_as_xid_cmd() sets 4,5,6 bytes of LLC header +* as XID PDU. In llc_ui_sendmsg() we reserved header size and then +* filled all other space with user data. If we won't reserve this +* bytes, llc_pdu_init_as_xid_cmd() will overwrite user data +*/ + rc =LLC_PDU_LEN_U_XID ;else if (sk->sk_type ==SOCK_STREAM ) rc =LLC_PDU_LEN_I ;return rc;
net/llc/llc_s_ac.c +1 -1
@@ -79,7 +79,7 @@ int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb)struct llc_sap_state_ev *ev =llc_sap_ev (skb);int rc; -llc_pdu_header_init (skb,LLC_PDU_TYPE_U , ev->saddr.lsap, +llc_pdu_header_init (skb,LLC_PDU_TYPE_U_XID , ev->saddr.lsap, ev->daddr.lsap,LLC_PDU_CMD );llc_pdu_init_as_xid_cmd (skb,LLC_XID_NULL_CLASS_2 ,0 ); rc =llc_mac_hdr_init (skb, ev->saddr.mac, ev->daddr.mac);
net/netfilter/nft_nat.c +3 -1
@@ -157,7 +157,9 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr, alen = FIELD_SIZEOF(struct nf_nat_range, min_addr.ip6);break ;default : -return -EAFNOSUPPORT ; +if (tb[NFTA_NAT_REG_ADDR_MIN ]) +return -EAFNOSUPPORT ; +break ; } priv->family = family;
net/sctp/protocol.c +2 -1
@@ -411,7 +411,8 @@ static sctp_scope_t 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/tipc/socket.c +4 -5
@@ -1987,7 +1987,7 @@ static int tipc_listen(struct socket *sock, int len)static int tipc_wait_for_accept (struct socket *sock,long timeo) {struct sock *sk = sock->sk; -DEFINE_WAIT (wait); +DEFINE_WAIT_FUNC (wait, woken_wake_function);int err;/* True wake-one mechanism for incoming connections: only
@@ -1996,12 +1996,12 @@ static int tipc_wait_for_accept(struct socket *sock, long timeo)* anymore, the common case will execute the loop only once. */ for (;;) { -prepare_to_wait_exclusive (sk_sleep (sk), &wait, -TASK_INTERRUPTIBLE );if (timeo &&skb_queue_empty (&sk->sk_receive_queue)) { +add_wait_queue (sk_sleep (sk), &wait);release_sock (sk); - timeo =schedule_timeout (timeo); + timeo =wait_woken (&wait,TASK_INTERRUPTIBLE , timeo);lock_sock (sk); +remove_wait_queue (sk_sleep (sk), &wait); } err =0 ;if (!skb_queue_empty (&sk->sk_receive_queue))
@@ -2016,7 +2016,6 @@ static int tipc_wait_for_accept(struct socket *sock, long timeo)if (signal_pending (current))break ; } -finish_wait (sk_sleep (sk), &wait);return err; }
net/unix/Kconfig +5 -0
@@ -19,6 +19,11 @@ config UNIX Say Y unless you know what you are doing. +config UNIX_SCM + bool + depends on UNIX + default y + config UNIX_DIAG tristate "UNIX: socket monitoring interface" depends on UNIX
net/unix/Makefile +2 -0
@@ -9,3 +9,5 @@ unix-$(CONFIG_SYSCTL) += sysctl_net_unix.o obj-$(CONFIG_UNIX_DIAG) += unix_diag.o unix_diag-y := diag.o + +obj-$(CONFIG_UNIX_SCM) += scm.o
net/unix/af_unix.c +45 -70
143 lines not on this page · raw message
net/unix/garbage.c +2 -66
79 lines not on this page · raw message
net/unix/scm.c new file +161 -0
161 lines not on this page · raw message
net/unix/scm.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef NET_UNIX_SCM_H +#define NET_UNIX_SCM_H + +extern struct list_head gc_inflight_list; +extern spinlock_t unix_gc_lock; + +int unix_attach_fds (struct scm_cookie *scm,struct sk_buff *skb); +void unix_detach_fds (struct scm_cookie *scm,struct sk_buff *skb); + +#endif
net/wireless/scan.c +2 -4
@@ -947,16 +947,14 @@ cfg80211_bss_update(struct cfg80211_registered_device *rdev,* be grouped with this beacon for updates ... */ if (!cfg80211_combine_bsses (rdev, new)) { -kfree (new); +bss_ref_put (rdev, new); goto drop; } }if (rdev->bss_entries >= bss_entries_limit && !cfg80211_bss_expire_oldest (rdev)) { -if (!list_empty (&new->hidden_list)) -list_del (&new->hidden_list); -kfree (new); +bss_ref_put (rdev, new); goto drop; }