Linux 4.11.1
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 11 -SUBLEVEL = 0 +SUBLEVEL = 1 EXTRAVERSION = NAME = Fearless Coyote
arch/arm/include/asm/device.h +3 -0
@@ -16,6 +16,9 @@ struct dev_archdata {#ifdef CONFIG_ARM_DMA_USE_IOMMU struct dma_iommu_mapping *mapping;#endif +#ifdef CONFIG_XEN +const struct dma_map_ops *dev_dma_ops; +#endif bool dma_coherent; };
arch/arm/include/asm/dma-mapping.h +1 -11
@@ -16,19 +16,9 @@extern const struct dma_map_ops arm_dma_ops;extern const struct dma_map_ops arm_coherent_dma_ops; -static inline const struct dma_map_ops *__generic_dma_ops (struct device *dev) -{ -if (dev && dev->dma_ops) -return dev->dma_ops; -return &arm_dma_ops; -} -static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (xen_initial_domain ()) -return xen_dma_ops; -else -return __generic_dma_ops (NULL ); +return &arm_dma_ops; }#define HAVE_ARCH_DMA_SUPPORTED 1
arch/arm/mm/dma-mapping.c +7 -0
@@ -2414,6 +2414,13 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, dma_ops =arm_get_dma_map_ops (coherent);set_dma_ops (dev, dma_ops); + +#ifdef CONFIG_XEN +if (xen_initial_domain ()) { + dev->archdata.dev_dma_ops = dev->dma_ops; + dev->dma_ops = xen_dma_ops; + } +#endif }void arch_teardown_dma_ops (struct device *dev)
arch/arm64/include/asm/device.h +3 -0
@@ -20,6 +20,9 @@ struct dev_archdata {#ifdef CONFIG_IOMMU_API void *iommu;/* private IOMMU data */ #endif +#ifdef CONFIG_XEN +const struct dma_map_ops *dev_dma_ops; +#endif bool dma_coherent; };
arch/arm64/include/asm/dma-mapping.h +1 -12
@@ -27,11 +27,8 @@#define DMA_ERROR_CODE (~(dma_addr_t)0)extern const struct dma_map_ops dummy_dma_ops; -static inline const struct dma_map_ops *__generic_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (dev && dev->dma_ops) -return dev->dma_ops; -/* * We expect no ISA devices, and all other DMA masters are expected to * have someone call arch_setup_dma_ops at device creation time.
@@ -39,14 +36,6 @@ static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev)return &dummy_dma_ops; } -static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) -{ -if (xen_initial_domain ()) -return xen_dma_ops; -else -return __generic_dma_ops (NULL ); -} -void arch_setup_dma_ops (struct device *dev,u64 dma_base,u64 size,const struct iommu_ops *iommu,bool coherent);#define arch_setup_dma_ops arch_setup_dma_ops
arch/arm64/mm/dma-mapping.c +7 -0
@@ -977,4 +977,11 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, dev->archdata.dma_coherent = coherent;__iommu_setup_dma_ops (dev, dma_base, size, iommu); + +#ifdef CONFIG_XEN +if (xen_initial_domain ()) { + dev->archdata.dev_dma_ops = dev->dma_ops; + dev->dma_ops = xen_dma_ops; + } +#endif }
arch/arm64/net/bpf_jit_comp.c +4 -4
@@ -779,14 +779,14 @@ static int build_body(struct jit_ctx *ctx)int ret; ret =build_insn (insn, ctx); - -if (ctx->image ==NULL ) - ctx->offset[i] = ctx->idx; -if (ret >0 ) { i++; +if (ctx->image ==NULL ) + ctx->offset[i] = ctx->idx;continue ; } +if (ctx->image ==NULL ) + ctx->offset[i] = ctx->idx;if (ret)return ret; }
arch/sparc/kernel/head_64.S +6 -0
@@ -939,3 +939,9 @@ ENTRY(__retl_o1) retl mov %o1, %o0 ENDPROC(__retl_o1) + +ENTRY(__retl_o1_asi) + wr %o5, 0x0, %asi + retl + mov %o1, %o0 +ENDPROC(__retl_o1_asi)
arch/sparc/lib/GENbzero.S +1 -1
@@ -8,7 +8,7 @@ 98: x,y; \ .section __ex_table,"a";\ .align 4; \ - .word 98b, __retl_o1; \ + .word 98b, __retl_o1_asi;\ .text; \ .align 4;
arch/sparc/lib/NGbzero.S +1 -1
@@ -8,7 +8,7 @@ 98: x,y; \ .section __ex_table,"a";\ .align 4; \ - .word 98b, __retl_o1; \ + .word 98b, __retl_o1_asi;\ .text; \ .align 4;
arch/x86/include/asm/xen/events.h +11 -0
@@ -20,4 +20,15 @@ static inline int xen_irqs_disabled(struct pt_regs *regs)/* No need for a barrier -- XCHG is a barrier on x86. */ #define xchg_xen_ulong (ptr, val) xchg((ptr), (val)) +extern int xen_have_vector_callback; + +/* +* Events delivered via platform PCI interrupts are always +* routed to vcpu 0 and hence cannot be rebound. +*/ +static inline bool xen_support_evtchn_rebind (void ) +{ +return (!xen_hvm_domain () || xen_have_vector_callback); +} +#endif /* _ASM_X86_XEN_EVENTS_H */
arch/x86/pci/xen.c +1 -1
@@ -447,7 +447,7 @@ void __init xen_msi_init(void)int __init pci_xen_hvm_init (void ) { -if (!xen_feature (XENFEAT_hvm_pirqs)) +if (!xen_have_vector_callback || !xen_feature (XENFEAT_hvm_pirqs))return 0 ;#ifdef CONFIG_ACPI
arch/x86/xen/enlighten.c +11 -5
@@ -138,6 +138,8 @@ struct shared_info xen_dummy_shared_info;void *xen_initial_gdt;RESERVE_BRK (shared_info_page_brk,PAGE_SIZE ); +__read_mostly int xen_have_vector_callback; +EXPORT_SYMBOL_GPL (xen_have_vector_callback);static int xen_cpu_up_prepare (unsigned int cpu);static int xen_cpu_up_online (unsigned int cpu);
@@ -1861,7 +1863,9 @@ static int xen_cpu_up_prepare(unsigned int cpu)xen_vcpu_setup (cpu); } -if (xen_pv_domain () ||xen_feature (XENFEAT_hvm_safe_pvclock)) +if (xen_pv_domain () || + (xen_have_vector_callback && +xen_feature (XENFEAT_hvm_safe_pvclock)))xen_setup_timer (cpu); rc =xen_smp_intr_init (cpu);
@@ -1877,7 +1881,9 @@ static int xen_cpu_dead(unsigned int cpu) {xen_smp_intr_free (cpu); -if (xen_pv_domain () ||xen_feature (XENFEAT_hvm_safe_pvclock)) +if (xen_pv_domain () || + (xen_have_vector_callback && +xen_feature (XENFEAT_hvm_safe_pvclock)))xen_teardown_timer (cpu);return 0 ;
@@ -1916,8 +1922,8 @@ static void __init xen_hvm_guest_init(void)xen_panic_handler_init (); -BUG_ON (!xen_feature (XENFEAT_hvm_callback_vector)); - +if (xen_feature (XENFEAT_hvm_callback_vector)) + xen_have_vector_callback =1 ;xen_hvm_smp_init ();WARN_ON (xen_cpuhp_setup ());xen_unplug_emulated_devices ();
@@ -1958,7 +1964,7 @@ bool xen_hvm_need_lapic(void)return false;if (!xen_hvm_domain ())return false; -if (xen_feature (XENFEAT_hvm_pirqs)) +if (xen_feature (XENFEAT_hvm_pirqs) && xen_have_vector_callback)return false;return true; }
arch/x86/xen/smp.c +2 -0
@@ -742,6 +742,8 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus)void __init xen_hvm_smp_init (void ) { +if (!xen_have_vector_callback) +return ; smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus; smp_ops.smp_send_reschedule = xen_smp_send_reschedule; smp_ops.cpu_die = xen_cpu_die;
arch/x86/xen/time.c +5 -0
@@ -432,6 +432,11 @@ static void xen_hvm_setup_cpu_clockevents(void)void __init xen_hvm_init_time_ops (void ) { +/* vector callback is needed otherwise we cannot receive interrupts +* on cpu > 0 and at this point we don't know how many cpus are +* available */ +if (!xen_have_vector_callback) +return ;if (!xen_feature (XENFEAT_hvm_safe_pvclock)) {printk (KERN_INFO "Xen doesn't support pvclock on HVM," "disable pv timer\n" );
block/blk-integrity.c +2 -17
@@ -417,7 +417,7 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template bi->tuple_size = template->tuple_size; bi->tag_size = template->tag_size; -blk_integrity_revalidate (disk); + disk->queue->backing_dev_info->capabilities |=BDI_CAP_STABLE_WRITES ; }EXPORT_SYMBOL (blk_integrity_register);
@@ -430,26 +430,11 @@ EXPORT_SYMBOL(blk_integrity_register);*/ void blk_integrity_unregister (struct gendisk *disk) { -blk_integrity_revalidate (disk); + disk->queue->backing_dev_info->capabilities &= ~BDI_CAP_STABLE_WRITES ;memset (&disk->queue->integrity,0 ,sizeof (struct blk_integrity )); }EXPORT_SYMBOL (blk_integrity_unregister); -void blk_integrity_revalidate (struct gendisk *disk) -{ -struct blk_integrity *bi = &disk->queue->integrity; - -if (!(disk->flags &GENHD_FL_UP )) -return ; - -if (bi->profile) - disk->queue->backing_dev_info->capabilities |= -BDI_CAP_STABLE_WRITES ; -else - disk->queue->backing_dev_info->capabilities &= - ~BDI_CAP_STABLE_WRITES ; -} -void blk_integrity_add (struct gendisk *disk) { if (kobject_init_and_add(&disk->integrity_kobj, &integrity_ktype,
block/partition-generic.c +0 -1
@@ -497,7 +497,6 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)if (disk->fops->revalidate_disk) disk->fops->revalidate_disk (disk); -blk_integrity_revalidate (disk);check_disk_size_change (disk, bdev); bdev->bd_invalidated =0 ;if (!get_capacity (disk) || !(state =check_partition (disk, bdev)))
drivers/gpu/drm/sti/sti_gdp.c +7 -5
@@ -66,7 +66,9 @@ static struct gdp_format_to_str {#define GAM_GDP_ALPHARANGE_255 BIT(5)#define GAM_GDP_AGC_FULL_RANGE 0x00808080#define GAM_GDP_PPT_IGNORE (BIT(1) | BIT(0)) -#define GAM_GDP_SIZE_MAX 0x7FF + +#define GAM_GDP_SIZE_MAX_WIDTH 3840 +#define GAM_GDP_SIZE_MAX_HEIGHT 2160#define GDP_NODE_NB_BANK 2#define GDP_NODE_PER_FIELD 2
@@ -632,8 +634,8 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,/* src_x are in 16.16 format */ src_x = state->src_x >>16 ; src_y = state->src_y >>16 ; - src_w =clamp_val (state->src_w >>16 ,0 ,GAM_GDP_SIZE_MAX ); - src_h =clamp_val (state->src_h >>16 ,0 ,GAM_GDP_SIZE_MAX ); + src_w =clamp_val (state->src_w >>16 ,0 ,GAM_GDP_SIZE_MAX_WIDTH ); + src_h =clamp_val (state->src_h >>16 ,0 ,GAM_GDP_SIZE_MAX_HEIGHT ); format =sti_gdp_fourcc2format (fb->format->format);if (format ==-1 ) {
@@ -741,8 +743,8 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,/* src_x are in 16.16 format */ src_x = state->src_x >>16 ; src_y = state->src_y >>16 ; - src_w =clamp_val (state->src_w >>16 ,0 ,GAM_GDP_SIZE_MAX ); - src_h =clamp_val (state->src_h >>16 ,0 ,GAM_GDP_SIZE_MAX ); + src_w =clamp_val (state->src_w >>16 ,0 ,GAM_GDP_SIZE_MAX_WIDTH ); + src_h =clamp_val (state->src_h >>16 ,0 ,GAM_GDP_SIZE_MAX_HEIGHT ); list =sti_gdp_get_free_nodes (gdp); top_field = list->top_field;
drivers/md/dm-ioctl.c +1 -1
@@ -1848,7 +1848,7 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)if (r) goto out; - param->data_size =sizeof (*param); + param->data_size = offsetof(struct dm_ioctl , data); r =fn (param, input_param_size); if (unlikely(param->flags & DM_BUFFER_FULL_FLAG) &&
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -1
@@ -3000,7 +3000,8 @@ static int bnxt_alloc_ntp_fltrs(struct bnxt *bp)INIT_HLIST_HEAD (&bp->ntp_fltr_hash_tbl[i]); bp->ntp_fltr_count =0 ; - bp->ntp_fltr_bmap =kzalloc (BITS_TO_LONGS (BNXT_NTP_FLTR_MAX_FLTR ), + bp->ntp_fltr_bmap =kcalloc (BITS_TO_LONGS (BNXT_NTP_FLTR_MAX_FLTR ), +sizeof (long ),GFP_KERNEL );if (!bp->ntp_fltr_bmap)
drivers/net/ethernet/cadence/macb.c +10 -8
@@ -432,15 +432,17 @@ static int macb_mii_probe(struct net_device *dev) } pdata =dev_get_platdata (&bp->pdev->dev); -if (pdata &&gpio_is_valid (pdata->phy_irq_pin)) { - ret =devm_gpio_request (&bp->pdev->dev, pdata->phy_irq_pin, -"phy int" ); -if (!ret) { - phy_irq =gpio_to_irq (pdata->phy_irq_pin); - phydev->irq = (phy_irq <0 ) ?PHY_POLL : phy_irq; +if (pdata) { +if (gpio_is_valid (pdata->phy_irq_pin)) { + ret =devm_gpio_request (&bp->pdev->dev, + pdata->phy_irq_pin,"phy int" ); +if (!ret) { + phy_irq =gpio_to_irq (pdata->phy_irq_pin); + phydev->irq = (phy_irq <0 ) ?PHY_POLL : phy_irq; + } + }else { + phydev->irq =PHY_POLL ; } - }else { - phydev->irq =PHY_POLL ; }/* attach the mac to the phy */
drivers/net/geneve.c +1 -1
@@ -1244,7 +1244,7 @@ static int geneve_newlink(struct net *net, struct net_device *dev, metadata = true;if (data[IFLA_GENEVE_UDP_CSUM ] && - !nla_get_u8 (data[IFLA_GENEVE_UDP_CSUM ])) +nla_get_u8 (data[IFLA_GENEVE_UDP_CSUM ])) info.key.tun_flags |=TUNNEL_CSUM ; if (data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX] &&
drivers/net/phy/mdio-mux-bcm-iproc.c +4 -1
@@ -203,11 +203,14 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev) &md->mux_handle, md, md->mii_bus);if (rc) {dev_info (md->dev,"mdiomux initialization failed\n" ); - goto out; + goto out_register; }dev_info (md->dev,"iProc mdiomux registered\n" );return 0 ; + +out_register: +mdiobus_unregister (bus); out:mdiobus_free (bus);return rc;
drivers/net/usb/qmi_wwan.c +1 -0
@@ -907,6 +907,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */ + {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */ {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1201, 2)}, /* Telit LE920, LE920A4 */ {QMI_FIXED_INTF(0x1c9e, 0x9b01, 3)}, /* XS Stick W100-2 from 4G Systems */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +8 -15
@@ -198,7 +198,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,int ret;struct brcmf_if *ifp =netdev_priv (ndev);struct brcmf_pub *drvr = ifp->drvr; -struct ethhdr *eh = (struct ethhdr *)(skb->data); +struct ethhdr *eh;brcmf_dbg (DATA ,"Enter, bsscfgidx=%d\n" , ifp->bsscfgidx);
@@ -211,22 +211,13 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, goto done; } -/* Make sure there's enough room for any header */ -if (skb_headroom (skb) < drvr->hdrlen) { -struct sk_buff *skb2; - -brcmf_dbg (INFO ,"%s: insufficient headroom\n" , +/* Make sure there's enough writable headroom*/ + ret =skb_cow_head (skb, drvr->hdrlen); +if (ret <0 ) { +brcmf_err ("%s: skb_cow_head failed\n" ,brcmf_ifname (ifp)); - drvr->bus_if->tx_realloc++; - skb2 =skb_realloc_headroom (skb, drvr->hdrlen);dev_kfree_skb (skb); - skb = skb2; -if (skb ==NULL ) { -brcmf_err ("%s: skb_realloc_headroom failed\n" , -brcmf_ifname (ifp)); - ret = -ENOMEM ; - goto done; - } + goto done; }/* validate length for ether packet */
@@ -236,6 +227,8 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, goto done; } + eh = (struct ethhdr *)(skb->data); +if (eh->h_proto ==htons (ETH_P_PAE ))atomic_inc (&ifp->pend_8021x_cnt);
drivers/power/supply/lp8788-charger.c +1 -1
@@ -651,7 +651,7 @@ static ssize_t lp8788_show_eoc_time(struct device *dev, {struct lp8788_charger *pchg =dev_get_drvdata (dev);char *stime[] = {"400ms" ,"5min" ,"10min" ,"15min" , -"20min" ,"25min" ,"30min" "No timeout" }; +"20min" ,"25min" ,"30min" ,"No timeout" };u8 val;lp8788_read_byte (pchg->lp,LP8788_CHG_EOC , &val);
drivers/xen/events/events_base.c +17 -9
@@ -1312,6 +1312,9 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu)if (!VALID_EVTCHN (evtchn))return -1 ; +if (!xen_support_evtchn_rebind ()) +return -1 ; +/* Send future instances of this interrupt to other vcpu. */ bind_vcpu.port = evtchn; bind_vcpu.vcpu =xen_vcpu_nr (tcpu);
@@ -1645,15 +1648,20 @@ void xen_callback_vector(void) {int rc;uint64_t callback_via; - - callback_via =HVM_CALLBACK_VECTOR (HYPERVISOR_CALLBACK_VECTOR ); - rc =xen_set_callback_via (callback_via); -BUG_ON (rc); -pr_info ("Xen HVM callback vector for event delivery is enabled\n" ); -/* in the restore case the vector has already been allocated */ -if (!test_bit (HYPERVISOR_CALLBACK_VECTOR , used_vectors)) -alloc_intr_gate (HYPERVISOR_CALLBACK_VECTOR , - xen_hvm_callback_vector); +if (xen_have_vector_callback) { + callback_via =HVM_CALLBACK_VECTOR (HYPERVISOR_CALLBACK_VECTOR ); + rc =xen_set_callback_via (callback_via); +if (rc) { +pr_err ("Request for Xen HVM callback vector failed\n" ); + xen_have_vector_callback =0 ; +return ; + } +pr_info ("Xen HVM callback vector for event delivery is enabled\n" ); +/* in the restore case the vector has already been allocated */ +if (!test_bit (HYPERVISOR_CALLBACK_VECTOR , used_vectors)) +alloc_intr_gate (HYPERVISOR_CALLBACK_VECTOR , + xen_hvm_callback_vector); + } }#else void xen_callback_vector (void ) {}
drivers/xen/platform-pci.c +3 -10
@@ -67,7 +67,7 @@ static uint64_t get_callback_via(struct pci_dev *pdev) pin = pdev->pin;/* We don't know the GSI. Specify the PCI INTx line instead. */ -return ((uint64_t )0x01 <<HVM_CALLBACK_VIA_TYPE_SHIFT ) |/* PCI INTx identifier */ +return ((uint64_t )0x01 <<56 ) |/* PCI INTx identifier */ ((uint64_t )pci_domain_nr (pdev->bus) <<32 ) | ((uint64_t )pdev->bus->number <<16 ) | ((uint64_t)(pdev->devfn & 0xff) << 8) |
@@ -90,7 +90,7 @@ static int xen_allocate_irq(struct pci_dev *pdev)static int platform_pci_resume (struct pci_dev *pdev) {int err; -if (!xen_pv_domain ()) +if (xen_have_vector_callback)return 0 ; err =xen_set_callback_via (callback_via);if (err) {
@@ -138,14 +138,7 @@ static int platform_pci_probe(struct pci_dev *pdev, platform_mmio = mmio_addr; platform_mmiolen = mmio_len; -/* -* Xen HVM guests always use the vector callback mechanism. -* L1 Dom0 in a nested Xen environment is a PV guest inside in an -* HVM environment. It needs the platform-pci driver to get -* notifications from L0 Xen, but it cannot use the vector callback -* as it is not exported by L1 Xen. -*/ -if (xen_pv_domain ()) { +if (!xen_have_vector_callback) { ret =xen_allocate_irq (pdev);if (ret) {dev_warn (&pdev->dev,"request_irq failed err=%d\n" , ret);
fs/block_dev.c +0 -1
@@ -1451,7 +1451,6 @@ int revalidate_disk(struct gendisk *disk)if (disk->fops->revalidate_disk) ret = disk->fops->revalidate_disk (disk); -blk_integrity_revalidate (disk); bdev =bdget_disk (disk,0 );if (!bdev)return ret;
fs/f2fs/super.c +7 -0
@@ -1483,6 +1483,13 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi,return 1 ; } +if (le32_to_cpu (raw_super->segment_count) >F2FS_MAX_SEGMENT ) { +f2fs_msg (sb,KERN_INFO , +"Invalid segment count (%u)" , +le32_to_cpu (raw_super->segment_count)); +return 1 ; + } +/* check CP/SIT/NAT/SSA/MAIN_AREA area boundary */ if (sanity_check_area_boundary (sbi, bh))return 1 ;
include/linux/f2fs_fs.h +6 -0
@@ -302,6 +302,12 @@ struct f2fs_nat_block {#define SIT_ENTRY_PER_BLOCK (PAGE_SIZE / sizeof(struct f2fs_sit_entry))/* +* F2FS uses 4 bytes to represent block address. As a result, supported size of +* disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments. +*/ +#define F2FS_MAX_SEGMENT ((16 * 1024 * 1024) / 2) + +/* * Note that f2fs_sit_entry->vblocks has the following bit-field information. * [15:10] : allocation type such as CURSEG_XXXX_TYPE * [9:0] : valid block count
include/linux/genhd.h +0 -2
@@ -722,11 +722,9 @@ static inline void part_nr_sects_write(struct hd_struct *part, sector_t size)#if defined(CONFIG_BLK_DEV_INTEGRITY )extern void blk_integrity_add (struct gendisk *);extern void blk_integrity_del (struct gendisk *); -extern void blk_integrity_revalidate (struct gendisk *);#else /* CONFIG_BLK_DEV_INTEGRITY */ static inline void blk_integrity_add (struct gendisk *disk) { }static inline void blk_integrity_del (struct gendisk *disk) { } -static inline void blk_integrity_revalidate (struct gendisk *disk) { }#endif /* CONFIG_BLK_DEV_INTEGRITY */ #else /* CONFIG_BLOCK */
include/net/addrconf.h +2 -0
@@ -20,6 +20,8 @@#define ADDRCONF_TIMER_FUZZ (HZ / 4)#define ADDRCONF_TIMER_FUZZ_MAX (HZ) +#define ADDRCONF_NOTIFY_PRIORITY 0 +#include <linux/in.h> #include <linux/in6.h>
include/net/ip6_route.h +1 -0
@@ -84,6 +84,7 @@ struct dst_entry *ip6_route_lookup(struct net *net, struct flowi6 *fl6,struct rt6_info *ip6_pol_route (struct net *net,struct fib6_table *table,int ifindex,struct flowi6 *fl6,int flags); +void ip6_route_init_special_entries (void );int ip6_route_init (void );void ip6_route_cleanup (void );
include/net/secure_seq.h +6 -4
@@ -6,10 +6,12 @@u32 secure_ipv4_port_ephemeral (__be32 saddr,__be32 daddr,__be16 dport);u32 secure_ipv6_port_ephemeral (const __be32 *saddr,const __be32 *daddr,__be16 dport); -u32 secure_tcp_sequence_number (__be32 saddr,__be32 daddr, -__be16 sport,__be16 dport,u32 *tsoff); -u32 secure_tcpv6_sequence_number (const __be32 *saddr,const __be32 *daddr, -__be16 sport,__be16 dport,u32 *tsoff); +u32 secure_tcp_seq (__be32 saddr,__be32 daddr, +__be16 sport,__be16 dport); +u32 secure_tcp_ts_off (__be32 saddr,__be32 daddr); +u32 secure_tcpv6_seq (const __be32 *saddr,const __be32 *daddr, +__be16 sport,__be16 dport); +u32 secure_tcpv6_ts_off (const __be32 *saddr,const __be32 *daddr);u64 secure_dccp_sequence_number (__be32 saddr,__be32 daddr,__be16 sport,__be16 dport); u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr,
include/net/tcp.h +3 -2
@@ -471,7 +471,7 @@ void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);/* From syncookies.c */ struct sock *tcp_get_cookie_sock (struct sock *sk,struct sk_buff *skb,struct request_sock *req, -struct dst_entry *dst); +struct dst_entry *dst,u32 tsoff);int __cookie_v4_check (const struct iphdr *iph,const struct tcphdr *th,u32 cookie);struct sock *cookie_v4_check (struct sock *sk,struct sk_buff *skb);
@@ -1816,7 +1816,8 @@ struct tcp_request_sock_ops {struct dst_entry *(*route_req)(const struct sock *sk,struct flowi *fl,const struct request_sock *req,bool *strict); -__u32 (*init_seq)(const struct sk_buff *skb,u32 *tsoff); +u32 (*init_seq)(const struct sk_buff *skb); +u32 (*init_ts_off)(const struct sk_buff *skb); int (*send_synack)(const struct sock *sk, struct dst_entry *dst, struct flowi *fl, struct request_sock *req, struct tcp_fastopen_cookie *foc,
include/xen/arm/page-coherent.h +8 -0
@@ -2,8 +2,16 @@#define _ASM_ARM_XEN_PAGE_COHERENT_H#include <asm/page.h> +#include <asm/dma-mapping.h> #include <linux/dma-mapping.h> +static inline const struct dma_map_ops *__generic_dma_ops (struct device *dev) +{ +if (dev && dev->archdata.dev_dma_ops) +return dev->archdata.dev_dma_ops; +return get_arch_dma_ops (NULL ); +} +void __xen_dma_map_page (struct device *hwdev,struct page *page,dma_addr_t dev_addr,unsigned long offset,size_t size,enum dma_data_direction dir,unsigned long attrs);
kernel/bpf/verifier.c +27 -5
@@ -296,7 +296,8 @@ static const char *const bpf_jmp_string[16] = { [BPF_EXIT >> 4] = "exit", }; -static void print_bpf_insn (struct bpf_insn *insn) +static void print_bpf_insn (const struct bpf_verifier_env *env, +const struct bpf_insn *insn) {u8 class =BPF_CLASS (insn->code);
@@ -360,9 +361,19 @@ static void print_bpf_insn(struct bpf_insn *insn) insn->code, bpf_ldst_string[BPF_SIZE (insn->code) >>3 ], insn->src_reg, insn->imm); - }else if (BPF_MODE (insn->code) ==BPF_IMM ) { -verbose ("(%02x) r%d = 0x%x\n" , - insn->code, insn->dst_reg, insn->imm); + }else if (BPF_MODE (insn->code) ==BPF_IMM && +BPF_SIZE (insn->code) ==BPF_DW ) { +/* At this point, we already made sure that the second +* part of the ldimm64 insn is accessible. +*/ +u64 imm = ((u64)(insn +1 )->imm <<32 ) | (u32 )insn->imm; +bool map_ptr = insn->src_reg ==BPF_PSEUDO_MAP_FD ; + +if (map_ptr && !env->allow_ptr_leaks) + imm =0 ; + +verbose ("(%02x) r%d = 0x%llx\n" , insn->code, + insn->dst_reg, (unsigned long long )imm); }else {verbose ("BUG_ld_%02x\n" , insn->code);return ;
@@ -1911,6 +1922,17 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)return 0 ; }else if (opcode ==BPF_ADD &&BPF_CLASS (insn->code) ==BPF_ALU64 && + dst_reg->type ==PTR_TO_STACK && + ((BPF_SRC (insn->code) ==BPF_X && + regs[insn->src_reg].type ==CONST_IMM ) || +BPF_SRC (insn->code) ==BPF_K )) { +if (BPF_SRC (insn->code) ==BPF_X ) + dst_reg->imm += regs[insn->src_reg].imm; +else + dst_reg->imm += insn->imm; +return 0 ; + }else if (opcode ==BPF_ADD && +BPF_CLASS (insn->code) ==BPF_ALU64 && (dst_reg->type ==PTR_TO_PACKET || (BPF_SRC (insn->code) ==BPF_X && regs[insn->src_reg].type ==PTR_TO_PACKET ))) {
@@ -2824,7 +2846,7 @@ static int do_check(struct bpf_verifier_env *env)if (log_level) {verbose ("%d: " , insn_idx); -print_bpf_insn (insn); +print_bpf_insn (env, insn); } err =ext_analyzer_insn_hook (env, insn_idx, prev_insn_idx);
lib/refcount.c +11 -11
@@ -62,13 +62,13 @@ bool refcount_add_not_zero(unsigned int i, refcount_t *r)return true; } -EXPORT_SYMBOL_GPL (refcount_add_not_zero); +EXPORT_SYMBOL (refcount_add_not_zero);void refcount_add (unsigned int i,refcount_t *r) {WARN_ONCE (!refcount_add_not_zero (i, r),"refcount_t: addition on 0; use-after-free.\n" ); } -EXPORT_SYMBOL_GPL (refcount_add); +EXPORT_SYMBOL (refcount_add);/* * Similar to atomic_inc_not_zero(), will saturate at UINT_MAX and WARN.
@@ -101,7 +101,7 @@ bool refcount_inc_not_zero(refcount_t *r)return true; } -EXPORT_SYMBOL_GPL (refcount_inc_not_zero); +EXPORT_SYMBOL (refcount_inc_not_zero);/* * Similar to atomic_inc(), will saturate at UINT_MAX and WARN.
@@ -113,7 +113,7 @@ void refcount_inc(refcount_t *r) {WARN_ONCE (!refcount_inc_not_zero (r),"refcount_t: increment on 0; use-after-free.\n" ); } -EXPORT_SYMBOL_GPL (refcount_inc); +EXPORT_SYMBOL (refcount_inc);bool refcount_sub_and_test (unsigned int i,refcount_t *r) {
@@ -138,7 +138,7 @@ bool refcount_sub_and_test(unsigned int i, refcount_t *r)return !new; } -EXPORT_SYMBOL_GPL (refcount_sub_and_test); +EXPORT_SYMBOL (refcount_sub_and_test);/* * Similar to atomic_dec_and_test(), it will WARN on underflow and fail to
@@ -152,7 +152,7 @@ bool refcount_dec_and_test(refcount_t *r) {return refcount_sub_and_test (1 , r); } -EXPORT_SYMBOL_GPL (refcount_dec_and_test); +EXPORT_SYMBOL (refcount_dec_and_test);/* * Similar to atomic_dec(), it will WARN on underflow and fail to decrement
@@ -166,7 +166,7 @@ void refcount_dec(refcount_t *r) {WARN_ONCE (refcount_dec_and_test (r),"refcount_t: decrement hit 0; leaking memory.\n" ); } -EXPORT_SYMBOL_GPL (refcount_dec); +EXPORT_SYMBOL (refcount_dec);/* * No atomic_t counterpart, it attempts a 1 -> 0 transition and returns the
@@ -183,7 +183,7 @@ bool refcount_dec_if_one(refcount_t *r) {return atomic_cmpxchg_release (&r->refs,1 ,0 ) ==1 ; } -EXPORT_SYMBOL_GPL (refcount_dec_if_one); +EXPORT_SYMBOL (refcount_dec_if_one);/* * No atomic_t counterpart, it decrements unless the value is 1, in which case
@@ -217,7 +217,7 @@ bool refcount_dec_not_one(refcount_t *r)return true; } -EXPORT_SYMBOL_GPL (refcount_dec_not_one); +EXPORT_SYMBOL (refcount_dec_not_one);/* * Similar to atomic_dec_and_mutex_lock(), it will WARN on underflow and fail
@@ -240,7 +240,7 @@ bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock)return true; } -EXPORT_SYMBOL_GPL (refcount_dec_and_mutex_lock); +EXPORT_SYMBOL (refcount_dec_and_mutex_lock);/* * Similar to atomic_dec_and_lock(), it will WARN on underflow and fail to
@@ -263,5 +263,5 @@ bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock)return true; } -EXPORT_SYMBOL_GPL (refcount_dec_and_lock); +EXPORT_SYMBOL (refcount_dec_and_lock);
lib/test_bpf.c +45 -0
51 lines not on this page · raw message
net/core/rtnetlink.c +1 -1
@@ -1056,7 +1056,7 @@ static int rtnl_phys_port_name_fill(struct sk_buff *skb, struct net_device *dev)return err; } -if (nla_put (skb,IFLA_PHYS_PORT_NAME ,strlen (name), name)) +if (nla_put_string (skb,IFLA_PHYS_PORT_NAME , name))return -EMSGSIZE ;return 0 ;
net/core/secure_seq.c +20 -14
@@ -24,9 +24,13 @@ static siphash_key_t ts_secret __read_mostly; static __always_inline void net_secret_init(void) { -net_get_random_once (&ts_secret,sizeof (ts_secret));net_get_random_once (&net_secret,sizeof (net_secret)); } + +static __always_inline void ts_secret_init(void) +{ +net_get_random_once (&ts_secret,sizeof (ts_secret)); +}#endif #ifdef CONFIG_INET
@@ -47,7 +51,7 @@ static u32 seq_scale(u32 seq)#endif #if IS_ENABLED (CONFIG_IPV6 ) -static u32 secure_tcpv6_ts_off (const __be32 *saddr,const __be32 *daddr) +u32 secure_tcpv6_ts_off (const __be32 *saddr,const __be32 *daddr) { const struct { struct in6_addr saddr;
@@ -60,12 +64,14 @@ static u32 secure_tcpv6_ts_off(const __be32 *saddr, const __be32 *daddr)if (sysctl_tcp_timestamps !=1 )return 0 ; +ts_secret_init ();return siphash (&combined,offsetofend (typeof (combined), daddr), &ts_secret); } +EXPORT_SYMBOL (secure_tcpv6_ts_off); -u32 secure_tcpv6_sequence_number (const __be32 *saddr,const __be32 *daddr, -__be16 sport,__be16 dport,u32 *tsoff) +u32 secure_tcpv6_seq (const __be32 *saddr,const __be32 *daddr, +__be16 sport,__be16 dport) { const struct { struct in6_addr saddr;
@@ -78,14 +84,14 @@ u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, .sport = sport, .dport = dport }; -u64 hash; +u32 hash; +net_secret_init (); hash =siphash (&combined,offsetofend (typeof (combined), dport), &net_secret); - *tsoff =secure_tcpv6_ts_off (saddr, daddr);return seq_scale (hash); } -EXPORT_SYMBOL (secure_tcpv6_sequence_number); +EXPORT_SYMBOL (secure_tcpv6_seq);u32 secure_ipv6_port_ephemeral (const __be32 *saddr,const __be32 *daddr,__be16 dport)
@@ -107,30 +113,30 @@ EXPORT_SYMBOL(secure_ipv6_port_ephemeral);#endif #ifdef CONFIG_INET -static u32 secure_tcp_ts_off (__be32 saddr,__be32 daddr) +u32 secure_tcp_ts_off (__be32 saddr,__be32 daddr) {if (sysctl_tcp_timestamps !=1 )return 0 ; +ts_secret_init ();return siphash_2u32 ((__force u32 )saddr, (__force u32 )daddr, &ts_secret); } -/* secure_tcp_sequence_number(a, b, 0, d) == secure_ipv4_port_ephemeral(a, b, d), +/* secure_tcp_seq_and_tsoff(a, b, 0, d) == secure_ipv4_port_ephemeral(a, b, d), * but fortunately, `sport' cannot be 0 in any circumstances. If this changes, * it would be easy enough to have the former function use siphash_4u32, passing * the arguments as separate u32. */ - -u32 secure_tcp_sequence_number (__be32 saddr,__be32 daddr, -__be16 sport,__be16 dport,u32 *tsoff) +u32 secure_tcp_seq (__be32 saddr,__be32 daddr, +__be16 sport,__be16 dport) { -u64 hash; +u32 hash; +net_secret_init (); hash =siphash_3u32 ((__force u32 )saddr, (__force u32 )daddr, (__force u32 )sport <<16 | (__force u32 )dport, &net_secret); - *tsoff =secure_tcp_ts_off (saddr, daddr);return seq_scale (hash); }
net/ipv4/raw.c +3 -0
@@ -358,6 +358,9 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4, rt->dst.dev->mtu);return -EMSGSIZE ; } +if (length <sizeof (struct iphdr )) +return -EINVAL ; +if (flags&MSG_PROBE ) goto out;
net/ipv4/syncookies.c +10 -2
@@ -16,6 +16,7 @@#include <linux/siphash.h> #include <linux/kernel.h> #include <linux/export.h> +#include <net/secure_seq.h> #include <net/tcp.h> #include <net/route.h>
@@ -203,7 +204,7 @@ EXPORT_SYMBOL_GPL(__cookie_v4_check);struct sock *tcp_get_cookie_sock (struct sock *sk,struct sk_buff *skb,struct request_sock *req, -struct dst_entry *dst) +struct dst_entry *dst,u32 tsoff) {struct inet_connection_sock *icsk =inet_csk (sk);struct sock *child;
@@ -213,6 +214,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb, NULL, &own_req);if (child) {atomic_set (&req->rsk_refcnt,1 ); +tcp_sk (child)->tsoffset = tsoff;sock_rps_save_rxhash (child, skb);inet_csk_reqsk_queue_add (sk, req, child); }else {
@@ -292,6 +294,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)struct rtable *rt;__u8 rcv_wscale;struct flowi4 fl4; +u32 tsoff =0 ;if (!sock_net (sk)->ipv4.sysctl_tcp_syncookies || !th->ack || th->rst) goto out;
@@ -311,6 +314,11 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)memset (&tcp_opt,0 ,sizeof (tcp_opt));tcp_parse_options (skb, &tcp_opt,0 ,NULL ); +if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { + tsoff =secure_tcp_ts_off (ip_hdr (skb)->daddr,ip_hdr (skb)->saddr); + tcp_opt.rcv_tsecr -= tsoff; + } +if (!cookie_timestamp_decode (&tcp_opt)) goto out;
@@ -381,7 +389,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok =cookie_ecn_ok (&tcp_opt,sock_net (sk), &rt->dst); - ret =tcp_get_cookie_sock (sk, skb, req, &rt->dst); + ret =tcp_get_cookie_sock (sk, skb, req, &rt->dst, tsoff);/* ip_queue_xmit() depends on our flow being setup * Normal sockets get it right from inet_csk_route_child_sock() */
net/ipv4/tcp.c +1 -1
@@ -533,7 +533,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)if (tp->urg_data &TCP_URG_VALID ) mask |=POLLPRI ; - }else if (sk->sk_state ==TCP_SYN_SENT &&inet_sk (sk)->defer_connect) { + }else if (state ==TCP_SYN_SENT &&inet_sk (sk)->defer_connect) {/* Active TCP fastopen socket with defer_connect * Return POLLOUT so application can call write() * in order for kernel to generate SYN+data
net/ipv4/tcp_input.c +3 -5
@@ -85,7 +85,6 @@ int sysctl_tcp_dsack __read_mostly = 1;int sysctl_tcp_app_win__read_mostly =31 ;int sysctl_tcp_adv_win_scale__read_mostly =1 ;EXPORT_SYMBOL (sysctl_tcp_adv_win_scale); -EXPORT_SYMBOL (sysctl_tcp_timestamps);/* rfc5961 challenge ack rate limiting */ int sysctl_tcp_challenge_ack_limit =1000 ;
@@ -6332,8 +6331,8 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,if (security_inet_conn_request (sk, skb, req)) goto drop_and_free; -if (isn && tmp_opt.tstamp_ok) - af_ops->init_seq (skb, &tcp_rsk (req)->ts_off); +if (tmp_opt.tstamp_ok) +tcp_rsk (req)->ts_off = af_ops->init_ts_off (skb);if (!want_cookie && !isn) {/* VJ's idea. We save last timestamp seen
@@ -6375,7 +6374,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, goto drop_and_release; } - isn = af_ops->init_seq (skb, &tcp_rsk (req)->ts_off); + isn = af_ops->init_seq (skb); }if (!dst) { dst = af_ops->route_req (sk, &fl, req,NULL );
@@ -6387,7 +6386,6 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,if (want_cookie) { isn =cookie_init_sequence (af_ops, sk, skb, &req->mss); -tcp_rsk (req)->ts_off =0 ; req->cookie_ts = tmp_opt.tstamp_ok;if (!tmp_opt.tstamp_ok)inet_rsk (req)->ecn_ok =0 ;
net/ipv4/tcp_ipv4.c +19 -13
@@ -94,12 +94,18 @@ static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key,struct inet_hashinfo tcp_hashinfo;EXPORT_SYMBOL (tcp_hashinfo); -static u32 tcp_v4_init_sequence (const struct sk_buff *skb,u32 *tsoff) +static u32 tcp_v4_init_seq (const struct sk_buff *skb) { -return secure_tcp_sequence_number (ip_hdr (skb)->daddr, -ip_hdr (skb)->saddr, -tcp_hdr (skb)->dest, -tcp_hdr (skb)->source, tsoff); +return secure_tcp_seq (ip_hdr (skb)->daddr, +ip_hdr (skb)->saddr, +tcp_hdr (skb)->dest, +tcp_hdr (skb)->source); +} + +static u32 tcp_v4_init_ts_off (const struct sk_buff *skb) +{ +return secure_tcp_ts_off (ip_hdr (skb)->daddr, +ip_hdr (skb)->saddr); }int tcp_twsk_unique (struct sock *sk,struct sock *sktw,void *twp)
@@ -145,7 +151,6 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)struct flowi4 *fl4;struct rtable *rt;int err; -u32 seq;struct ip_options_rcu *inet_opt;struct inet_timewait_death_row *tcp_death_row = &sock_net (sk)->ipv4.tcp_death_row;
@@ -236,13 +241,13 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) rt =NULL ;if (likely (!tp->repair)) { - seq =secure_tcp_sequence_number (inet->inet_saddr, - inet->inet_daddr, - inet->inet_sport, - usin->sin_port, - &tp->tsoffset);if (!tp->write_seq) - tp->write_seq = seq; + tp->write_seq =secure_tcp_seq (inet->inet_saddr, + inet->inet_daddr, + inet->inet_sport, + usin->sin_port); + tp->tsoffset =secure_tcp_ts_off (inet->inet_saddr, + inet->inet_daddr); } inet->inet_id = tp->write_seq ^ jiffies;
@@ -1253,7 +1258,8 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { .cookie_init_seq = cookie_v4_init_sequence, #endif .route_req = tcp_v4_route_req, - .init_seq = tcp_v4_init_sequence, + .init_seq = tcp_v4_init_seq, + .init_ts_off = tcp_v4_init_ts_off, .send_synack = tcp_v4_send_synack, };
net/ipv4/tcp_lp.c +4 -2
@@ -264,13 +264,15 @@ static void tcp_lp_pkts_acked(struct sock *sk, const struct ack_sample *sample) {struct tcp_sock *tp =tcp_sk (sk);struct lp *lp =inet_csk_ca (sk); +u32 delta;if (sample->rtt_us >0 )tcp_lp_rtt_sample (sk, sample->rtt_us);/* calc inference */ -if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) - lp->inference =3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr); + delta = tcp_time_stamp - tp->rx_opt.rcv_tsecr; +if ((s32 )delta >0 ) + lp->inference =3 * delta;/* test if within inference */ if (lp->last_drop && (tcp_time_stamp - lp->last_drop < lp->inference))
net/ipv4/tcp_minisocks.c +1 -0
@@ -536,6 +536,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newicsk->icsk_ack.last_seg_size = skb->len - newtp->tcp_header_len; newtp->rx_opt.mss_clamp = req->mss;tcp_ecn_openreq_child (newtp, req); + newtp->fastopen_req =NULL ; newtp->fastopen_rsk =NULL ; newtp->syn_data_acked =0 ; newtp->rack.mstamp.v64 =0 ;
net/ipv6/addrconf.c +6 -2
@@ -3296,7 +3296,8 @@ static int fixup_permanent_addr(struct inet6_dev *idev, idev->dev, 0, 0); } -addrconf_dad_start (ifp); +if (ifp->state ==INET6_IFADDR_STATE_PREDAD ) +addrconf_dad_start (ifp);return 0 ; }
@@ -3515,6 +3516,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,*/ static struct notifier_block ipv6_dev_notf = { .notifier_call = addrconf_notify, + .priority =ADDRCONF_NOTIFY_PRIORITY , };static void addrconf_type_change (struct net_device *dev,unsigned long event)
@@ -3651,7 +3653,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)if (keep) {/* set state to skip the notifier below */ state =INET6_IFADDR_STATE_DEAD ; - ifa->state =0 ; + ifa->state =INET6_IFADDR_STATE_PREDAD ;if (!(ifa->flags &IFA_F_NODAD )) ifa->flags |=IFA_F_TENTATIVE ;
@@ -6408,6 +6410,8 @@ int __init addrconf_init(void) goto errlo; } +ip6_route_init_special_entries (); +for (i =0 ; i <IN6_ADDR_HSIZE ; i++)INIT_HLIST_HEAD (&inet6_addr_lst[i]);
net/ipv6/raw.c +2 -0
@@ -632,6 +632,8 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,ipv6_local_error (sk,EMSGSIZE , fl6, rt->dst.dev->mtu);return -EMSGSIZE ; } +if (length <sizeof (struct ipv6hdr )) +return -EINVAL ;if (flags&MSG_PROBE ) goto out;
net/ipv6/route.c +26 -13
@@ -3704,7 +3704,10 @@ static int ip6_route_dev_notify(struct notifier_block *this,struct net_device *dev =netdev_notifier_info_to_dev (ptr);struct net *net =dev_net (dev); -if (event ==NETDEV_REGISTER && (dev->flags &IFF_LOOPBACK )) { +if (!(dev->flags &IFF_LOOPBACK )) +return NOTIFY_OK ; + +if (event ==NETDEV_REGISTER ) { net->ipv6.ip6_null_entry->dst.dev = dev; net->ipv6.ip6_null_entry->rt6i_idev =in6_dev_get (dev);#ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -3713,6 +3716,12 @@ static int ip6_route_dev_notify(struct notifier_block *this, net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev =in6_dev_get (dev);#endif + }else if (event ==NETDEV_UNREGISTER ) { +in6_dev_put (net->ipv6.ip6_null_entry->rt6i_idev); +#ifdef CONFIG_IPV6_MULTIPLE_TABLES +in6_dev_put (net->ipv6.ip6_prohibit_entry->rt6i_idev); +in6_dev_put (net->ipv6.ip6_blk_hole_entry->rt6i_idev); +#endif }return NOTIFY_OK ;
@@ -4019,9 +4028,24 @@ static struct pernet_operations ip6_route_net_late_ops = {static struct notifier_block ip6_route_dev_notifier = { .notifier_call = ip6_route_dev_notify, - .priority =0 , + .priority =ADDRCONF_NOTIFY_PRIORITY -10 , }; +void __init ip6_route_init_special_entries (void ) +{ +/* Registering of the loopback is done before this portion of code, +* the loopback reference in rt6_info will not be taken, do it +* manually for init_net */ + init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_null_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + init_net.ipv6.ip6_prohibit_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_prohibit_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); + init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_blk_hole_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); +#endif +} +int __init ip6_route_init (void ) {int ret;
@@ -4048,17 +4072,6 @@ int __init ip6_route_init(void) ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops_template.kmem_cachep; -/* Registering of the loopback is done before this portion of code, -* the loopback reference in rt6_info will not be taken, do it -* manually for init_net */ - init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev; - init_net.ipv6.ip6_null_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); -#ifdef CONFIG_IPV6_MULTIPLE_TABLES - init_net.ipv6.ip6_prohibit_entry->dst.dev = init_net.loopback_dev; - init_net.ipv6.ip6_prohibit_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); - init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; - init_net.ipv6.ip6_blk_hole_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); -#endif ret =fib6_init ();if (ret) goto out_register_subsys;
net/ipv6/syncookies.c +9 -1
@@ -18,6 +18,7 @@#include <linux/random.h> #include <linux/siphash.h> #include <linux/kernel.h> +#include <net/secure_seq.h> #include <net/ipv6.h> #include <net/tcp.h>
@@ -143,6 +144,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)int mss;struct dst_entry *dst;__u8 rcv_wscale; +u32 tsoff =0 ;if (!sock_net (sk)->ipv4.sysctl_tcp_syncookies || !th->ack || th->rst) goto out;
@@ -162,6 +164,12 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)memset (&tcp_opt,0 ,sizeof (tcp_opt));tcp_parse_options (skb, &tcp_opt,0 ,NULL ); +if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { + tsoff =secure_tcpv6_ts_off (ipv6_hdr (skb)->daddr.s6_addr32, +ipv6_hdr (skb)->saddr.s6_addr32); + tcp_opt.rcv_tsecr -= tsoff; + } +if (!cookie_timestamp_decode (&tcp_opt)) goto out;
@@ -242,7 +250,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok =cookie_ecn_ok (&tcp_opt,sock_net (sk), dst); - ret =tcp_get_cookie_sock (sk, skb, req, dst); + ret =tcp_get_cookie_sock (sk, skb, req, dst, tsoff); out:return ret; out_free:
net/ipv6/tcp_ipv6.c +19 -13
@@ -101,12 +101,18 @@ static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb) } } -static u32 tcp_v6_init_sequence (const struct sk_buff *skb,u32 *tsoff) +static u32 tcp_v6_init_seq (const struct sk_buff *skb) { -return secure_tcpv6_sequence_number (ipv6_hdr (skb)->daddr.s6_addr32, -ipv6_hdr (skb)->saddr.s6_addr32, -tcp_hdr (skb)->dest, -tcp_hdr (skb)->source, tsoff); +return secure_tcpv6_seq (ipv6_hdr (skb)->daddr.s6_addr32, +ipv6_hdr (skb)->saddr.s6_addr32, +tcp_hdr (skb)->dest, +tcp_hdr (skb)->source); +} + +static u32 tcp_v6_init_ts_off (const struct sk_buff *skb) +{ +return secure_tcpv6_ts_off (ipv6_hdr (skb)->daddr.s6_addr32, +ipv6_hdr (skb)->saddr.s6_addr32); } static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
@@ -122,7 +128,6 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,struct flowi6 fl6;struct dst_entry *dst;int addr_type; -u32 seq;int err;struct inet_timewait_death_row *tcp_death_row = &sock_net (sk)->ipv4.tcp_death_row;
@@ -287,13 +292,13 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,sk_set_txhash (sk);if (likely (!tp->repair)) { - seq =secure_tcpv6_sequence_number (np->saddr.s6_addr32, - sk->sk_v6_daddr.s6_addr32, - inet->inet_sport, - inet->inet_dport, - &tp->tsoffset);if (!tp->write_seq) - tp->write_seq = seq; + tp->write_seq =secure_tcpv6_seq (np->saddr.s6_addr32, + sk->sk_v6_daddr.s6_addr32, + inet->inet_sport, + inet->inet_dport); + tp->tsoffset =secure_tcpv6_ts_off (np->saddr.s6_addr32, + sk->sk_v6_daddr.s6_addr32); }if (tcp_fastopen_defer_connect (sk, &err))
@@ -757,7 +762,8 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { .cookie_init_seq = cookie_v6_init_sequence, #endif .route_req = tcp_v6_route_req, - .init_seq = tcp_v6_init_sequence, + .init_seq = tcp_v6_init_seq, + .init_ts_off = tcp_v6_init_ts_off, .send_synack = tcp_v6_send_synack, };
tools/testing/selftests/bpf/test_verifier.c +12 -6
@@ -1809,16 +1809,22 @@ static struct bpf_test tests[] = { .result = ACCEPT, }, { - "unpriv: obfuscate stack pointer", + "stack pointer arithmetic", .insns = { -BPF_MOV64_REG (BPF_REG_2 ,BPF_REG_10 ), -BPF_ALU64_IMM (BPF_ADD ,BPF_REG_2 ,-8 ), -BPF_ALU64_IMM (BPF_ADD ,BPF_REG_2 ,-8 ), +BPF_MOV64_IMM (BPF_REG_1 ,4 ), +BPF_JMP_IMM (BPF_JA ,0 ,0 ,0 ), +BPF_MOV64_REG (BPF_REG_7 ,BPF_REG_10 ), +BPF_ALU64_IMM (BPF_ADD ,BPF_REG_7 ,-10 ), +BPF_ALU64_IMM (BPF_ADD ,BPF_REG_7 ,-10 ), +BPF_MOV64_REG (BPF_REG_2 ,BPF_REG_7 ), +BPF_ALU64_REG (BPF_ADD ,BPF_REG_2 ,BPF_REG_1 ), +BPF_ST_MEM (0 ,BPF_REG_2 ,4 ,0 ), +BPF_MOV64_REG (BPF_REG_2 ,BPF_REG_7 ), +BPF_ALU64_IMM (BPF_ADD ,BPF_REG_2 ,8 ), +BPF_ST_MEM (0 ,BPF_REG_2 ,4 ,0 ),BPF_MOV64_IMM (BPF_REG_0 ,0 ), BPF_EXIT_INSN(), }, - .errstr_unpriv ="R2 pointer arithmetic" , - .result_unpriv = REJECT, .result = ACCEPT, }, {
Greg KH
maintainerI'm announcing the release of the 4.11.1 kernel.
All users of the 4.11 kernel series must upgrade.
The updated 4.11.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.11.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/include/asm/device.h | 3 + arch/arm/include/asm/dma-mapping.h | 12 ---- arch/arm/mm/dma-mapping.c | 7 ++ arch/arm64/include/asm/device.h | 3 + arch/arm64/include/asm/dma-mapping.h | 13 ---- arch/arm64/mm/dma-mapping.c | 7 ++ arch/arm64/net/bpf_jit_comp.c | 8 +- arch/sparc/kernel/head_64.S | 6 ++ arch/sparc/lib/GENbzero.S | 2 arch/sparc/lib/NGbzero.S | 2 arch/x86/include/asm/xen/events.h | 11 +++ arch/x86/pci/xen.c | 2 arch/x86/xen/enlighten.c | 16 +++-- arch/x86/xen/smp.c | 2 arch/x86/xen/time.c | 5 + block/blk-integrity.c | 19 ------ block/partition-generic.c | 1 drivers/gpu/drm/sti/sti_gdp.c | 12 ++-- drivers/md/dm-ioctl.c | 2 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 - drivers/net/ethernet/cadence/macb.c | 18 +++--- drivers/net/geneve.c | 2 drivers/net/phy/mdio-mux-bcm-iproc.c | 5 + drivers/net/usb/qmi_wwan.c | 1 drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 23 ++------ drivers/power/supply/lp8788-charger.c | 2 drivers/xen/events/events_base.c | 26 ++++++--- drivers/xen/platform-pci.c | 13 +--- fs/block_dev.c | 1 fs/f2fs/super.c | 7 ++ include/linux/f2fs_fs.h | 6 ++ include/linux/genhd.h | 2 include/net/addrconf.h | 2 include/net/ip6_route.h | 1 include/net/secure_seq.h | 10 ++- include/net/tcp.h | 5 + include/xen/arm/page-coherent.h | 8 ++ kernel/bpf/verifier.c | 32 +++++++++-- lib/refcount.c | 22 +++---- lib/test_bpf.c | 45 ++++++++++++++++ net/core/rtnetlink.c | 2 net/core/secure_seq.c | 34 +++++++----- net/ipv4/raw.c | 3 + net/ipv4/syncookies.c | 12 +++- net/ipv4/tcp.c | 2 net/ipv4/tcp_input.c | 8 +- net/ipv4/tcp_ipv4.c | 32 ++++++----- net/ipv4/tcp_lp.c | 6 +- net/ipv4/tcp_minisocks.c | 1 net/ipv6/addrconf.c | 8 ++ net/ipv6/raw.c | 2 net/ipv6/route.c | 39 +++++++++---- net/ipv6/syncookies.c | 10 +++ net/ipv6/tcp_ipv6.c | 32 ++++++----- tools/testing/selftests/bpf/test_verifier.c | 18 ++++-- 56 files changed, 374 insertions(+), 204 deletions(-)
Adrian Salido (1):
dm ioctl: prevent stack leak in dm ioctl call
Alexander Potapenko (1):
ipv4, ipv6: ensure raw socket message is big enough to hold an IP header
Alexandre Belloni (1):
net: macb: fix phy interrupt parsing
Boris Ostrovsky (1):
xen: Revert commits da72ff5bfcb0 and 72a9b186292d
Dan Carpenter (1):
bnxt_en: allocate enough space for ->ntp_fltr_bmap
Daniel Borkmann (2):
bpf, arm64: fix jit branch offset related to ldimm64
bpf: don't let ldimm64 leak map addresses on unprivileged
Daniele Palmas (1):
net: usb: qmi_wwan: add Telit ME910 support
Dave Aldridge (1):
sparc64: fix fault handling in NGbzero.S and GENbzero.S
David Ahern (1):
net: ipv6: Do not duplicate DAD on link up
Davide Caratti (1):
tcp: fix access to sk->sk_state in tcp_poll()
Eric Dumazet (3):
tcp: fix wraparound issue in tcp_lp
tcp: do not inherit fastopen_req from parent
tcp: randomize timestamps on syncookies
Giedrius Statkevičius (1):
power: supply: lp8788: prevent out of bounds array access
Girish Moodalbail (1):
geneve: fix incorrect setting of UDP checksum flag
Greg Kroah-Hartman (2):
refcount: change EXPORT_SYMBOL markings
Linux 4.11.1
Ilya Dryomov (1):
block: get rid of blk_integrity_revalidate()
James Hughes (2):
brcmfmac: Ensure pointer correctly set if skb data location changes
brcmfmac: Make skb header writable before use
Jin Qian (1):
f2fs: sanity check segment count
Jon Mason (1):
net: mdio-mux: bcm-iproc: call mdiobus_free() in error path
Michal Schmidt (1):
rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string
Stefano Stabellini (1):
xen/arm,arm64: fix xen_dma_ops after 815dd18 "Consolidate get_dma_ops..."
Vincent Abriou (1):
drm/sti: fix GDP size to support up to UHD resolution
WANG Cong (2):
ipv6: initialize route null entry in addrconf_init()
ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf
Yonghong Song (1):
bpf: enhance verifier to understand stack pointer arithmetic