Linux 4.14.299
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.14.299 kernel.
All users of the 4.14 kernel series must upgrade.
The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.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/include/asm/memory.h | 6 arch/arm64/include/asm/memory.h | 6 arch/unicore32/include/asm/memory.h | 6 arch/x86/kvm/cpuid.c | 1 arch/x86/kvm/emulate.c | 102 +++++++++++----- block/bfq-iosched.c | 4 drivers/ata/pata_legacy.c | 5 drivers/firmware/efi/efi.c | 2 drivers/i2c/busses/i2c-xiic.c | 1 drivers/isdn/hardware/mISDN/netjet.c | 2 drivers/isdn/mISDN/core.c | 5 drivers/media/dvb-frontends/drxk_hard.c | 2 drivers/media/platform/s5p-cec/s5p_cec.c | 2 drivers/net/dsa/dsa_loop.c | 25 ++- drivers/net/ethernet/freescale/fec_main.c | 4 drivers/net/phy/mdio_bus.c | 2 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c | 4 drivers/nfc/nfcmrvl/i2c.c | 7 - drivers/nfc/s3fwrn5/core.c | 8 - drivers/parisc/iosapic.c | 1 drivers/tty/serial/8250/Kconfig | 2 fs/btrfs/backref.c | 36 ++--- fs/btrfs/export.c | 2 fs/btrfs/export.h | 2 fs/btrfs/tests/qgroup-tests.c | 20 ++- fs/ext4/migrate.c | 3 fs/nfs/nfs4client.c | 1 fs/nfs/nfs4state.c | 2 include/linux/bits.h | 17 +- include/linux/const.h | 9 + include/linux/efi.h | 2 include/net/protocol.h | 4 include/net/tcp.h | 2 include/net/udp.h | 1 include/uapi/linux/const.h | 9 - net/bluetooth/l2cap_core.c | 52 ++++++-- net/core/neighbour.c | 2 net/ipv4/af_inet.c | 14 -- net/ipv4/ip_input.c | 32 +++-- net/ipv4/sysctl_net_ipv4.c | 59 --------- net/ipv6/ip6_input.c | 23 ++- net/ipv6/tcp_ipv6.c | 9 - net/ipv6/udp.c | 9 - net/netfilter/ipvs/ip_vs_conn.c | 4 net/rose/rose_link.c | 3 net/sched/sch_red.c | 4 security/commoncap.c | 6 sound/usb/quirks-table.h | 58 +++++++++ sound/usb/quirks.c | 1 50 files changed, 357 insertions(+), 228 deletions(-)
Ard Biesheuvel (1):
efi: random: reduce seed size to 32 bytes
Chen Zhongjin (2):
net: dsa: Fix possible memory leaks in dsa_loop_init() net, neigh: Fix null-ptr-deref in neigh_table_clear()
Dan Carpenter (1):
net: sched: Fix use after free in red_enqueue()
David Sterba (1):
btrfs: fix type of parameter generation in btrfs_get_dentry
Dokyung Song (1):
wifi: brcmfmac: Fix potential buffer overflow in brcmf_fweh_event_worker()
Filipe Manana (2):
btrfs: fix inode list leak during backref walking at resolve_indirect_refs()
btrfs: fix ulist leaks in error paths of qgroup self tests
Gaosheng Cui (2):
net: mdio: fix undefined behavior in bit shift for __mdiobus_register
capabilities: fix potential memleak on error path from vfs_getxattr_alloc()
Greg Kroah-Hartman (1):
Linux 4.14.299
Hans Verkuil (2):
media: s5p_cec: limit msg.len to CEC_MAX_MSG_SIZE
media: dvb-frontends/drxk: initialize err to 0
Helge Deller (2):
parisc: Make 8250_gsc driver dependend on CONFIG_PARISC
parisc: Export iosapic_serial_irq() symbol for serial port driver
Jason A. Donenfeld (1):
ipvs: use explicitly signed chars
Jim Mattson (1):
KVM: x86: Mask off reserved bits in CPUID.80000008H
John Veness (1):
ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices
Kuniyuki Iwashima (1):
tcp/udp: Make early_demux back namespacified.
Luiz Augusto von Dentz (1):
Bluetooth: L2CAP: Fix attempting to access uninitialized memory
Martin Tůma (1):
i2c: xiic: Add platform module alias
Masahiro Yamada (3):
linux/const.h: prefix include guard of uapi/linux/const.h with _UAPI linux/const.h: move UL() macro to include/linux/const.h linux/bits.h: make BIT(), GENMASK(), and friends available in assembly
Maxim Levitsky (3):
KVM: x86: emulator: em_sysexit should update ctxt->mode
KVM: x86: emulator: introduce emulator_recalc_and_set_mode
KVM: x86: emulator: update the emulation mode after CR0 write
Maxim Mikityanskiy (1):
Bluetooth: L2CAP: Fix use-after-free caused by l2cap_reassemble_sdu
Sergey Shtylyov (1):
ata: pata_legacy: fix pdc20230_set_piomode()
Shang XiaoJing (2):
nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()
nfc: nfcmrvl: Fix potential memory leak in nfcmrvl_i2c_nci_send()
Trond Myklebust (2):
NFSv4.1: Handle RECLAIM_COMPLETE trunking errors NFSv4.1: We must always send RECLAIM_COMPLETE after a reboot
Yang Yingliang (2):
mISDN: fix possible memory leak in mISDN_register_device()
isdn: mISDN: netjet: fix wrong check of device registration
Ye Bin (1):
ext4: fix warning in 'ext4_da_release_space'
Yu Kuai (1):
block, bfq: protect 'bfqd->queued' by 'bfqd->lock'
Zhang Changzhong (1):
net: fec: fix improper use of NETDEV_TX_BUSY
Zhang Qilong (1):
rose: Fix NULL pointer dereference in rose_send_frame()
Zhang Xiaoxu (1):
nfs4: Fix kmemleak when allocate slot failed
Zhengchao Shao (1):
Bluetooth: L2CAP: fix use-after-free in l2cap_conn_del()
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 298 +SUBLEVEL = 299 EXTRAVERSION = NAME = Petit Gorille
arch/arm/include/asm/memory.h +0 -6
@@ -22,12 +22,6 @@#include <mach/memory.h> #endif -/* -* Allow for constants defined here to be used from assembly code -* by prepending the UL suffix only with actual C code compilation. -*/ -#define UL (x) _AC(x, UL) -/* PAGE_OFFSET - the virtual address of the start of the kernel image */ #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET)
arch/arm64/include/asm/memory.h +0 -6
@@ -28,12 +28,6 @@#include <asm/page-def.h> #include <asm/sizes.h> -/* -* Allow for constants defined here to be used from assembly code -* by prepending the UL suffix only with actual C code compilation. -*/ -#define UL (x) _AC(x, UL) -/* * Size of the PCI I/O space. This must remain a power of two so that * IO_SPACE_LIMIT acts as a mask for the low bits of I/O addresses.
arch/unicore32/include/asm/memory.h +0 -6
@@ -19,12 +19,6 @@#include <asm/sizes.h> #include <mach/memory.h> -/* -* Allow for constants defined here to be used from assembly code -* by prepending the UL suffix only with actual C code compilation. -*/ -#define UL (x) _AC(x, UL) -/* * PAGE_OFFSET - the virtual address of the start of the kernel image * TASK_SIZE - the maximum size of a user space task.
arch/x86/kvm/cpuid.c +1 -0
@@ -663,6 +663,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, g_phys_as = phys_as; entry->eax = g_phys_as | (virt_as <<8 ); + entry->ecx &= ~(GENMASK (31 ,16 ) |GENMASK (11 ,8 )); entry->edx =0 ;/* * IBRS, IBPB and VIRT_SSBD aren't necessarily present in
arch/x86/kvm/emulate.c +73 -29
160 lines not on this page · raw message
block/bfq-iosched.c +3 -1
@@ -298,6 +298,8 @@ static struct bfq_io_cq *bfq_bic_lookup(struct bfq_data *bfqd,*/ void bfq_schedule_dispatch (struct bfq_data *bfqd) { +lockdep_assert_held (&bfqd->lock); +if (bfqd->queued !=0 ) {bfq_log (bfqd,"schedule dispatch" );blk_mq_run_hw_queues (bfqd->queue, true);
@@ -4584,8 +4586,8 @@ bfq_idle_slice_timer_body(struct bfq_data *bfqd, struct bfq_queue *bfqq)bfq_bfqq_expire (bfqd, bfqq, true, reason); schedule_dispatch: -spin_unlock_irqrestore (&bfqd->lock, flags);bfq_schedule_dispatch (bfqd); +spin_unlock_irqrestore (&bfqd->lock, flags); }/*
drivers/ata/pata_legacy.c +3 -2
@@ -292,9 +292,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev)outb (inb (0x1F4 ) &0x07 ,0x1F4 ); rt =inb (0x1F3 ); - rt &=0x07 << (3 * adev->devno); + rt &= ~(0x07 << (3 * !adev->devno));if (pio) - rt |= (1 +3 * pio) << (3 * adev->devno); + rt |= (1 +3 * pio) << (3 * !adev->devno); +outb (rt,0x1F3 );udelay (100 );outb (inb (0x1F2 ) |0x01 ,0x1F2 );
drivers/firmware/efi/efi.c +1 -1
@@ -532,7 +532,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, seed =early_memremap (efi.rng_seed,sizeof (*seed));if (seed !=NULL ) { - size = seed->size; + size =min (seed->size,EFI_RANDOM_SEED_SIZE );early_memunmap (seed,sizeof (*seed)); }else {pr_err ("Could not map UEFI random seed!\n" );
drivers/i2c/busses/i2c-xiic.c +1 -0
@@ -900,6 +900,7 @@ static struct platform_driver xiic_i2c_driver = {module_platform_driver (xiic_i2c_driver); +MODULE_ALIAS ("platform:" DRIVER_NAME );MODULE_AUTHOR ("[email protected]" );MODULE_DESCRIPTION ("Xilinx I2C bus driver" );MODULE_LICENSE ("GPL v2" );
drivers/isdn/hardware/mISDN/netjet.c +1 -1
@@ -970,7 +970,7 @@ nj_release(struct tiger_hw *card) }if (card->irq >0 )free_irq (card->irq, card); -if (card->isac.dch.dev.dev.class) +if (device_is_registered (&card->isac.dch.dev.dev))mISDN_unregister_device (&card->isac.dch.dev);for (i =0 ; i <2 ; i++) {
drivers/isdn/mISDN/core.c +3 -2
@@ -242,11 +242,12 @@ mISDN_register_device(struct mISDNdevice *dev,if (debug &DEBUG_CORE )printk (KERN_DEBUG "mISDN_register %s %d\n" ,dev_name (&dev->dev), dev->id); + dev->dev.class = &mISDN_class; + err =create_stack (dev);if (err) goto error1; - dev->dev.class = &mISDN_class; dev->dev.platform_data = dev; dev->dev.parent = parent;dev_set_drvdata (&dev->dev, dev);
@@ -258,8 +259,8 @@ mISDN_register_device(struct mISDNdevice *dev, error3:delete_stack (dev); -return err; error1: +put_device (&dev->dev);return err; }
drivers/media/dvb-frontends/drxk_hard.c +1 -1
@@ -6700,7 +6700,7 @@ static int drxk_read_snr(struct dvb_frontend *fe, u16 *snr)static int drxk_read_ucblocks (struct dvb_frontend *fe,u32 *ucblocks) {struct drxk_state *state = fe->demodulator_priv; -u16 err; +u16 err =0 ;dprintk (1 ,"\n" );
drivers/media/platform/s5p-cec/s5p_cec.c +2 -0
@@ -116,6 +116,8 @@ static irqreturn_t s5p_cec_irq_handler(int irq, void *priv)dev_dbg (cec->dev,"Buffer overrun (worker did not process previous message)\n" ); cec->rx =STATE_BUSY ; cec->msg.len = status >>24 ; +if (cec->msg.len >CEC_MAX_MSG_SIZE ) + cec->msg.len =CEC_MAX_MSG_SIZE ; cec->msg.rx_status =CEC_RX_STATUS_OK ;s5p_cec_get_rx_buf (cec, cec->msg.len, cec->msg.msg);
drivers/net/dsa/dsa_loop.c +18 -7
@@ -330,6 +330,17 @@ static struct mdio_driver dsa_loop_drv = {#define NUM_FIXED_PHYS (DSA_LOOP_NUM_PORTS - 2) +static void dsa_loop_phydevs_unregister (void ) +{ +unsigned int i; + +for (i =0 ; i <NUM_FIXED_PHYS ; i++) +if (!IS_ERR (phydevs[i])) { +fixed_phy_unregister (phydevs[i]); +phy_device_free (phydevs[i]); + } +} +static int __init dsa_loop_init (void ) {struct fixed_phy_status status = {
@@ -337,23 +348,23 @@ static int __init dsa_loop_init(void) .speed = SPEED_100, .duplex = DUPLEX_FULL, }; -unsigned int i; +unsigned int i, ret;for (i =0 ; i <NUM_FIXED_PHYS ; i++) phydevs[i] =fixed_phy_register (PHY_POLL , &status,-1 ,NULL ); -return mdio_driver_register (&dsa_loop_drv); + ret =mdio_driver_register (&dsa_loop_drv); +if (ret) +dsa_loop_phydevs_unregister (); + +return ret; }module_init (dsa_loop_init); static void __exit dsa_loop_exit(void) { -unsigned int i; -mdio_driver_unregister (&dsa_loop_drv); -for (i =0 ; i <NUM_FIXED_PHYS ; i++) -if (!IS_ERR (phydevs[i])) -fixed_phy_unregister (phydevs[i]); +dsa_loop_phydevs_unregister (); }module_exit (dsa_loop_exit);
drivers/net/ethernet/freescale/fec_main.c +2 -2
@@ -582,7 +582,7 @@ fec_enet_txq_put_data_tso(struct fec_enet_priv_tx_q *txq, struct sk_buff *skb,dev_kfree_skb_any (skb);if (net_ratelimit ())netdev_err (ndev,"Tx DMA memory map failed\n" ); -return NETDEV_TX_BUSY ; +return NETDEV_TX_OK ; } bdp->cbd_datlen =cpu_to_fec16 (size);
@@ -644,7 +644,7 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq,dev_kfree_skb_any (skb);if (net_ratelimit ())netdev_err (ndev,"Tx DMA memory map failed\n" ); -return NETDEV_TX_BUSY ; +return NETDEV_TX_OK ; } }
drivers/net/phy/mdio_bus.c +1 -1
@@ -378,7 +378,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) bus->reset (bus);for (i =0 ; i <PHY_MAX_ADDR ; i++) { -if ((bus->phy_mask & (1 << i)) ==0 ) { +if ((bus->phy_mask &BIT (i)) ==0 ) {struct phy_device *phydev; phydev =mdiobus_scan (bus, i);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +4 -0
@@ -237,6 +237,10 @@ static void brcmf_fweh_event_worker(struct work_struct *work)brcmf_fweh_event_name (event->code), event->code, event->emsg.ifidx, event->emsg.bsscfgidx, event->emsg.addr); +if (event->emsg.bsscfgidx >=BRCMF_MAX_IFS ) { +brcmf_err ("invalid bsscfg index: %u\n" , event->emsg.bsscfgidx); + goto event_free; + }/* convert event message */ emsg_be = &event->emsg;
drivers/nfc/nfcmrvl/i2c.c +6 -1
@@ -151,10 +151,15 @@ static int nfcmrvl_i2c_nci_send(struct nfcmrvl_private *priv, ret = -EREMOTEIO ; }else ret =0 ; + } + +if (ret) {kfree_skb (skb); +return ret; } -return ret; +consume_skb (skb); +return 0 ; } static void nfcmrvl_i2c_nci_update_config(struct nfcmrvl_private *priv,
drivers/nfc/s3fwrn5/core.c +6 -2
@@ -108,11 +108,15 @@ static int s3fwrn5_nci_send(struct nci_dev *ndev, struct sk_buff *skb) } ret =s3fwrn5_write (info, skb); -if (ret <0 ) +if (ret <0 ) {kfree_skb (skb); +mutex_unlock (&info->mutex); +return ret; + } +consume_skb (skb);mutex_unlock (&info->mutex); -return ret; +return 0 ; }static int s3fwrn5_nci_post_setup (struct nci_dev *ndev)
drivers/parisc/iosapic.c +1 -0
@@ -889,6 +889,7 @@ int iosapic_serial_irq(struct parisc_device *dev) return vi->txn_irq; } +EXPORT_SYMBOL (iosapic_serial_irq);#endif
drivers/tty/serial/8250/Kconfig +1 -1
@@ -105,7 +105,7 @@ config SERIAL_8250_CONSOLE config SERIAL_8250_GSC tristate - depends on SERIAL_8250 && GSC + depends on SERIAL_8250 && PARISC default SERIAL_8250 config SERIAL_8250_DMA
fs/btrfs/backref.c +17 -19
@@ -597,6 +597,18 @@ unode_aux_to_inode_list(struct ulist_node *node)return (struct extent_inode_elem *)(uintptr_t )node->aux; } +static void free_leaf_list (struct ulist *ulist) +{ +struct ulist_node *node; +struct ulist_iterator uiter; + +ULIST_ITER_INIT (&uiter); +while ((node =ulist_next (ulist, &uiter))) +free_inode_elem_list (unode_aux_to_inode_list (node)); + +ulist_free (ulist); +} +/* * We maintain three seperate rbtrees: one for direct refs, one for * indirect refs which have a key, and one for indirect refs which do not
@@ -711,7 +723,11 @@ static int resolve_indirect_refs(struct btrfs_fs_info *fs_info,cond_resched (); } out: -ulist_free (parents); +/* +* We may have inode lists attached to refs in the parents ulist, so we +* must free them before freeing the ulist and its refs. +*/ +free_leaf_list (parents);return ret; }
@@ -1361,24 +1377,6 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,return ret; } -static void free_leaf_list (struct ulist *blocks) -{ -struct ulist_node *node =NULL ; -struct extent_inode_elem *eie; -struct ulist_iterator uiter; - -ULIST_ITER_INIT (&uiter); -while ((node =ulist_next (blocks, &uiter))) { -if (!node->aux) -continue ; - eie =unode_aux_to_inode_list (node); -free_inode_elem_list (eie); - node->aux =0 ; - } - -ulist_free (blocks); -} -/* * Finds all leafs with a reference to the specified combination of bytenr and * offset. key_list_head will point to a list of corresponding keys (caller must
fs/btrfs/export.c +1 -1
@@ -57,7 +57,7 @@ static int btrfs_encode_fh(struct inode *inode, u32 *fh, int *max_len, }struct dentry *btrfs_get_dentry (struct super_block *sb,u64 objectid, -u64 root_objectid,u32 generation, +u64 root_objectid,u64 generation,int check_generation) {struct btrfs_fs_info *fs_info =btrfs_sb (sb);
fs/btrfs/export.h +1 -1
@@ -18,7 +18,7 @@ struct btrfs_fid { } __attribute__ ((packed));struct dentry *btrfs_get_dentry (struct super_block *sb,u64 objectid, -u64 root_objectid,u32 generation, +u64 root_objectid,u64 generation,int check_generation);struct dentry *btrfs_get_parent (struct dentry *child);
fs/btrfs/tests/qgroup-tests.c +15 -5
@@ -249,8 +249,10 @@ static int test_no_shared_qgroup(struct btrfs_root *root, ret =insert_normal_tree_ref (root, nodesize, nodesize,0 ,BTRFS_FS_TREE_OBJECTID ); -if (ret) +if (ret) { +ulist_free (old_roots);return ret; + } ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots);if (ret) {
@@ -283,8 +285,10 @@ static int test_no_shared_qgroup(struct btrfs_root *root, } ret =remove_extent_item (root, nodesize, nodesize); -if (ret) +if (ret) { +ulist_free (old_roots);return -EINVAL ; + } ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots);if (ret) {
@@ -346,8 +350,10 @@ static int test_multiple_refs(struct btrfs_root *root, ret =insert_normal_tree_ref (root, nodesize, nodesize,0 ,BTRFS_FS_TREE_OBJECTID ); -if (ret) +if (ret) { +ulist_free (old_roots);return ret; + } ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots);if (ret) {
@@ -379,8 +385,10 @@ static int test_multiple_refs(struct btrfs_root *root, ret =add_tree_ref (root, nodesize, nodesize,0 ,BTRFS_FIRST_FREE_OBJECTID ); -if (ret) +if (ret) { +ulist_free (old_roots);return ret; + } ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots);if (ret) {
@@ -418,8 +426,10 @@ static int test_multiple_refs(struct btrfs_root *root, ret =remove_extent_ref (root, nodesize, nodesize,0 ,BTRFS_FIRST_FREE_OBJECTID ); -if (ret) +if (ret) { +ulist_free (old_roots);return ret; + } ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots);if (ret) {
fs/ext4/migrate.c +2 -1
@@ -450,7 +450,8 @@ int ext4_ext_migrate(struct inode *inode)* already is extent-based, error out. */ if (!ext4_has_feature_extents (inode->i_sb) || - (ext4_test_inode_flag (inode,EXT4_INODE_EXTENTS ))) +ext4_test_inode_flag (inode,EXT4_INODE_EXTENTS ) || +ext4_has_inline_data (inode))return -EINVAL ;if (S_ISLNK (inode->i_mode) && inode->i_blocks ==0 )
fs/nfs/nfs4client.c +1 -0
@@ -326,6 +326,7 @@ int nfs40_init_client(struct nfs_client *clp) ret =nfs4_setup_slot_table (tbl,NFS4_MAX_SLOT_TABLE ,"NFSv4.0 transport Slot table" );if (ret) { +nfs4_shutdown_slot_table (tbl);kfree (tbl);return ret; }
fs/nfs/nfs4state.c +2 -0
@@ -1674,6 +1674,7 @@ static void nfs4_state_mark_reclaim_helper(struct nfs_client *clp,static void nfs4_state_start_reclaim_reboot (struct nfs_client *clp) { +set_bit (NFS4CLNT_RECLAIM_REBOOT , &clp->cl_state);/* Mark all delegations for reclaim */ nfs_delegation_mark_reclaim (clp);nfs4_state_mark_reclaim_helper (clp, nfs4_state_mark_reclaim_reboot);
@@ -2507,6 +2508,7 @@ static void nfs4_state_manager(struct nfs_client *clp)if (status <0 ) goto out_error;nfs4_state_end_reclaim_reboot (clp); +continue ; }/* Detect expired delegations... */
include/linux/bits.h +10 -7
@@ -1,13 +1,15 @@/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __LINUX_BITS_H#define __LINUX_BITS_H + +#include <linux/const.h> #include <asm/bitsperlong.h> -#define BIT (nr) (1UL << (nr)) -#define BIT_ULL (nr) (1ULL << (nr)) -#define BIT_MASK (nr) (1UL << ((nr) % BITS_PER_LONG)) +#define BIT (nr) (UL(1) << (nr)) +#define BIT_ULL (nr) (ULL(1) << (nr)) +#define BIT_MASK (nr) (UL(1) << ((nr) % BITS_PER_LONG))#define BIT_WORD (nr) ((nr) / BITS_PER_LONG) -#define BIT_ULL_MASK (nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) +#define BIT_ULL_MASK (nr) (ULL(1) << ((nr) % BITS_PER_LONG_LONG))#define BIT_ULL_WORD (nr) ((nr) / BITS_PER_LONG_LONG)#define BITS_PER_BYTE 8
@@ -17,10 +19,11 @@* GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. */ #define GENMASK (h, l) \ - (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) + (((~UL(0)) - (UL(1) << (l)) + 1) & \ + (~UL(0) >> (BITS_PER_LONG - 1 - (h))))#define GENMASK_ULL (h, l) \ - (((~0ULL) - (1ULL << (l)) + 1) & \ - (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) + (((~ULL(0)) - (ULL(1) << (l)) + 1) & \ + (~ULL(0) >> (BITS_PER_LONG_LONG - 1 - (h))))#endif /* __LINUX_BITS_H */
include/linux/const.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef _LINUX_CONST_H +#define _LINUX_CONST_H + +#include <uapi/linux/const.h> + +#define UL (x) (_UL(x)) +#define ULL (x) (_ULL(x)) + +#endif /* _LINUX_CONST_H */
include/linux/efi.h +1 -1
@@ -1607,7 +1607,7 @@ efi_status_t efi_exit_boot_services(efi_system_table_t *sys_table,void *priv, efi_exit_boot_map_processing priv_func); -#define EFI_RANDOM_SEED_SIZE 64U +#define EFI_RANDOM_SEED_SIZE 32U // BLAKE2S_HASH_SIZEstruct linux_efi_random_seed {u32 size;
include/net/protocol.h +0 -4
@@ -39,8 +39,6 @@/* This is used to register protocols. */ struct net_protocol { -int (*early_demux)(struct sk_buff *skb); -int (*early_demux_handler)(struct sk_buff *skb);int (*handler)(struct sk_buff *skb);void (*err_handler)(struct sk_buff *skb,u32 info); unsigned int no_policy:1,
@@ -54,8 +52,6 @@ struct net_protocol { #if IS_ENABLED(CONFIG_IPV6) struct inet6_protocol { - void (*early_demux)(struct sk_buff *skb); - void (*early_demux_handler)(struct sk_buff *skb); int (*handler)(struct sk_buff *skb); void (*err_handler)(struct sk_buff *skb,
include/net/tcp.h +2 -0
@@ -890,6 +890,8 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb)#endif return 0; } + +void tcp_v6_early_demux (struct sk_buff *skb);#endif static inline bool inet_exact_dif_match (struct net *net,struct sk_buff *skb)
include/net/udp.h +1 -0
@@ -173,6 +173,7 @@ typedef struct sock *(*udp_lookup_t)(struct sk_buff *skb, __be16 sport,struct sk_buff **udp_gro_receive (struct sk_buff **head,struct sk_buff *skb,struct udphdr *uh,udp_lookup_t lookup);int udp_gro_complete (struct sk_buff *skb,int nhoff,udp_lookup_t lookup); +void udp_v6_early_demux (struct sk_buff *skb);static inline struct udphdr *udp_gro_udphdr (struct sk_buff *skb) {
include/uapi/linux/const.h +6 -3
@@ -1,8 +1,8 @@/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* const.h: Macros for dealing with constants. */ -#ifndef _LINUX_CONST_H -#define _LINUX_CONST_H +#ifndef _UAPI_LINUX_CONST_H +#define _UAPI_LINUX_CONST_H/* Some constant macros are used in both assembler and * C code. Therefore we cannot annotate them always with
@@ -22,6 +22,9 @@#define _AT (T ,X ) ((T)(X))#endif +#define _UL (x) (_AC(x, UL)) +#define _ULL (x) (_AC(x, ULL)) +#define _BITUL (x) (_AC(1,UL) << (x))#define _BITULL (x) (_AC(1,ULL) << (x))
@@ -30,4 +33,4 @@#define __KERNEL_DIV_ROUND_UP (n, d) (((n) + (d) - 1) / (d)) -#endif /* !(_LINUX_CONST_H) */ +#endif /* _UAPI_LINUX_CONST_H */
net/bluetooth/l2cap_core.c +44 -8
97 lines not on this page · raw message
net/core/neighbour.c +1 -1
@@ -310,7 +310,7 @@ int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev)write_lock_bh (&tbl->lock);neigh_flush_dev (tbl, dev);pneigh_ifdown_and_unlock (tbl, dev); -pneigh_queue_purge (&tbl->proxy_queue,dev_net (dev)); +pneigh_queue_purge (&tbl->proxy_queue, dev ?dev_net (dev) :NULL );if (skb_queue_empty_lockless (&tbl->proxy_queue))del_timer_sync (&tbl->proxy_timer);return 0 ;
net/ipv4/af_inet.c +2 -12
@@ -1608,12 +1608,7 @@ static const struct net_protocol igmp_protocol = { };#endif -/* thinking of making this const? Don't. -* early_demux can change based on sysctl. -*/ -static struct net_protocol tcp_protocol = { - .early_demux = tcp_v4_early_demux, - .early_demux_handler = tcp_v4_early_demux, +static const struct net_protocol tcp_protocol = { .handler = tcp_v4_rcv, .err_handler = tcp_v4_err, .no_policy =1 ,
@@ -1621,12 +1616,7 @@ static struct net_protocol tcp_protocol = { .icmp_strict_tag_validation = 1, }; -/* thinking of making this const? Don't. -* early_demux can change based on sysctl. -*/ -static struct net_protocol udp_protocol = { - .early_demux = udp_v4_early_demux, - .early_demux_handler = udp_v4_early_demux, +static const struct net_protocol udp_protocol = { .handler = udp_rcv, .err_handler = udp_err, .no_policy =1 ,
net/ipv4/ip_input.c +21 -11
@@ -307,10 +307,11 @@ static inline bool ip_rcv_options(struct sk_buff *skb, struct net_device *dev)return true; } +int udp_v4_early_demux (struct sk_buff *); +int tcp_v4_early_demux (struct sk_buff *);static int ip_rcv_finish (struct net *net,struct sock *sk,struct sk_buff *skb) {const struct iphdr *iph =ip_hdr (skb); -int (*edemux)(struct sk_buff *skb);struct net_device *dev = skb->dev;struct rtable *rt;int err;
@@ -322,20 +323,29 @@ static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)if (!skb)return NET_RX_SUCCESS ; -if (net->ipv4.sysctl_ip_early_demux && +if (READ_ONCE (net->ipv4.sysctl_ip_early_demux) && !skb_dst (skb) && !skb->sk && !ip_is_fragment (iph)) { -const struct net_protocol *ipprot; -int protocol = iph->protocol; +switch (iph->protocol) { +case IPPROTO_TCP : +if (READ_ONCE (net->ipv4.sysctl_tcp_early_demux)) { +tcp_v4_early_demux (skb); - ipprot =rcu_dereference (inet_protos[protocol]); -if (ipprot && (edemux =READ_ONCE (ipprot->early_demux))) { - err =edemux (skb); -if (unlikely (err)) - goto drop_error; -/* must reload iph, skb->head might have changed */ - iph =ip_hdr (skb); +/* must reload iph, skb->head might have changed */ + iph =ip_hdr (skb); + } +break ; +case IPPROTO_UDP : +if (READ_ONCE (net->ipv4.sysctl_udp_early_demux)) { + err =udp_v4_early_demux (skb); +if (unlikely (err)) + goto drop_error; + +/* must reload iph, skb->head might have changed */ + iph =ip_hdr (skb); + } +break ; } }
net/ipv4/sysctl_net_ipv4.c +2 -57
77 lines not on this page · raw message
net/ipv6/ip6_input.c +15 -8
@@ -47,10 +47,10 @@#include <net/inet_ecn.h> #include <net/dst_metadata.h> +void udp_v6_early_demux (struct sk_buff *); +void tcp_v6_early_demux (struct sk_buff *);int ip6_rcv_finish (struct net *net,struct sock *sk,struct sk_buff *skb) { -void (*edemux)(struct sk_buff *skb); -/* if ingress device is enslaved to an L3 master device pass the * skb to its handler for processing */
@@ -58,13 +58,20 @@ int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)if (!skb)return NET_RX_SUCCESS ; -if (net->ipv4.sysctl_ip_early_demux && !skb_dst (skb) && skb->sk ==NULL ) { -const struct inet6_protocol *ipprot; - - ipprot =rcu_dereference (inet6_protos[ipv6_hdr (skb)->nexthdr]); -if (ipprot && (edemux =READ_ONCE (ipprot->early_demux))) -edemux (skb); +if (READ_ONCE (net->ipv4.sysctl_ip_early_demux) && + !skb_dst (skb) && !skb->sk) { +switch (ipv6_hdr (skb)->nexthdr) { +case IPPROTO_TCP : +if (READ_ONCE (net->ipv4.sysctl_tcp_early_demux)) +tcp_v6_early_demux (skb); +break ; +case IPPROTO_UDP : +if (READ_ONCE (net->ipv4.sysctl_udp_early_demux)) +udp_v6_early_demux (skb); +break ; + } } +if (!skb_valid_dst (skb))ip6_route_input (skb);
net/ipv6/tcp_ipv6.c +2 -7
@@ -1635,7 +1635,7 @@ static int tcp_v6_rcv(struct sk_buff *skb) goto discard_it; } -static void tcp_v6_early_demux (struct sk_buff *skb) +void tcp_v6_early_demux (struct sk_buff *skb) {const struct ipv6hdr *hdr;const struct tcphdr *th;
@@ -1991,12 +1991,7 @@ struct proto tcpv6_prot = { .diag_destroy = tcp_abort, }; -/* thinking of making this const? Don't. -* early_demux can change based on sysctl. -*/ -static struct inet6_protocol tcpv6_protocol = { - .early_demux = tcp_v6_early_demux, - .early_demux_handler = tcp_v6_early_demux, +static const struct inet6_protocol tcpv6_protocol = { .handler = tcp_v6_rcv, .err_handler = tcp_v6_err, .flags =INET6_PROTO_NOPOLICY |INET6_PROTO_FINAL ,
net/ipv6/udp.c +2 -7
@@ -932,7 +932,7 @@ static struct sock *__udp6_lib_demux_lookup(struct net *net,return NULL ; } -static void udp_v6_early_demux (struct sk_buff *skb) +void udp_v6_early_demux (struct sk_buff *skb) {struct net *net =dev_net (skb->dev);const struct udphdr *uh;
@@ -1491,12 +1491,7 @@ int compat_udpv6_getsockopt(struct sock *sk, int level, int optname, }#endif -/* thinking of making this const? Don't. -* early_demux can change based on sysctl. -*/ -static struct inet6_protocol udpv6_protocol = { - .early_demux = udp_v6_early_demux, - .early_demux_handler = udp_v6_early_demux, +static const struct inet6_protocol udpv6_protocol = { .handler = udpv6_rcv, .err_handler = udpv6_err, .flags =INET6_PROTO_NOPOLICY |INET6_PROTO_FINAL ,
net/netfilter/ipvs/ip_vs_conn.c +2 -2
@@ -1240,8 +1240,8 @@ static inline int todrop_entry(struct ip_vs_conn *cp)* The drop rate array needs tuning for real environments. * Called from timer bh only => no locking */ -static const char todrop_rate[9 ] = {0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 }; -static char todrop_counter[9 ] = {0 }; +static const signed char todrop_rate[9 ] = {0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 }; +static signed char todrop_counter[9 ] = {0 };int i;/* if the conn entry hasn't lasted for 60 seconds, don't drop it.
net/rose/rose_link.c +3 -0
@@ -239,6 +239,9 @@ void rose_transmit_clear_request(struct rose_neigh *neigh, unsigned int lci, unsunsigned char *dptr;int len; +if (!neigh->dev) +return ; + len =AX25_BPQ_HEADER_LEN +AX25_MAX_HEADER_LEN +ROSE_MIN_LEN +3 ;if ((skb =alloc_skb (len,GFP_ATOMIC )) ==NULL )
net/sched/sch_red.c +3 -1
@@ -61,6 +61,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch, {struct red_sched_data *q =qdisc_priv (sch);struct Qdisc *child = q->qdisc; +unsigned int len;int ret; q->vars.qavg = red_calc_qavg(&q->parms,
@@ -96,9 +97,10 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch,break ; } + len =qdisc_pkt_len (skb); ret =qdisc_enqueue (skb, child, to_free);if (likely (ret ==NET_XMIT_SUCCESS )) { -qdisc_qstats_backlog_inc (sch, skb); + sch->qstats.backlog += len; sch->q.qlen++; }else if (net_xmit_drop_count (ret)) { q->stats.pdrop++;
security/commoncap.c +4 -2
@@ -398,8 +398,10 @@ int cap_inode_getsecurity(struct inode *inode, const char *name, void **buffer, &tmpbuf, size, GFP_NOFS);dput (dentry); -if (ret <0 || !tmpbuf) -return ret; +if (ret <0 || !tmpbuf) { + size = ret; + goto out_free; + } fs_ns = inode->i_sb->s_user_ns; cap = (struct vfs_cap_data *) tmpbuf;
sound/usb/quirks-table.h +58 -0
64 lines not on this page · raw message
sound/usb/quirks.c +1 -0
@@ -1128,6 +1128,7 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,case USB_ID (0x041e ,0x3f19 ):/* E-Mu 0204 USB */ set_format_emu_quirk (subs, fmt);break ; +case USB_ID (0x534d ,0x0021 ):/* MacroSilicon MS2100/MS2106 */ case USB_ID (0x534d ,0x2109 ):/* MacroSilicon MS2109 */ subs->stream_offset_adj =2 ;break ;