Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680105 > unrolled thread

[PATCH 4.9 000/172] 4.9.36-stable review

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-07-03 15:50 +0200
Last post2017-07-05 07:40 +0200
Articles 20 on this page of 136 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 4.9 000/172] 4.9.36-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 073/172] net: ethtool: Initialize buffer when querying device channel settings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 104/172] mac80211: recalculate min channel width on VHT opmode changes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 134/172] ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 013/172] proc: snmp6: Use correct type in memset Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 126/172] be2net: dont delete MAC on close on unprivileged BE3 VFs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 051/172] sparc64: Handle PIO & MEM non-resumable errors. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 128/172] perf probe: Fix to show correct locations for events on modules Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 151/172] tools arch: Sync arch/x86/lib/memcpy_64.S with the kernel Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 109/172] arm64: assembler: make adr_l work in modules under KASLR Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 167/172] mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 035/172] MIPS: pm-cps: Drop manual cache-line alignment of ready_count Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200
    [PATCH 4.9 130/172] tipc: allocate user memory with GFP_KERNEL flag Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:10 +0200
    [PATCH 4.9 169/172] KVM: x86: fix emulation of RSM and IRET instructions Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:10 +0200
    [PATCH 4.9 168/172] arm64: fix NULL dereference in have_cpu_die() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:10 +0200
    [PATCH 4.9 125/172] be2net: fix status check in be_cmd_pmac_add() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:10 +0200
    [PATCH 4.9 133/172] sctp: check af before verify address in sctp_addr_id2transport Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:10 +0200
    [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated functions in modules Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:10 +0200
      Re: [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated  functions in modules Krister Johansen <kjlx@templeofstupid.com> - 2017-07-05 22:10 +0200
        Re: [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated  functions in modules Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-13 15:10 +0200
    [PATCH 4.9 164/172] infiniband: hns: avoid gcc-7.0.1 warning for uninitialized data Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 144/172] spi: fix device-node leaks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 127/172] be2net: fix MAC addr setting on privileged BE3 VFs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 137/172] xfrm: fix stack access out of bounds with CONFIG_XFRM_SUB_POLICY Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 161/172] cpufreq: s3c2416: double free on driver init error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 120/172] aio: fix lock dep warning Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 166/172] i2c: brcmstb: Fix START and STOP conditions Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 154/172] x86/mm: Fix flush_tlb_page() on Xen Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 149/172] ARM64/ACPI: Fix BAD_MADT_GICC_ENTRY() macro implementation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 159/172] iommu/amd: Fix incorrect error handling in amd_iommu_bind_pasid() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 155/172] ocfs2: o2hb: revert hb threshold to keep compatible Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 146/172] regulator: tps65086: Fix DT node referencing in of_parse_cb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 092/172] vfio/spapr: fail tce_iommu_attach_group() when iommu_data is null Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 140/172] netfilter: use skb_to_full_sk in ip_route_me_harder Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 136/172] mm/vmalloc.c: huge-vmap: fail gracefully on unexpected huge vmap mappings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 129/172] net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 148/172] ARM: dts: OMAP3: Fix MFG ID EEPROM Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 150/172] ARM: 8685/1: ensure memblock-limit is pmd-aligned Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 083/172] swiotlb-xen: update dev_addr after swapping pages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 163/172] objtool: Fix another GCC jump table detection issue Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 156/172] iommu/vt-d: Dont over-free page table directories Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 153/172] x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 143/172] spi: When no dma_chan map buffers with spi_masters parent Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 138/172] xfrm: NULL dereference on allocation failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 142/172] sched/loadavg: Avoid loadavg spikes caused by delayed NO_HZ accounting Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 160/172] iommu/amd: Fix interrupt remapping when disable guest_mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 141/172] watchdog: bcm281xx: Fix use of uninitialized spinlock. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:20 +0200
    [PATCH 4.9 093/172] mlxsw: spectrum_router: Correctly reallocate adjacency entries Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 114/172] pmem: return EIO on read_pmem() failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 049/172] l2tp: take a reference on sessions used in genetlink handlers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 094/172] virtio_net: fix PAGE_SIZE > 64k Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 102/172] pinctrl: intel: Set pin direction properly Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 124/172] usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 110/172] net: thunderx: acpi: fix LMAC initialization Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 050/172] mm: numa: avoid waiting on freed migrated pages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 103/172] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 099/172] Documentation: devicetree: change the mediatek ethernet compatible string Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 112/172] drm/amd/powerplay: fix vce cg logic error on CZ/St. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 108/172] spi: davinci: use dma_mapping_error() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 106/172] HID: i2c-hid: Add sleep between POWER ON and RESET Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 095/172] ip6_tunnel: must reload ipv6h in ip6ip6_tnl_xmit() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 119/172] perf/x86: Reject non sampling events with precise_ip Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 097/172] ibmveth: Add a proper check for the availability of the checksum features Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 123/172] s390/ctl_reg: make __ctl_load a full memory barrier Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 113/172] drm/amd/powerplay: refine vce dpm update code on Cz. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 118/172] perf/core: Fix sys_perf_event_open() vs. hotplug Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 122/172] swiotlb: ensure that page-sized mappings are page-aligned Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 086/172] scsi: virtio_scsi: Reject commands when virtqueue is broken Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 084/172] net: sctp: fix array overrun read on sctp_timer_tbl Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 085/172] xen-netfront: Fix Rx stall during network stress and OOM Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 117/172] x86/mpx: Use compatible types in comparison to fix sparse error Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 041/172] drm/vmwgfx: Free hash table allocated by cmdbuf managed res mgr Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 096/172] vxlan: do not age static remote mac entries Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 105/172] perf/x86/intel: Use ULL constant to prevent undefined shift behaviour Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 116/172] x86/tsc: Add the Intel Denverton Processor to native_calibrate_tsc() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 098/172] kernel/panic.c: add missing \n Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 047/172] l2tp: fix duplicate session creation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 089/172] amd-xgbe: Check xgbe_init() return code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 121/172] coredump: Ensure proper size of sparse core files Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 082/172] virtio_console: fix a crash in config_work_handler Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:30 +0200
    [PATCH 4.9 004/172] net: Zero ifla_vf_info in rtnl_fill_vfinfo() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 057/172] net: phy: use boolean dt properties for eee broken modes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 063/172] stmmac: add missing of_node_put Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 065/172] qla2xxx: Terminate exchange if corrupted Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 074/172] xen-netback: fix memory leaks on XenBus disconnect Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 006/172] af_unix: Add sockaddr length checks before accessing sa_family in bind and connect handlers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 033/172] MIPS: head: Reorder instructions missing a delay slot Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 005/172] net: vrf: Make add_fib_rules per network namespace flag Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 052/172] sparc64: Zero pages on allocation for mondo and error queues. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 080/172] Btrfs: Fix deadlock between direct IO and fast fsync Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 069/172] net: phy: dp83848: add DP83620 PHY support Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 023/172] sfc: provide dummy definitions of vswitch functions Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 045/172] l2tp: fix race in l2tp_recv_common() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 042/172] dm thin: do not queue freed thin mapping for next stage processing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 081/172] Btrfs: fix truncate down when no_holes feature is enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 053/172] net: ethtool: add support for 2500BaseT and 5000BaseT link modes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 009/172] net: caif: Fix a sleep-in-atomic bug in cfpkt_create_pfx Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 062/172] scsi: sd: Fix wrong DPOFUA disable in sd_read_cache_type Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 003/172] decnet: dn_rtmsg: Improve input length sanitization in dnrmg_receive_user_skb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 036/172] MIPS: Fix IRQ tracing & lockdep when rescheduling Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 028/172] NFSv4: fix a reference leak caused WARNING messages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 075/172] xen-netback: protect resource cleaning on XenBus disconnect Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 043/172] x86/mm: Fix boot crash caused by incorrect loop count calculation in sync_global_pgds() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 037/172] ALSA: hda - Fix endless loop of codec configure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 076/172] bnxt_en: Fix "uninitialized variable" bug in TPA code path. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 077/172] bpf: dont trigger OOM killer under pressure with map alloc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 070/172] perf/x86/intel: Handle exclusive threadid correctly on CPU hotplug Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 034/172] MIPS: Avoid accidental raw backtrace Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 038/172] ALSA: hda - set input_path bitmap to zero after moving it to new place Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 059/172] ARM64: dts: meson-gxbb-odroidc2: fix GbE tx link breakage Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 040/172] gpiolib: fix filtering out unwanted events Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 008/172] sctp: disable BH in sctp_for_each_endpoint Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 031/172] drm/ast: Handle configuration without P2A bridge Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 071/172] net: korina: Fix NAPI versus resources freeing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 007/172] Fix an intermittent pr_emerg warning about lo becoming free. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 058/172] dt: bindings: net: use boolean dt properties for eee broken modes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 066/172] qla2xxx: Fix erroneous invalid handle message Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:40 +0200
    [PATCH 4.9 012/172] net/mlx5e: Fix wrong indications in DIM due to counter wraparound Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 014/172] igmp: acquire pmc lock for ip_mc_clear_src() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 010/172] net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 015/172] igmp: add a missing spin_lock_init() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 022/172] net: 8021q: Fix one possible panic caused by BUG_ON in free_netdev Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 021/172] decnet: always not take dst->__refcnt when inserting dst into hash table Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 002/172] net: dont call strlen on non-terminated string in dev_set_alias() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 011/172] net/mlx5e: Added BW check for DIM decision mechanism Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 029/172] NFSv4.x/callback: Create the callback service through svc_create_pooled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 018/172] net/mlx5e: Avoid doing a cleanup call if the profile doesnt have it Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 017/172] sctp: return next obj by passing pos + 1 into sctp_transport_get_idx Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 027/172] netfilter: synproxy: fix conntrackd interaction Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    [PATCH 4.9 001/172] ipv6: release dst on error in ip6_dst_lookup_tail Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 16:50 +0200
    Re: [PATCH 4.9 000/172] 4.9.36-stable review Guenter Roeck <linux@roeck-us.net> - 2017-07-03 22:00 +0200
      Re: [PATCH 4.9 000/172] 4.9.36-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-04 10:10 +0200
    Re: [PATCH 4.9 000/172] 4.9.36-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-04 10:10 +0200
      Re: [PATCH 4.9 000/172] 4.9.36-stable review Sumit Semwal <sumit.semwal@linaro.org> - 2017-07-04 18:50 +0200
    Re: [PATCH 4.9 000/172] 4.9.36-stable review Sumit Semwal <sumit.semwal@linaro.org> - 2017-07-04 18:40 +0200
      Re: [PATCH 4.9 000/172] 4.9.36-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-05 07:40 +0200

Page 1 of 7  [1] 2 3 4 5 6 7  Next page →


#1680105 — [PATCH 4.9 000/172] 4.9.36-stable review

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 000/172] 4.9.36-stable review
Message-ID<tZ9TH-2c1-9@gated-at.bofh.it>
This is the start of the stable review cycle for the 4.9.36 release.
There are 172 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Wed Jul  5 13:33:25 UTC 2017.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.36-rc1.gz
or in the git tree and branch at:
  git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 4.9.36-rc1

Wanpeng Li <wanpeng.li@hotmail.com>
    KVM: nVMX: Fix exception injection

Radim Krčmář <rkrcmar@redhat.com>
    KVM: x86: zero base3 of unusable segments

Radim Krčmář <rkrcmar@redhat.com>
    KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh()

Ladi Prosek <lprosek@redhat.com>
    KVM: x86: fix emulation of RSM and IRET instructions

Mark Salter <msalter@redhat.com>
    arm64: fix NULL dereference in have_cpu_die()

Kamal Dasu <kdasu.kdev@gmail.com>
    mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program

Jaedon Shin <jaedon.shin@gmail.com>
    i2c: brcmstb: Fix START and STOP conditions

Rafał Miłecki <rafal@milecki.pl>
    brcmfmac: avoid writing channel out of allocated array

Arnd Bergmann <arnd@arndb.de>
    infiniband: hns: avoid gcc-7.0.1 warning for uninitialized data

Josh Poimboeuf <jpoimboe@redhat.com>
    objtool: Fix another GCC jump table detection issue

Sudeep Holla <sudeep.holla@arm.com>
    clk: scpi: don't add cpufreq device if the scpi dvfs node is disabled

Dan Carpenter <dan.carpenter@oracle.com>
    cpufreq: s3c2416: double free on driver init error path

Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    iommu/amd: Fix interrupt remapping when disable guest_mode

Pan Bian <bianpan2016@163.com>
    iommu/amd: Fix incorrect error handling in amd_iommu_bind_pasid()

Robin Murphy <robin.murphy@arm.com>
    iommu/dma: Don't reserve PCI I/O windows

Robin Murphy <robin.murphy@arm.com>
    iommu: Handle default domain attach failure

David Dillow <dillow@google.com>
    iommu/vt-d: Don't over-free page table directories

Junxiao Bi <junxiao.bi@oracle.com>
    ocfs2: o2hb: revert hb threshold to keep compatible

Andy Lutomirski <luto@kernel.org>
    x86/mm: Fix flush_tlb_page() on Xen

Joerg Roedel <jroedel@suse.de>
    x86/mpx: Correctly report do_mpx_bt_fault() failures to user-space

Baoquan He <bhe@redhat.com>
    x86/boot/KASLR: Fix kexec crash due to 'virt_addr' calculation bug

Arnaldo Carvalho de Melo <acme@redhat.com>
    tools arch: Sync arch/x86/lib/memcpy_64.S with the kernel

Doug Berger <opendmb@gmail.com>
    ARM: 8685/1: ensure memblock-limit is pmd-aligned

Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    ARM64/ACPI: Fix BAD_MADT_GICC_ENTRY() macro implementation

Adam Ford <aford173@gmail.com>
    ARM: dts: OMAP3: Fix MFG ID EEPROM

Dave Gerlach <d-gerlach@ti.com>
    ARM: OMAP2+: omap_device: Sync omap_device and pm_runtime after probe defer

Andrew F. Davis <afd@ti.com>
    regulator: tps65086: Fix DT node referencing in of_parse_cb

Andrew F. Davis <afd@ti.com>
    regulator: tps65086: Fix expected switch DT node names

Johan Hovold <johan@kernel.org>
    spi: fix device-node leaks

Daniel Kurtz <djkurtz@chromium.org>
    spi: When no dma_chan map buffers with spi_master's parent

Matt Fleming <matt@codeblueprint.co.uk>
    sched/loadavg: Avoid loadavg spikes caused by delayed NO_HZ accounting

Eric Anholt <eric@anholt.net>
    watchdog: bcm281xx: Fix use of uninitialized spinlock.

Florian Westphal <fw@strlen.de>
    netfilter: use skb_to_full_sk in ip_route_me_harder

Dan Carpenter <dan.carpenter@oracle.com>
    xfrm: Oops on error in pfkey_msg2xfrm_state()

Dan Carpenter <dan.carpenter@oracle.com>
    xfrm: NULL dereference on allocation failure

Sabrina Dubroca <sd@queasysnail.net>
    xfrm: fix stack access out of bounds with CONFIG_XFRM_SUB_POLICY

Ard Biesheuvel <ard.biesheuvel@linaro.org>
    mm/vmalloc.c: huge-vmap: fail gracefully on unexpected huge vmap mappings

Eugeniu Rosca <erosca@de.adit-jv.com>
    ravb: Fix use-after-free on `ifconfig eth0 down`

Peter Dawson <petedaws@gmail.com>
    ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets

Xin Long <lucien.xin@gmail.com>
    sctp: check af before verify address in sctp_addr_id2transport

Jack Morgenstein <jackm@dev.mellanox.co.il>
    net/mlx4_core: Eliminate warning messages for SRQ_LIMIT under SRIOV

Masami Hiramatsu <mhiramat@kernel.org>
    perf probe: Fix to probe on gcc generated functions in modules

Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
    tipc: allocate user memory with GFP_KERNEL flag

Karicheri, Muralidharan <m-karicheri2@ti.com>
    net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types

Masami Hiramatsu <mhiramat@kernel.org>
    perf probe: Fix to show correct locations for events on modules

Ivan Vecera <cera@cera.cz>
    be2net: fix MAC addr setting on privileged BE3 VFs

Ivan Vecera <cera@cera.cz>
    be2net: don't delete MAC on close on unprivileged BE3 VFs

Ivan Vecera <cera@cera.cz>
    be2net: fix status check in be_cmd_pmac_add()

Amelie Delaunay <amelie.delaunay@st.com>
    usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value

Heiko Carstens <heiko.carstens@de.ibm.com>
    s390/ctl_reg: make __ctl_load a full memory barrier

Nikita Yushchenko <nikita.yoush@cogentembedded.com>
    swiotlb: ensure that page-sized mappings are page-aligned

Dave Kleikamp <dave.kleikamp@oracle.com>
    coredump: Ensure proper size of sparse core files

Shaohua Li <shli@fb.com>
    aio: fix lock dep warning

Jiri Olsa <jolsa@redhat.com>
    perf/x86: Reject non sampling events with precise_ip

Peter Zijlstra <peterz@infradead.org>
    perf/core: Fix sys_perf_event_open() vs. hotplug

Tobias Klauser <tklauser@distanz.ch>
    x86/mpx: Use compatible types in comparison to fix sparse error

Len Brown <len.brown@intel.com>
    x86/tsc: Add the Intel Denverton Processor to native_calibrate_tsc()

Felix Fietkau <nbd@nbd.name>
    mac80211: initialize SMPS field in HT capabilities

Stefan Hajnoczi <stefanha@redhat.com>
    pmem: return EIO on read_pmem() failure

Rex Zhu <Rex.Zhu@amd.com>
    drm/amd/powerplay: refine vce dpm update code on Cz.

Rex Zhu <Rex.Zhu@amd.com>
    drm/amd/powerplay: fix vce cg logic error on CZ/St.

Alex Deucher <alexander.deucher@amd.com>
    drm/radeon/si: load special ucode for certain MC configs

Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
    net: thunderx: acpi: fix LMAC initialization

Ard Biesheuvel <ard.biesheuvel@linaro.org>
    arm64: assembler: make adr_l work in modules under KASLR

Kevin Hilman <khilman@baylibre.com>
    spi: davinci: use dma_mapping_error()

Roberto Sassu <rsassu@suse.de>
    scsi: lpfc: avoid double free of resource identifiers

Brendan McGrath <redmcg@redmandi.dyndns.org>
    HID: i2c-hid: Add sleep between POWER ON and RESET

Colin King <colin.king@canonical.com>
    perf/x86/intel: Use ULL constant to prevent undefined shift behaviour

Johannes Berg <johannes.berg@intel.com>
    mac80211: recalculate min channel width on VHT opmode changes

Russell King <rmk+kernel@armlinux.org.uk>
    net: phy: marvell: fix Marvell 88E1512 used in SGMII mode

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    pinctrl: intel: Set pin direction properly

Prarit Bhargava <prarit@redhat.com>
    perf/x86/intel/uncore: Fix hardcoded socket 0 assumption in the Haswell init code

Lucas Stach <l.stach@pengutronix.de>
    drm/etnaviv: trick drm_mm into giving out a low IOVA

John Crispin <john@phrozen.org>
    Documentation: devicetree: change the mediatek ethernet compatible string

Jiri Slaby <jslaby@suse.cz>
    kernel/panic.c: add missing \n

Thomas Huth <thuth@redhat.com>
    ibmveth: Add a proper check for the availability of the checksum features

Balakrishnan Raman <ramanb@cumulusnetworks.com>
    vxlan: do not age static remote mac entries

Eric Dumazet <edumazet@google.com>
    ip6_tunnel: must reload ipv6h in ip6ip6_tnl_xmit()

Michael S. Tsirkin <mst@redhat.com>
    virtio_net: fix PAGE_SIZE > 64k

Ido Schimmel <idosch@mellanox.com>
    mlxsw: spectrum_router: Correctly reallocate adjacency entries

Greg Kurz <groug@kaod.org>
    vfio/spapr: fail tce_iommu_attach_group() when iommu_data is null

Ding Pixel <pding@amd.com>
    drm/amdgpu: check ring being ready before using

Florian Fainelli <f.fainelli@gmail.com>
    net: dsa: Check return value of phy_connect_direct()

Lendacky, Thomas <Thomas.Lendacky@amd.com>
    amd-xgbe: Check xgbe_init() return code

Zach Ploskey <zach@ploskey.com>
    platform/x86: ideapad-laptop: handle ACPI event 1

Jens Axboe <axboe@kernel.dk>
    iwlwifi: fix kernel crash when unregistering thermal zone

Eric Farman <farman@linux.vnet.ibm.com>
    scsi: virtio_scsi: Reject commands when virtqueue is broken

Vineeth Remanan Pillai <vineethp@amazon.com>
    xen-netfront: Fix Rx stall during network stress and OOM

Colin Ian King <colin.king@canonical.com>
    net: sctp: fix array overrun read on sctp_timer_tbl

Stefano Stabellini <sstabellini@kernel.org>
    swiotlb-xen: update dev_addr after swapping pages

G. Campana <gcampana@quarkslab.com>
    virtio_console: fix a crash in config_work_handler

Liu Bo <bo.li.liu@oracle.com>
    Btrfs: fix truncate down when no_holes feature is enabled

Chandan Rajendra <chandan@linux.vnet.ibm.com>
    Btrfs: Fix deadlock between direct IO and fast fsync

Eric Dumazet <edumazet@google.com>
    gianfar: Do not reuse pages from emergency reserve

Jiri Slaby <jslaby@suse.cz>
    objtool: Fix IRET's opcode

Daniel Borkmann <daniel@iogearbox.net>
    bpf: don't trigger OOM killer under pressure with map alloc

Michael Chan <michael.chan@broadcom.com>
    bnxt_en: Fix "uninitialized variable" bug in TPA code path.

Igor Druzhinin <igor.druzhinin@citrix.com>
    xen-netback: protect resource cleaning on XenBus disconnect

Igor Druzhinin <igor.druzhinin@citrix.com>
    xen-netback: fix memory leaks on XenBus disconnect

Eran Ben Elisha <eranbe@mellanox.com>
    net: ethtool: Initialize buffer when querying device channel settings

Gavin Shan <gwshan@linux.vnet.ibm.com>
    powerpc/eeh: Enable IO path on permanent error

Florian Fainelli <f.fainelli@gmail.com>
    net: korina: Fix NAPI versus resources freeing

Zhou Chengming <zhouchengming1@huawei.com>
    perf/x86/intel: Handle exclusive threadid correctly on CPU hotplug

Alvaro G. M <alvaro.gamez@hazent.com>
    net: phy: dp83848: add DP83620 PHY support

Alex Deucher <alexander.deucher@amd.com>
    drm/amdgpu: add support for new hainan variants

Rex Zhu <Rex.Zhu@amd.com>
    drm/amdgpu: fix program vce instance logic error.

Quinn Tran <quinn.tran@cavium.com>
    qla2xxx: Fix erroneous invalid handle message

Quinn Tran <quinn.tran@cavium.com>
    qla2xxx: Terminate exchange if corrupted

Johannes Thumshirn <jthumshirn@suse.de>
    scsi: lpfc: Set elsiocb contexts to NULL after freeing it

Julia Lawall <julia.lawall@lip6.fr>
    stmmac: add missing of_node_put

Damien Le Moal <damien.lemoal@wdc.com>
    scsi: sd: Fix wrong DPOFUA disable in sd_read_cache_type

Dmitry Vyukov <dvyukov@google.com>
    KVM: x86: fix fixing of hypercalls

Juergen Gross <jgross@suse.com>
    xen/blkback: don't free be structure too early

Jerome Brunet <jbrunet@baylibre.com>
    ARM64: dts: meson-gxbb-odroidc2: fix GbE tx link breakage

jbrunet <jbrunet@baylibre.com>
    dt: bindings: net: use boolean dt properties for eee broken modes

jbrunet <jbrunet@baylibre.com>
    net: phy: use boolean dt properties for eee broken modes

jbrunet <jbrunet@baylibre.com>
    net: phy: fix sign type error in genphy_config_eee_advert

jbrunet <jbrunet@baylibre.com>
    dt-bindings: net: add EEE capability constants

jbrunet <jbrunet@baylibre.com>
    net: phy: add an option to disable EEE advertisement

Pavel Belous <pavel.s.belous@gmail.com>
    net: ethtool: add support for 2500BaseT and 5000BaseT link modes

Liam R. Howlett <Liam.Howlett@Oracle.com>
    sparc64: Zero pages on allocation for mondo and error queues.

Liam R. Howlett <Liam.Howlett@Oracle.com>
    sparc64: Handle PIO & MEM non-resumable errors.

Mark Rutland <mark.rutland@arm.com>
    mm: numa: avoid waiting on freed migrated pages

Guillaume Nault <g.nault@alphalink.fr>
    l2tp: take a reference on sessions used in genetlink handlers

Guillaume Nault <g.nault@alphalink.fr>
    l2tp: hold session while sending creation notifications

Guillaume Nault <g.nault@alphalink.fr>
    l2tp: fix duplicate session creation

Guillaume Nault <g.nault@alphalink.fr>
    l2tp: ensure session can't get removed during pppol2tp_session_ioctl()

Guillaume Nault <g.nault@alphalink.fr>
    l2tp: fix race in l2tp_recv_common()

Baolin Wang <baolin.wang@linaro.org>
    usb: gadget: f_fs: Fix possibe deadlock

Baoquan He <bhe@redhat.com>
    x86/mm: Fix boot crash caused by incorrect loop count calculation in sync_global_pgds()

Vallish Vaidyeshwara <vallish@amazon.com>
    dm thin: do not queue freed thin mapping for next stage processing

Deepak Rawat <drawat@vmware.com>
    drm/vmwgfx: Free hash table allocated by cmdbuf managed res mgr

Bartosz Golaszewski <brgl@bgdev.pl>
    gpiolib: fix filtering out unwanted events

Trond Myklebust <trond.myklebust@primarydata.com>
    NFSv4.1: Fix a race in nfs4_proc_layoutget

Hui Wang <hui.wang@canonical.com>
    ALSA: hda - set input_path bitmap to zero after moving it to new place

Takashi Iwai <tiwai@suse.de>
    ALSA: hda - Fix endless loop of codec configure

Paul Burton <paul.burton@imgtec.com>
    MIPS: Fix IRQ tracing & lockdep when rescheduling

Paul Burton <paul.burton@imgtec.com>
    MIPS: pm-cps: Drop manual cache-line alignment of ready_count

James Hogan <james.hogan@imgtec.com>
    MIPS: Avoid accidental raw backtrace

Karl Beldan <karl.beldan@gmail.com>
    MIPS: head: Reorder instructions missing a delay slot

David Rientjes <rientjes@google.com>
    mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()

Russell Currey <ruscur@russell.cc>
    drm/ast: Handle configuration without P2A bridge

Juergen Gross <jgross@suse.com>
    xen/blkback: don't use xen_blkif_get() in xen-blkback kthread

Kinglong Mee <kinglongmee@gmail.com>
    NFSv4.x/callback: Create the callback service through svc_create_pooled

Kinglong Mee <kinglongmee@gmail.com>
    NFSv4: fix a reference leak caused WARNING messages

Eric Leblond <eric@regit.org>
    netfilter: synproxy: fix conntrackd interaction

Eric Dumazet <edumazet@google.com>
    netfilter: xt_TCPMSS: add more sanity tests on tcph->doff

Serhey Popovych <serhe.popovych@gmail.com>
    rtnetlink: add IFLA_GROUP to ifla_policy

Serhey Popovych <serhe.popovych@gmail.com>
    ipv6: Do not leak throw route references

Bert Kenward <bkenward@solarflare.com>
    sfc: provide dummy definitions of vswitch functions

Gao Feng <gfree.wind@vip.163.com>
    net: 8021q: Fix one possible panic caused by BUG_ON in free_netdev

Wei Wang <weiwan@google.com>
    decnet: always not take dst->__refcnt when inserting dst into hash table

Maor Dickman <maord@mellanox.com>
    net/mlx5e: Fix timestamping capabilities reporting

Eli Cohen <eli@mellanox.com>
    net/mlx5: Wait for FW readiness before initializing command interface

Or Gerlitz <ogerlitz@mellanox.com>
    net/mlx5e: Avoid doing a cleanup call if the profile doesn't have it

Xin Long <lucien.xin@gmail.com>
    sctp: return next obj by passing pos + 1 into sctp_transport_get_idx

Xin Long <lucien.xin@gmail.com>
    ipv6: fix calling in6_ifa_hold incorrectly for dad work

WANG Cong <xiyou.wangcong@gmail.com>
    igmp: add a missing spin_lock_init()

WANG Cong <xiyou.wangcong@gmail.com>
    igmp: acquire pmc lock for ip_mc_clear_src()

Christian Perle <christian.perle@secunet.com>
    proc: snmp6: Use correct type in memset

Tal Gilboa <talgi@mellanox.com>
    net/mlx5e: Fix wrong indications in DIM due to counter wraparound

Tal Gilboa <talgi@mellanox.com>
    net/mlx5e: Added BW check for DIM decision mechanism

Jia-Ju Bai <baijiaju1990@163.com>
    net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse

Jia-Ju Bai <baijiaju1990@163.com>
    net: caif: Fix a sleep-in-atomic bug in cfpkt_create_pfx

Xin Long <lucien.xin@gmail.com>
    sctp: disable BH in sctp_for_each_endpoint

Krister Johansen <kjlx@templeofstupid.com>
    Fix an intermittent pr_emerg warning about lo becoming free.

Mateusz Jurczyk <mjurczyk@google.com>
    af_unix: Add sockaddr length checks before accessing sa_family in bind and connect handlers

David Ahern <dsahern@gmail.com>
    net: vrf: Make add_fib_rules per network namespace flag

Mintz, Yuval <Yuval.Mintz@cavium.com>
    net: Zero ifla_vf_info in rtnl_fill_vfinfo()

Mateusz Jurczyk <mjurczyk@google.com>
    decnet: dn_rtmsg: Improve input length sanitization in dnrmg_receive_user_skb

Alexander Potapenko <glider@google.com>
    net: don't call strlen on non-terminated string in dev_set_alias()

Willem de Bruijn <willemb@google.com>
    ipv6: release dst on error in ip6_dst_lookup_tail


-------------

Diffstat:

 .../devicetree/bindings/net/mediatek-net.txt       |   2 +-
 Documentation/devicetree/bindings/net/phy.txt      |   9 +
 .../devicetree/bindings/net/ti,dp83867.txt         |   6 +-
 Makefile                                           |   4 +-
 arch/arm/boot/dts/logicpd-torpedo-som.dtsi         |   2 +-
 arch/arm/mach-omap2/omap_device.c                  |   8 +
 arch/arm/mm/mmu.c                                  |   8 +-
 .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts |  12 +
 arch/arm64/include/asm/acpi.h                      |   6 +-
 arch/arm64/include/asm/assembler.h                 |  36 ++-
 arch/arm64/kernel/smp.c                            |   2 +-
 arch/mips/kernel/entry.S                           |   3 +
 arch/mips/kernel/head.S                            |   2 +-
 arch/mips/kernel/pm-cps.c                          |   9 +-
 arch/mips/kernel/traps.c                           |   2 +
 arch/powerpc/kernel/eeh.c                          |  10 +-
 arch/s390/include/asm/ctl_reg.h                    |   4 +-
 arch/sparc/kernel/irq_64.c                         |   2 +-
 arch/sparc/kernel/traps_64.c                       |  73 ++++++
 arch/x86/boot/compressed/kaslr.c                   |   3 -
 arch/x86/boot/compressed/misc.c                    |   4 +-
 arch/x86/boot/compressed/misc.h                    |   2 -
 arch/x86/events/core.c                             |   4 +
 arch/x86/events/intel/core.c                       |   9 +-
 arch/x86/events/intel/uncore_snbep.c               |   2 +-
 arch/x86/include/asm/kvm_emulate.h                 |   4 +-
 arch/x86/kernel/tsc.c                              |   1 +
 arch/x86/kvm/emulate.c                             |  16 +-
 arch/x86/kvm/pmu_intel.c                           |   2 +-
 arch/x86/kvm/vmx.c                                 |   2 +-
 arch/x86/kvm/x86.c                                 |  20 +-
 arch/x86/mm/init_64.c                              |   8 +-
 arch/x86/mm/mpx.c                                  |  12 +-
 arch/x86/mm/tlb.c                                  |   4 +-
 drivers/block/xen-blkback/blkback.c                |   3 -
 drivers/block/xen-blkback/xenbus.c                 |   7 +-
 drivers/char/virtio_console.c                      |   2 +-
 drivers/clk/clk-scpi.c                             |  14 +-
 drivers/cpufreq/s3c2416-cpufreq.c                  |   1 -
 drivers/gpio/gpiolib.c                             |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c             |   7 +
 drivers/gpu/drm/amd/amdgpu/si_dpm.c                |   8 +-
 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c              |  25 +-
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.c  |   4 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c     |  24 +-
 drivers/gpu/drm/ast/ast_drv.h                      |   6 +-
 drivers/gpu/drm/ast/ast_main.c                     | 264 +++++++++++++--------
 drivers/gpu/drm/ast/ast_post.c                     |   7 +-
 drivers/gpu/drm/etnaviv/etnaviv_mmu.c              |   7 +-
 drivers/gpu/drm/radeon/si.c                        |  12 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c         |   1 +
 drivers/hid/i2c-hid/i2c-hid.c                      |   9 +
 drivers/i2c/busses/i2c-brcmstb.c                   |  27 ++-
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c         |   1 +
 drivers/iommu/amd_iommu.c                          |   6 +-
 drivers/iommu/amd_iommu_v2.c                       |   2 +-
 drivers/iommu/dma-iommu.c                          |   3 +-
 drivers/iommu/intel-iommu.c                        |   2 +-
 drivers/iommu/iommu.c                              |  37 ++-
 drivers/md/dm-thin.c                               |  26 +-
 drivers/mtd/nand/brcmnand/brcmnand.c               |  61 ++++-
 drivers/net/ethernet/amd/xgbe/xgbe-dev.c           |   4 +-
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c           |   4 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |   2 +-
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c  |  11 +-
 drivers/net/ethernet/emulex/benet/be_cmds.c        |   2 +-
 drivers/net/ethernet/emulex/benet/be_main.c        |  18 +-
 drivers/net/ethernet/freescale/gianfar.c           |   2 +-
 drivers/net/ethernet/ibm/ibmveth.c                 |   7 +-
 drivers/net/ethernet/korina.c                      |   8 +-
 drivers/net/ethernet/mellanox/mlx4/eq.c            |  23 +-
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |   8 +-
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   |   8 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |   3 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c |  45 ++--
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  14 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  10 +-
 drivers/net/ethernet/renesas/ravb_main.c           |  24 +-
 drivers/net/ethernet/sfc/falcon.c                  |  10 +
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   1 +
 drivers/net/phy/dp83848.c                          |   3 +
 drivers/net/phy/dp83867.c                          |   8 +-
 drivers/net/phy/marvell.c                          |   3 +-
 drivers/net/phy/phy.c                              |   3 +
 drivers/net/phy/phy_device.c                       |  92 ++++++-
 drivers/net/virtio_net.c                           |  10 +-
 drivers/net/vrf.c                                  |  36 ++-
 drivers/net/vxlan.c                                |   2 +-
 .../broadcom/brcm80211/brcmfmac/cfg80211.c         |  32 +--
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c        |  12 +-
 drivers/net/xen-netback/interface.c                |   6 +-
 drivers/net/xen-netback/xenbus.c                   |  13 +
 drivers/net/xen-netfront.c                         |   2 +-
 drivers/nvdimm/pmem.c                              |   4 +-
 drivers/pinctrl/intel/pinctrl-intel.c              |  30 ++-
 drivers/platform/x86/ideapad-laptop.c              |   1 +
 drivers/regulator/tps65086-regulator.c             |  10 +-
 drivers/scsi/lpfc/lpfc_els.c                       |   2 +
 drivers/scsi/lpfc/lpfc_sli.c                       |   7 +
 drivers/scsi/qla2xxx/qla_def.h                     |   3 +-
 drivers/scsi/qla2xxx/qla_isr.c                     |   4 +
 drivers/scsi/qla2xxx/qla_target.c                  |  25 +-
 drivers/scsi/qla2xxx/qla_target.h                  |  22 +-
 drivers/scsi/sd.c                                  |   3 +-
 drivers/scsi/virtio_scsi.c                         |  11 +-
 drivers/spi/spi-davinci.c                          |   4 +-
 drivers/spi/spi.c                                  |  16 +-
 drivers/usb/dwc2/gadget.c                          |   4 +-
 drivers/usb/gadget/function/f_fs.c                 |   8 +-
 drivers/vfio/vfio_iommu_spapr_tce.c                |   4 +
 drivers/watchdog/bcm_kona_wdt.c                    |   3 +-
 drivers/xen/swiotlb-xen.c                          |   5 +-
 fs/aio.c                                           |   6 +-
 fs/binfmt_elf.c                                    |   1 +
 fs/btrfs/inode.c                                   |  17 +-
 fs/coredump.c                                      |  18 ++
 fs/nfs/callback.c                                  |   2 +-
 fs/nfs/nfs4proc.c                                  |   4 +-
 fs/ocfs2/cluster/heartbeat.c                       |   8 +-
 include/linux/bpf.h                                |   2 +
 include/linux/coredump.h                           |   1 +
 include/linux/phy.h                                |   3 +
 include/net/xfrm.h                                 |  10 -
 include/uapi/linux/ethtool.h                       |   4 +-
 kernel/bpf/arraymap.c                              |  18 +-
 kernel/bpf/hashtab.c                               |  22 +-
 kernel/bpf/stackmap.c                              |  20 +-
 kernel/bpf/syscall.c                               |  26 ++
 kernel/events/core.c                               |  70 ++++--
 kernel/panic.c                                     |   2 +-
 kernel/sched/loadavg.c                             |   4 +-
 lib/swiotlb.c                                      |   6 +-
 mm/huge_memory.c                                   |   6 +
 mm/swap_cgroup.c                                   |   2 +
 mm/vmalloc.c                                       |  14 +-
 net/8021q/vlan.c                                   |   3 +-
 net/caif/cfpkt_skbuff.c                            |   6 +-
 net/core/dev.c                                     |   3 +-
 net/core/dst.c                                     |  14 ++
 net/core/ethtool.c                                 |   2 +-
 net/core/rtnetlink.c                               |   5 +-
 net/decnet/dn_route.c                              |  14 +-
 net/decnet/netfilter/dn_rtmsg.c                    |   4 +-
 net/dsa/slave.c                                    |   6 +-
 net/ipv4/igmp.c                                    |  22 +-
 net/ipv4/netfilter.c                               |   7 +-
 net/ipv6/addrconf.c                                |   6 +-
 net/ipv6/fib6_rules.c                              |  22 +-
 net/ipv6/ip6_fib.c                                 |   3 +-
 net/ipv6/ip6_gre.c                                 |  16 +-
 net/ipv6/ip6_output.c                              |   6 +-
 net/ipv6/ip6_tunnel.c                              |  23 +-
 net/ipv6/proc.c                                    |   2 +-
 net/key/af_key.c                                   |  17 +-
 net/l2tp/l2tp_core.c                               | 152 +++++++++---
 net/l2tp/l2tp_core.h                               |   6 +-
 net/l2tp/l2tp_eth.c                                |  10 +-
 net/l2tp/l2tp_ip.c                                 |  17 +-
 net/l2tp/l2tp_ip6.c                                |  18 +-
 net/l2tp/l2tp_netlink.c                            |  45 ++--
 net/l2tp/l2tp_ppp.c                                |  75 +++---
 net/mac80211/iface.c                               |  21 ++
 net/mac80211/main.c                                |  13 +-
 net/mac80211/rx.c                                  |   9 +-
 net/mac80211/vht.c                                 |   4 +-
 net/netfilter/nf_conntrack_netlink.c               |   4 +
 net/netfilter/xt_TCPMSS.c                          |   6 +-
 net/sctp/debug.c                                   |   2 +-
 net/sctp/socket.c                                  |  11 +-
 net/tipc/discover.c                                |   4 +-
 net/tipc/link.c                                    |   2 +-
 net/tipc/msg.c                                     |  18 +-
 net/tipc/msg.h                                     |   2 +-
 net/tipc/name_distr.c                              |   2 +-
 net/unix/af_unix.c                                 |   7 +-
 net/xfrm/xfrm_policy.c                             |  47 ----
 sound/pci/hda/hda_codec.h                          |   2 +
 sound/pci/hda/hda_controller.c                     |   8 +-
 sound/pci/hda/hda_generic.c                        |   1 +
 tools/arch/x86/lib/memcpy_64.S                     |   2 +-
 tools/objtool/arch/x86/decode.c                    |   2 +-
 tools/objtool/builtin-check.c                      |  15 +-
 tools/objtool/elf.c                                |  12 +
 tools/objtool/elf.h                                |   1 +
 tools/perf/util/probe-event.c                      |  45 ++--
 tools/perf/util/probe-finder.c                     |  15 +-
 tools/perf/util/probe-finder.h                     |   3 +
 187 files changed, 1678 insertions(+), 804 deletions(-)

[toc] | [next] | [standalone]


#1680106 — [PATCH 4.9 073/172] net: ethtool: Initialize buffer when querying device channel settings

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 073/172] net: ethtool: Initialize buffer when querying device channel settings
Message-ID<tZ9TM-2c1-123@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eran Ben Elisha <eranbe@mellanox.com>


[ Upstream commit 31a86d137219373c3222ca5f4f912e9a4d8065bb ]

Ethtool channels respond struct was uninitialized when querying device
channel boundaries settings. As a result, unreported fields by the driver
hold garbage.  This may cause sending unsupported params to driver.

Fixes: 8bf368620486 ('ethtool: ensure channel counts are within bounds ...')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
CC: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/ethtool.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1704,7 +1704,7 @@ static noinline_for_stack int ethtool_ge
 static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
 						   void __user *useraddr)
 {
-	struct ethtool_channels channels, max;
+	struct ethtool_channels channels, max = { .cmd = ETHTOOL_GCHANNELS };
 	u32 max_rx_in_use = 0;
 
 	if (!dev->ethtool_ops->set_channels || !dev->ethtool_ops->get_channels)

[toc] | [prev] | [next] | [standalone]


#1680107 — [PATCH 4.9 104/172] mac80211: recalculate min channel width on VHT opmode changes

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 104/172] mac80211: recalculate min channel width on VHT opmode changes
Message-ID<tZ9TM-2c1-121@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johannes Berg <johannes.berg@intel.com>


[ Upstream commit d2941df8fbd9708035d66d889ada4d3d160170ce ]

When an associated station changes its VHT operating mode this
can/will affect the bandwidth it's using, and consequently we
must recalculate the minimum bandwidth we need to use. Failure
to do so can lead to one of two scenarios:
 1) we use a too high bandwidth, this is benign
 2) we use a too narrow bandwidth, causing rate control and
    actual PHY configuration to be out of sync, which can in
    turn cause problems/crashes

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/mac80211/iface.c |   21 +++++++++++++++++++++
 net/mac80211/rx.c    |    9 +--------
 net/mac80211/vht.c   |    4 +++-
 3 files changed, 25 insertions(+), 9 deletions(-)

--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -6,6 +6,7 @@
  * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz>
  * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
+ * Copyright (c) 2016        Intel Deutschland GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -1307,6 +1308,26 @@ static void ieee80211_iface_work(struct
 		} else if (ieee80211_is_action(mgmt->frame_control) &&
 			   mgmt->u.action.category == WLAN_CATEGORY_VHT) {
 			switch (mgmt->u.action.u.vht_group_notif.action_code) {
+			case WLAN_VHT_ACTION_OPMODE_NOTIF: {
+				struct ieee80211_rx_status *status;
+				enum nl80211_band band;
+				u8 opmode;
+
+				status = IEEE80211_SKB_RXCB(skb);
+				band = status->band;
+				opmode = mgmt->u.action.u.vht_opmode_notif.operating_mode;
+
+				mutex_lock(&local->sta_mtx);
+				sta = sta_info_get_bss(sdata, mgmt->sa);
+
+				if (sta)
+					ieee80211_vht_handle_opmode(sdata, sta,
+								    opmode,
+								    band);
+
+				mutex_unlock(&local->sta_mtx);
+				break;
+			}
 			case WLAN_VHT_ACTION_GROUPID_MGMT:
 				ieee80211_process_mu_groups(sdata, mgmt);
 				break;
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2923,17 +2923,10 @@ ieee80211_rx_h_action(struct ieee80211_r
 
 		switch (mgmt->u.action.u.vht_opmode_notif.action_code) {
 		case WLAN_VHT_ACTION_OPMODE_NOTIF: {
-			u8 opmode;
-
 			/* verify opmode is present */
 			if (len < IEEE80211_MIN_ACTION_SIZE + 2)
 				goto invalid;
-
-			opmode = mgmt->u.action.u.vht_opmode_notif.operating_mode;
-
-			ieee80211_vht_handle_opmode(rx->sdata, rx->sta,
-						    opmode, status->band);
-			goto handled;
+			goto queue;
 		}
 		case WLAN_VHT_ACTION_GROUPID_MGMT: {
 			if (len < IEEE80211_MIN_ACTION_SIZE + 25)
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -527,8 +527,10 @@ void ieee80211_vht_handle_opmode(struct
 
 	u32 changed = __ieee80211_vht_handle_opmode(sdata, sta, opmode, band);
 
-	if (changed > 0)
+	if (changed > 0) {
+		ieee80211_recalc_min_chandef(sdata);
 		rate_control_rate_update(local, sband, sta, changed);
+	}
 }
 
 void ieee80211_get_vht_mask_from_cap(__le16 vht_cap,

[toc] | [prev] | [next] | [standalone]


#1680108 — [PATCH 4.9 134/172] ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 134/172] ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets
Message-ID<tZ9TM-2c1-125@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Dawson <petedaws@gmail.com>


[ Upstream commit 0e9a709560dbcfbace8bf4019dc5298619235891 ]

This fix addresses two problems in the way the DSCP field is formulated
 on the encapsulating header of IPv6 tunnels.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195661

1) The IPv6 tunneling code was manipulating the DSCP field of the
 encapsulating packet using the 32b flowlabel. Since the flowlabel is
 only the lower 20b it was incorrect to assume that the upper 12b
 containing the DSCP and ECN fields would remain intact when formulating
 the encapsulating header. This fix handles the 'inherit' and
 'fixed-value' DSCP cases explicitly using the extant dsfield u8 variable.

2) The use of INET_ECN_encapsulate(0, dsfield) in ip6_tnl_xmit was
 incorrect and resulted in the DSCP value always being set to 0.

Commit 90427ef5d2a4 ("ipv6: fix flow labels when the traffic class
 is non-0") caused the regression by masking out the flowlabel
 which exposed the incorrect handling of the DSCP portion of the
 flowlabel in ip6_tunnel and ip6_gre.

Fixes: 90427ef5d2a4 ("ipv6: fix flow labels when the traffic class is non-0")
Signed-off-by: Peter Dawson <peter.a.dawson@boeing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv6/ip6_gre.c    |   13 +++++++------
 net/ipv6/ip6_tunnel.c |   21 +++++++++++++--------
 2 files changed, 20 insertions(+), 14 deletions(-)

--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -542,11 +542,10 @@ static inline int ip6gre_xmit_ipv4(struc
 
 	memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
 
-	dsfield = ipv4_get_dsfield(iph);
-
 	if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
-		fl6.flowlabel |= htonl((__u32)iph->tos << IPV6_TCLASS_SHIFT)
-					  & IPV6_TCLASS_MASK;
+		dsfield = ipv4_get_dsfield(iph);
+	else
+		dsfield = ip6_tclass(t->parms.flowinfo);
 	if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
 		fl6.flowi6_mark = skb->mark;
 
@@ -599,9 +598,11 @@ static inline int ip6gre_xmit_ipv6(struc
 
 	memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
 
-	dsfield = ipv6_get_dsfield(ipv6h);
 	if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
-		fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK);
+		dsfield = ipv6_get_dsfield(ipv6h);
+	else
+		dsfield = ip6_tclass(t->parms.flowinfo);
+
 	if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL)
 		fl6.flowlabel |= ip6_flowlabel(ipv6h);
 	if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1196,7 +1196,7 @@ route_lookup:
 	skb_push(skb, sizeof(struct ipv6hdr));
 	skb_reset_network_header(skb);
 	ipv6h = ipv6_hdr(skb);
-	ip6_flow_hdr(ipv6h, INET_ECN_encapsulate(0, dsfield),
+	ip6_flow_hdr(ipv6h, dsfield,
 		     ip6_make_flowlabel(net, skb, fl6->flowlabel, true, fl6));
 	ipv6h->hop_limit = hop_limit;
 	ipv6h->nexthdr = proto;
@@ -1231,8 +1231,6 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str
 	if (tproto != IPPROTO_IPIP && tproto != 0)
 		return -1;
 
-	dsfield = ipv4_get_dsfield(iph);
-
 	if (t->parms.collect_md) {
 		struct ip_tunnel_info *tun_info;
 		const struct ip_tunnel_key *key;
@@ -1246,6 +1244,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str
 		fl6.flowi6_proto = IPPROTO_IPIP;
 		fl6.daddr = key->u.ipv6.dst;
 		fl6.flowlabel = key->label;
+		dsfield = ip6_tclass(key->label);
 	} else {
 		if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
 			encap_limit = t->parms.encap_limit;
@@ -1254,8 +1253,9 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str
 		fl6.flowi6_proto = IPPROTO_IPIP;
 
 		if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
-			fl6.flowlabel |= htonl((__u32)iph->tos << IPV6_TCLASS_SHIFT)
-					 & IPV6_TCLASS_MASK;
+			dsfield = ipv4_get_dsfield(iph);
+		else
+			dsfield = ip6_tclass(t->parms.flowinfo);
 		if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
 			fl6.flowi6_mark = skb->mark;
 	}
@@ -1263,6 +1263,8 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str
 	if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
 		return -1;
 
+	dsfield = INET_ECN_encapsulate(dsfield, ipv4_get_dsfield(iph));
+
 	skb_set_inner_ipproto(skb, IPPROTO_IPIP);
 
 	err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu,
@@ -1296,8 +1298,6 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
 	    ip6_tnl_addr_conflict(t, ipv6h))
 		return -1;
 
-	dsfield = ipv6_get_dsfield(ipv6h);
-
 	if (t->parms.collect_md) {
 		struct ip_tunnel_info *tun_info;
 		const struct ip_tunnel_key *key;
@@ -1311,6 +1311,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
 		fl6.flowi6_proto = IPPROTO_IPV6;
 		fl6.daddr = key->u.ipv6.dst;
 		fl6.flowlabel = key->label;
+		dsfield = ip6_tclass(key->label);
 	} else {
 		offset = ip6_tnl_parse_tlv_enc_lim(skb, skb_network_header(skb));
 		/* ip6_tnl_parse_tlv_enc_lim() might have reallocated skb->head */
@@ -1333,7 +1334,9 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
 		fl6.flowi6_proto = IPPROTO_IPV6;
 
 		if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
-			fl6.flowlabel |= (*(__be32 *)ipv6h & IPV6_TCLASS_MASK);
+			dsfield = ipv6_get_dsfield(ipv6h);
+		else
+			dsfield = ip6_tclass(t->parms.flowinfo);
 		if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL)
 			fl6.flowlabel |= ip6_flowlabel(ipv6h);
 		if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
@@ -1343,6 +1346,8 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
 	if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
 		return -1;
 
+	dsfield = INET_ECN_encapsulate(dsfield, ipv6_get_dsfield(ipv6h));
+
 	skb_set_inner_ipproto(skb, IPPROTO_IPV6);
 
 	err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu,

[toc] | [prev] | [next] | [standalone]


#1680109 — [PATCH 4.9 013/172] proc: snmp6: Use correct type in memset

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 013/172] proc: snmp6: Use correct type in memset
Message-ID<tZ9TM-2c1-131@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christian Perle <christian.perle@secunet.com>


[ Upstream commit 3500cd73dff48f28f4ba80c171c4c80034d40f76 ]

Reading /proc/net/snmp6 yields bogus values on 32 bit kernels.
Use "u64" instead of "unsigned long" in sizeof().

Fixes: 4a4857b1c81e ("proc: Reduce cache miss in snmp6_seq_show")
Signed-off-by: Christian Perle <christian.perle@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv6/proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -219,7 +219,7 @@ static void snmp6_seq_show_item64(struct
 	u64 buff64[SNMP_MIB_MAX];
 	int i;
 
-	memset(buff64, 0, sizeof(unsigned long) * SNMP_MIB_MAX);
+	memset(buff64, 0, sizeof(u64) * SNMP_MIB_MAX);
 
 	snmp_get_cpu_field64_batch(buff64, itemlist, mib, syncpoff);
 	for (i = 0; itemlist[i].name; i++)

[toc] | [prev] | [next] | [standalone]


#1680112 — [PATCH 4.9 126/172] be2net: dont delete MAC on close on unprivileged BE3 VFs

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 126/172] be2net: dont delete MAC on close on unprivileged BE3 VFs
Message-ID<tZ9TN-2c1-135@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ivan Vecera <cera@cera.cz>


[ Upstream commit 6d928ae590c8d58cfd5cca997d54394de139cbb7 ]

BE3 VFs without FILTMGMT privilege are not allowed to modify its MAC,
VLAN table and UC/MC lists. So don't try to delete MAC on such VFs.

Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3630,7 +3630,11 @@ static void be_rx_qs_destroy(struct be_a
 
 static void be_disable_if_filters(struct be_adapter *adapter)
 {
-	be_dev_mac_del(adapter, adapter->pmac_id[0]);
+	/* Don't delete MAC on BE3 VFs without FILTMGMT privilege  */
+	if (!BEx_chip(adapter) || !be_virtfn(adapter) ||
+	    check_privilege(adapter, BE_PRIV_FILTMGMT))
+		be_dev_mac_del(adapter, adapter->pmac_id[0]);
+
 	be_clear_uc_list(adapter);
 	be_clear_mc_list(adapter);
 

[toc] | [prev] | [next] | [standalone]


#1680113 — [PATCH 4.9 051/172] sparc64: Handle PIO & MEM non-resumable errors.

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 051/172] sparc64: Handle PIO & MEM non-resumable errors.
Message-ID<tZ9TN-2c1-137@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>


[ Upstream commit 047487241ff59374fded8c477f21453681f5995c ]

User processes trying to access an invalid memory address via PIO will
receive a SIGBUS signal instead of causing a panic.  Memory errors will
receive a SIGKILL since a SIGBUS may result in a coredump which may
attempt to repeat the faulting access.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/sparc/kernel/traps_64.c |   73 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2051,6 +2051,73 @@ void sun4v_resum_overflow(struct pt_regs
 	atomic_inc(&sun4v_resum_oflow_cnt);
 }
 
+/* Given a set of registers, get the virtual addressi that was being accessed
+ * by the faulting instructions at tpc.
+ */
+static unsigned long sun4v_get_vaddr(struct pt_regs *regs)
+{
+	unsigned int insn;
+
+	if (!copy_from_user(&insn, (void __user *)regs->tpc, 4)) {
+		return compute_effective_address(regs, insn,
+						 (insn >> 25) & 0x1f);
+	}
+	return 0;
+}
+
+/* Attempt to handle non-resumable errors generated from userspace.
+ * Returns true if the signal was handled, false otherwise.
+ */
+bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
+				  struct sun4v_error_entry *ent) {
+
+	unsigned int attrs = ent->err_attrs;
+
+	if (attrs & SUN4V_ERR_ATTRS_MEMORY) {
+		unsigned long addr = ent->err_raddr;
+		siginfo_t info;
+
+		if (addr == ~(u64)0) {
+			/* This seems highly unlikely to ever occur */
+			pr_emerg("SUN4V NON-RECOVERABLE ERROR: Memory error detected in unknown location!\n");
+		} else {
+			unsigned long page_cnt = DIV_ROUND_UP(ent->err_size,
+							      PAGE_SIZE);
+
+			/* Break the unfortunate news. */
+			pr_emerg("SUN4V NON-RECOVERABLE ERROR: Memory failed at %016lX\n",
+				 addr);
+			pr_emerg("SUN4V NON-RECOVERABLE ERROR:   Claiming %lu ages.\n",
+				 page_cnt);
+
+			while (page_cnt-- > 0) {
+				if (pfn_valid(addr >> PAGE_SHIFT))
+					get_page(pfn_to_page(addr >> PAGE_SHIFT));
+				addr += PAGE_SIZE;
+			}
+		}
+		info.si_signo = SIGKILL;
+		info.si_errno = 0;
+		info.si_trapno = 0;
+		force_sig_info(info.si_signo, &info, current);
+
+		return true;
+	}
+	if (attrs & SUN4V_ERR_ATTRS_PIO) {
+		siginfo_t info;
+
+		info.si_signo = SIGBUS;
+		info.si_code = BUS_ADRERR;
+		info.si_addr = (void __user *)sun4v_get_vaddr(regs);
+		force_sig_info(info.si_signo, &info, current);
+
+		return true;
+	}
+
+	/* Default to doing nothing */
+	return false;
+}
+
 /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
  * Log the event, clear the first word of the entry, and die.
  */
@@ -2075,6 +2142,12 @@ void sun4v_nonresum_error(struct pt_regs
 
 	put_cpu();
 
+	if (!(regs->tstate & TSTATE_PRIV) &&
+	    sun4v_nonresum_error_user_handled(regs, &local_copy)) {
+		/* DON'T PANIC: This userspace error was handled. */
+		return;
+	}
+
 #ifdef CONFIG_PCI
 	/* Check for the special PCI poke sequence. */
 	if (pci_poke_in_progress && pci_poke_cpu == cpu) {

[toc] | [prev] | [next] | [standalone]


#1680114 — [PATCH 4.9 128/172] perf probe: Fix to show correct locations for events on modules

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 128/172] perf probe: Fix to show correct locations for events on modules
Message-ID<tZ9TN-2c1-139@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Masami Hiramatsu <mhiramat@kernel.org>


[ Upstream commit d2d4edbebe07ddb77980656abe7b9bc7a9e0cdf7 ]

Fix to show correct locations for events on modules by relocating given
address instead of retrying after failure.

This happens when the module text size is big enough, bigger than
sh_addr, because the original code retries with given address + sh_addr
if it failed to find CU DIE at the given address.

Any address smaller than sh_addr always fails and it retries with the
correct address, but addresses bigger than sh_addr will get a CU DIE
which is on the given address (not adjusted by sh_addr).

In my environment(x86-64), the sh_addr of ".text" section is 0x10030.
Since i915 is a huge kernel module, we can see this issue as below.

  $ grep "[Tt] .*\[i915\]" /proc/kallsyms | sort | head -n1
  ffffffffc0270000 t i915_switcheroo_can_switch	[i915]

ffffffffc0270000 + 0x10030 = ffffffffc0280030, so we'll check
symbols cross this boundary.

  $ grep "[Tt] .*\[i915\]" /proc/kallsyms | grep -B1 ^ffffffffc028\
  | head -n 2
  ffffffffc027ff80 t haswell_init_clock_gating	[i915]
  ffffffffc0280110 t valleyview_init_clock_gating	[i915]

So setup probes on both function and see what happen.

  $ sudo ./perf probe -m i915 -a haswell_init_clock_gating \
        -a valleyview_init_clock_gating
  Added new events:
    probe:haswell_init_clock_gating (on haswell_init_clock_gating in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating in i915)

  You can now use it in all perf tools, such as:

  	perf record -e probe:valleyview_init_clock_gating -aR sleep 1

  $ sudo ./perf probe -l
    probe:haswell_init_clock_gating (on haswell_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
    probe:valleyview_init_clock_gating (on i915_vga_set_decode:4@gpu/drm/i915/i915_drv.c in i915)

As you can see, haswell_init_clock_gating is correctly shown,
but valleyview_init_clock_gating is not.

With this patch, both events are shown correctly.

  $ sudo ./perf probe -l
    probe:haswell_init_clock_gating (on haswell_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)

Committer notes:

In my case:

  # perf probe -m i915 -a haswell_init_clock_gating -a valleyview_init_clock_gating
  Added new events:
    probe:haswell_init_clock_gating (on haswell_init_clock_gating in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating in i915)

  You can now use it in all perf tools, such as:

	  perf record -e probe:valleyview_init_clock_gating -aR sleep 1

  # perf probe -l
    probe:haswell_init_clock_gating (on i915_getparam+432@gpu/drm/i915/i915_drv.c in i915)
    probe:valleyview_init_clock_gating (on __i915_printk+240@gpu/drm/i915/i915_drv.c in i915)
  #

  # readelf -SW /lib/modules/4.9.0+/build/vmlinux | egrep -w '.text|Name'
   [Nr] Name   Type      Address          Off    Size   ES Flg Lk Inf Al
   [ 1] .text  PROGBITS  ffffffff81000000 200000 822fd3 00  AX  0   0 4096
  #

  So both are b0rked, now with the fix:

  # perf probe -m i915 -a haswell_init_clock_gating -a valleyview_init_clock_gating
  Added new events:
    probe:haswell_init_clock_gating (on haswell_init_clock_gating in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating in i915)

  You can now use it in all perf tools, such as:

	perf record -e probe:valleyview_init_clock_gating -aR sleep 1

  # perf probe -l
    probe:haswell_init_clock_gating (on haswell_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
  #

Both looks correct.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/148411436777.9978.1440275861947194930.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 tools/perf/util/probe-finder.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1543,16 +1543,12 @@ int debuginfo__find_probe_point(struct d
 	Dwarf_Addr _addr = 0, baseaddr = 0;
 	const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp;
 	int baseline = 0, lineno = 0, ret = 0;
-	bool reloc = false;
 
-retry:
+	/* We always need to relocate the address for aranges */
+	if (debuginfo__get_text_offset(dbg, &baseaddr) == 0)
+		addr += baseaddr;
 	/* Find cu die */
 	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
-		if (!reloc && debuginfo__get_text_offset(dbg, &baseaddr) == 0) {
-			addr += baseaddr;
-			reloc = true;
-			goto retry;
-		}
 		pr_warning("Failed to find debug information for address %lx\n",
 			   addr);
 		ret = -EINVAL;

[toc] | [prev] | [next] | [standalone]


#1680115 — [PATCH 4.9 151/172] tools arch: Sync arch/x86/lib/memcpy_64.S with the kernel

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 151/172] tools arch: Sync arch/x86/lib/memcpy_64.S with the kernel
Message-ID<tZ9TM-2c1-127@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnaldo Carvalho de Melo <acme@redhat.com>

commit e883d09c9eb2ffddfd057c17e6a0cef446ec8c9b upstream.

Just a minor fix done in:

  Fixes: 26a37ab319a2 ("x86/mce: Fix copy/paste error in exception table entries")

Cc: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/n/tip-ni9jzdd5yxlail6pq8cuexw2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 tools/arch/x86/lib/memcpy_64.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/arch/x86/lib/memcpy_64.S
+++ b/tools/arch/x86/lib/memcpy_64.S
@@ -286,7 +286,7 @@ ENDPROC(memcpy_mcsafe_unrolled)
 	_ASM_EXTABLE_FAULT(.L_copy_leading_bytes, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w0, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w1, .L_memcpy_mcsafe_fail)
-	_ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail)
+	_ASM_EXTABLE_FAULT(.L_cache_w2, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w4, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w5, .L_memcpy_mcsafe_fail)

[toc] | [prev] | [next] | [standalone]


#1680117 — [PATCH 4.9 109/172] arm64: assembler: make adr_l work in modules under KASLR

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 109/172] arm64: assembler: make adr_l work in modules under KASLR
Message-ID<tZ9TN-2c1-141@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>


[ Upstream commit 41c066f2c4d436c535616fe182331766c57838f0 ]

When CONFIG_RANDOMIZE_MODULE_REGION_FULL=y, the offset between loaded
modules and the core kernel may exceed 4 GB, putting symbols exported
by the core kernel out of the reach of the ordinary adrp/add instruction
pairs used to generate relative symbol references. So make the adr_l
macro emit a movz/movk sequence instead when executing in module context.

While at it, remove the pointless special case for the stack pointer.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/include/asm/assembler.h |   36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -155,22 +155,25 @@ lr	.req	x30		// link register
 
 /*
  * Pseudo-ops for PC-relative adr/ldr/str <reg>, <symbol> where
- * <symbol> is within the range +/- 4 GB of the PC.
+ * <symbol> is within the range +/- 4 GB of the PC when running
+ * in core kernel context. In module context, a movz/movk sequence
+ * is used, since modules may be loaded far away from the kernel
+ * when KASLR is in effect.
  */
 	/*
 	 * @dst: destination register (64 bit wide)
 	 * @sym: name of the symbol
-	 * @tmp: optional scratch register to be used if <dst> == sp, which
-	 *       is not allowed in an adrp instruction
 	 */
-	.macro	adr_l, dst, sym, tmp=
-	.ifb	\tmp
+	.macro	adr_l, dst, sym
+#ifndef MODULE
 	adrp	\dst, \sym
 	add	\dst, \dst, :lo12:\sym
-	.else
-	adrp	\tmp, \sym
-	add	\dst, \tmp, :lo12:\sym
-	.endif
+#else
+	movz	\dst, #:abs_g3:\sym
+	movk	\dst, #:abs_g2_nc:\sym
+	movk	\dst, #:abs_g1_nc:\sym
+	movk	\dst, #:abs_g0_nc:\sym
+#endif
 	.endm
 
 	/*
@@ -181,6 +184,7 @@ lr	.req	x30		// link register
 	 *       the address
 	 */
 	.macro	ldr_l, dst, sym, tmp=
+#ifndef MODULE
 	.ifb	\tmp
 	adrp	\dst, \sym
 	ldr	\dst, [\dst, :lo12:\sym]
@@ -188,6 +192,15 @@ lr	.req	x30		// link register
 	adrp	\tmp, \sym
 	ldr	\dst, [\tmp, :lo12:\sym]
 	.endif
+#else
+	.ifb	\tmp
+	adr_l	\dst, \sym
+	ldr	\dst, [\dst]
+	.else
+	adr_l	\tmp, \sym
+	ldr	\dst, [\tmp]
+	.endif
+#endif
 	.endm
 
 	/*
@@ -197,8 +210,13 @@ lr	.req	x30		// link register
 	 *       while <src> needs to be preserved.
 	 */
 	.macro	str_l, src, sym, tmp
+#ifndef MODULE
 	adrp	\tmp, \sym
 	str	\src, [\tmp, :lo12:\sym]
+#else
+	adr_l	\tmp, \sym
+	str	\src, [\tmp]
+#endif
 	.endm
 
 	/*

[toc] | [prev] | [next] | [standalone]


#1680118 — [PATCH 4.9 167/172] mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 167/172] mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program
Message-ID<tZ9TN-2c1-143@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kamal Dasu <kdasu.kdev@gmail.com>

commit 9d2ee0a60b8bd9bef2a0082c533736d6a7b39873 upstream.

On brcmnand controller v6.x and v7.x, the #WP pin is controlled through
the NAND_WP bit in CS_SELECT register.

The driver currently assumes that toggling the #WP pin is
instantaneously enabling/disabling write-protection, but it actually
takes some time to propagate the new state to the internal NAND chip
logic. This behavior is sometime causing data corruptions when an
erase/program operation is executed before write-protection has really
been disabled.

Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/nand/brcmnand/brcmnand.c |   61 +++++++++++++++++++++++++++++++++--
 1 file changed, 58 insertions(+), 3 deletions(-)

--- a/drivers/mtd/nand/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
@@ -101,6 +101,9 @@ struct brcm_nand_dma_desc {
 #define BRCMNAND_MIN_BLOCKSIZE	(8 * 1024)
 #define BRCMNAND_MIN_DEVSIZE	(4ULL * 1024 * 1024)
 
+#define NAND_CTRL_RDY			(INTFC_CTLR_READY | INTFC_FLASH_READY)
+#define NAND_POLL_STATUS_TIMEOUT_MS	100
+
 /* Controller feature flags */
 enum {
 	BRCMNAND_HAS_1K_SECTORS			= BIT(0),
@@ -765,6 +768,31 @@ enum {
 	CS_SELECT_AUTO_DEVICE_ID_CFG		= BIT(30),
 };
 
+static int bcmnand_ctrl_poll_status(struct brcmnand_controller *ctrl,
+				    u32 mask, u32 expected_val,
+				    unsigned long timeout_ms)
+{
+	unsigned long limit;
+	u32 val;
+
+	if (!timeout_ms)
+		timeout_ms = NAND_POLL_STATUS_TIMEOUT_MS;
+
+	limit = jiffies + msecs_to_jiffies(timeout_ms);
+	do {
+		val = brcmnand_read_reg(ctrl, BRCMNAND_INTFC_STATUS);
+		if ((val & mask) == expected_val)
+			return 0;
+
+		cpu_relax();
+	} while (time_after(limit, jiffies));
+
+	dev_warn(ctrl->dev, "timeout on status poll (expected %x got %x)\n",
+		 expected_val, val & mask);
+
+	return -ETIMEDOUT;
+}
+
 static inline void brcmnand_set_wp(struct brcmnand_controller *ctrl, bool en)
 {
 	u32 val = en ? CS_SELECT_NAND_WP : 0;
@@ -1024,12 +1052,39 @@ static void brcmnand_wp(struct mtd_info
 
 	if ((ctrl->features & BRCMNAND_HAS_WP) && wp_on == 1) {
 		static int old_wp = -1;
+		int ret;
 
 		if (old_wp != wp) {
 			dev_dbg(ctrl->dev, "WP %s\n", wp ? "on" : "off");
 			old_wp = wp;
 		}
+
+		/*
+		 * make sure ctrl/flash ready before and after
+		 * changing state of #WP pin
+		 */
+		ret = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY |
+					       NAND_STATUS_READY,
+					       NAND_CTRL_RDY |
+					       NAND_STATUS_READY, 0);
+		if (ret)
+			return;
+
 		brcmnand_set_wp(ctrl, wp);
+		chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
+		/* NAND_STATUS_WP 0x00 = protected, 0x80 = not protected */
+		ret = bcmnand_ctrl_poll_status(ctrl,
+					       NAND_CTRL_RDY |
+					       NAND_STATUS_READY |
+					       NAND_STATUS_WP,
+					       NAND_CTRL_RDY |
+					       NAND_STATUS_READY |
+					       (wp ? 0 : NAND_STATUS_WP), 0);
+
+		if (ret)
+			dev_err_ratelimited(&host->pdev->dev,
+					    "nand #WP expected %s\n",
+					    wp ? "on" : "off");
 	}
 }
 
@@ -1157,15 +1212,15 @@ static irqreturn_t brcmnand_dma_irq(int
 static void brcmnand_send_cmd(struct brcmnand_host *host, int cmd)
 {
 	struct brcmnand_controller *ctrl = host->ctrl;
-	u32 intfc;
+	int ret;
 
 	dev_dbg(ctrl->dev, "send native cmd %d addr_lo 0x%x\n", cmd,
 		brcmnand_read_reg(ctrl, BRCMNAND_CMD_ADDRESS));
 	BUG_ON(ctrl->cmd_pending != 0);
 	ctrl->cmd_pending = cmd;
 
-	intfc = brcmnand_read_reg(ctrl, BRCMNAND_INTFC_STATUS);
-	WARN_ON(!(intfc & INTFC_CTLR_READY));
+	ret = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY, NAND_CTRL_RDY, 0);
+	WARN_ON(ret);
 
 	mb(); /* flush previous writes */
 	brcmnand_write_reg(ctrl, BRCMNAND_CMD_START,

[toc] | [prev] | [next] | [standalone]


#1680121 — [PATCH 4.9 035/172] MIPS: pm-cps: Drop manual cache-line alignment of ready_count

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.9 035/172] MIPS: pm-cps: Drop manual cache-line alignment of ready_count
Message-ID<tZ9TN-2c1-149@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paul Burton <paul.burton@imgtec.com>

commit 161c51ccb7a6faf45ffe09aa5cf1ad85ccdad503 upstream.

We allocate memory for a ready_count variable per-CPU, which is accessed
via a cached non-coherent TLB mapping to perform synchronisation between
threads within the core using LL/SC instructions. In order to ensure
that the variable is contained within its own data cache line we
allocate 2 lines worth of memory & align the resulting pointer to a line
boundary. This is however unnecessary, since kmalloc is guaranteed to
return memory which is at least cache-line aligned (see
ARCH_DMA_MINALIGN). Stop the redundant manual alignment.

Besides cleaning up the code & avoiding needless work, this has the side
effect of avoiding an arithmetic error found by Bryan on 64 bit systems
due to the 32 bit size of the former dlinesz. This led the ready_count
variable to have its upper 32b cleared erroneously for MIPS64 kernels,
causing problems when ready_count was later used on MIPS64 via cpuidle.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Fixes: 3179d37ee1ed ("MIPS: pm-cps: add PM state entry code for CPS systems")
Reported-by: Bryan O'Donoghue <bryan.odonoghue@imgtec.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@imgtec.com>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15383/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/kernel/pm-cps.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

--- a/arch/mips/kernel/pm-cps.c
+++ b/arch/mips/kernel/pm-cps.c
@@ -56,7 +56,6 @@ DECLARE_BITMAP(state_support, CPS_PM_STA
  * state. Actually per-core rather than per-CPU.
  */
 static DEFINE_PER_CPU_ALIGNED(u32*, ready_count);
-static DEFINE_PER_CPU_ALIGNED(void*, ready_count_alloc);
 
 /* Indicates online CPUs coupled with the current CPU */
 static DEFINE_PER_CPU_ALIGNED(cpumask_t, online_coupled);
@@ -642,7 +641,6 @@ static int cps_pm_online_cpu(unsigned in
 {
 	enum cps_pm_state state;
 	unsigned core = cpu_data[cpu].core;
-	unsigned dlinesz = cpu_data[cpu].dcache.linesz;
 	void *entry_fn, *core_rc;
 
 	for (state = CPS_PM_NC_WAIT; state < CPS_PM_STATE_COUNT; state++) {
@@ -662,16 +660,11 @@ static int cps_pm_online_cpu(unsigned in
 	}
 
 	if (!per_cpu(ready_count, core)) {
-		core_rc = kmalloc(dlinesz * 2, GFP_KERNEL);
+		core_rc = kmalloc(sizeof(u32), GFP_KERNEL);
 		if (!core_rc) {
 			pr_err("Failed allocate core %u ready_count\n", core);
 			return -ENOMEM;
 		}
-		per_cpu(ready_count_alloc, core) = core_rc;
-
-		/* Ensure ready_count is aligned to a cacheline boundary */
-		core_rc += dlinesz - 1;
-		core_rc = (void *)((unsigned long)core_rc & ~(dlinesz - 1));
 		per_cpu(ready_count, core) = core_rc;
 	}
 

[toc] | [prev] | [next] | [standalone]


#1680165 — [PATCH 4.9 130/172] tipc: allocate user memory with GFP_KERNEL flag

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 16:10 +0200
Subject[PATCH 4.9 130/172] tipc: allocate user memory with GFP_KERNEL flag
Message-ID<tZad3-2zr-1@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>


[ Upstream commit 57d5f64d83ab5b5a5118b1597386dd76eaf4340d ]

Until now, we allocate memory always with GFP_ATOMIC flag.
When the system is under memory pressure and a user tries to send,
the send fails due to low memory. However, the user application
can wait for free memory if we allocate it using GFP_KERNEL flag.

In this commit, we use allocate memory with GFP_KERNEL for all user
allocation.

Reported-by: Rune Torgersen <runet@innovsys.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/tipc/discover.c   |    4 ++--
 net/tipc/link.c       |    2 +-
 net/tipc/msg.c        |   16 ++++++++--------
 net/tipc/msg.h        |    2 +-
 net/tipc/name_distr.c |    2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -169,7 +169,7 @@ void tipc_disc_rcv(struct net *net, stru
 
 	/* Send response, if necessary */
 	if (respond && (mtyp == DSC_REQ_MSG)) {
-		rskb = tipc_buf_acquire(MAX_H_SIZE);
+		rskb = tipc_buf_acquire(MAX_H_SIZE, GFP_ATOMIC);
 		if (!rskb)
 			return;
 		tipc_disc_init_msg(net, rskb, DSC_RESP_MSG, bearer);
@@ -278,7 +278,7 @@ int tipc_disc_create(struct net *net, st
 	req = kmalloc(sizeof(*req), GFP_ATOMIC);
 	if (!req)
 		return -ENOMEM;
-	req->buf = tipc_buf_acquire(MAX_H_SIZE);
+	req->buf = tipc_buf_acquire(MAX_H_SIZE, GFP_ATOMIC);
 	if (!req->buf) {
 		kfree(req);
 		return -ENOMEM;
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1395,7 +1395,7 @@ tnl:
 			msg_set_seqno(hdr, seqno++);
 		pktlen = msg_size(hdr);
 		msg_set_size(&tnlhdr, pktlen + INT_H_SIZE);
-		tnlskb = tipc_buf_acquire(pktlen + INT_H_SIZE);
+		tnlskb = tipc_buf_acquire(pktlen + INT_H_SIZE, GFP_ATOMIC);
 		if (!tnlskb) {
 			pr_warn("%sunable to send packet\n", link_co_err);
 			return;
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -58,12 +58,12 @@ static unsigned int align(unsigned int i
  * NOTE: Headroom is reserved to allow prepending of a data link header.
  *       There may also be unrequested tailroom present at the buffer's end.
  */
-struct sk_buff *tipc_buf_acquire(u32 size)
+struct sk_buff *tipc_buf_acquire(u32 size, gfp_t gfp)
 {
 	struct sk_buff *skb;
 	unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u;
 
-	skb = alloc_skb_fclone(buf_size, GFP_ATOMIC);
+	skb = alloc_skb_fclone(buf_size, gfp);
 	if (skb) {
 		skb_reserve(skb, BUF_HEADROOM);
 		skb_put(skb, size);
@@ -95,7 +95,7 @@ struct sk_buff *tipc_msg_create(uint use
 	struct tipc_msg *msg;
 	struct sk_buff *buf;
 
-	buf = tipc_buf_acquire(hdr_sz + data_sz);
+	buf = tipc_buf_acquire(hdr_sz + data_sz, GFP_ATOMIC);
 	if (unlikely(!buf))
 		return NULL;
 
@@ -261,7 +261,7 @@ int tipc_msg_build(struct tipc_msg *mhdr
 
 	/* No fragmentation needed? */
 	if (likely(msz <= pktmax)) {
-		skb = tipc_buf_acquire(msz);
+		skb = tipc_buf_acquire(msz, GFP_KERNEL);
 		if (unlikely(!skb))
 			return -ENOMEM;
 		skb_orphan(skb);
@@ -282,7 +282,7 @@ int tipc_msg_build(struct tipc_msg *mhdr
 	msg_set_importance(&pkthdr, msg_importance(mhdr));
 
 	/* Prepare first fragment */
-	skb = tipc_buf_acquire(pktmax);
+	skb = tipc_buf_acquire(pktmax, GFP_KERNEL);
 	if (!skb)
 		return -ENOMEM;
 	skb_orphan(skb);
@@ -313,7 +313,7 @@ int tipc_msg_build(struct tipc_msg *mhdr
 			pktsz = drem + INT_H_SIZE;
 		else
 			pktsz = pktmax;
-		skb = tipc_buf_acquire(pktsz);
+		skb = tipc_buf_acquire(pktsz, GFP_KERNEL);
 		if (!skb) {
 			rc = -ENOMEM;
 			goto error;
@@ -448,7 +448,7 @@ bool tipc_msg_make_bundle(struct sk_buff
 	if (msz > (max / 2))
 		return false;
 
-	_skb = tipc_buf_acquire(max);
+	_skb = tipc_buf_acquire(max, GFP_ATOMIC);
 	if (!_skb)
 		return false;
 
@@ -496,7 +496,7 @@ bool tipc_msg_reverse(u32 own_node,  str
 
 	/* Never return SHORT header; expand by replacing buffer if necessary */
 	if (msg_short(hdr)) {
-		*skb = tipc_buf_acquire(BASIC_H_SIZE + dlen);
+		*skb = tipc_buf_acquire(BASIC_H_SIZE + dlen, GFP_ATOMIC);
 		if (!*skb)
 			goto exit;
 		memcpy((*skb)->data + BASIC_H_SIZE, msg_data(hdr), dlen);
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -820,7 +820,7 @@ static inline bool msg_is_reset(struct t
 	return (msg_user(hdr) == LINK_PROTOCOL) && (msg_type(hdr) == RESET_MSG);
 }
 
-struct sk_buff *tipc_buf_acquire(u32 size);
+struct sk_buff *tipc_buf_acquire(u32 size, gfp_t gfp);
 bool tipc_msg_validate(struct sk_buff *skb);
 bool tipc_msg_reverse(u32 own_addr, struct sk_buff **skb, int err);
 void tipc_msg_init(u32 own_addr, struct tipc_msg *m, u32 user, u32 type,
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -69,7 +69,7 @@ static struct sk_buff *named_prepare_buf
 					 u32 dest)
 {
 	struct tipc_net *tn = net_generic(net, tipc_net_id);
-	struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size);
+	struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size, GFP_ATOMIC);
 	struct tipc_msg *msg;
 
 	if (buf != NULL) {

[toc] | [prev] | [next] | [standalone]


#1680170 — [PATCH 4.9 169/172] KVM: x86: fix emulation of RSM and IRET instructions

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 16:10 +0200
Subject[PATCH 4.9 169/172] KVM: x86: fix emulation of RSM and IRET instructions
Message-ID<tZad3-2zr-11@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ladi Prosek <lprosek@redhat.com>

commit 6ed071f051e12cf7baa1b69d3becb8f232fdfb7b upstream.

On AMD, the effect of set_nmi_mask called by emulate_iret_real and em_rsm
on hflags is reverted later on in x86_emulate_instruction where hflags are
overwritten with ctxt->emul_flags (the kvm_set_hflags call). This manifests
as a hang when rebooting Windows VMs with QEMU, OVMF, and >1 vcpu.

Instead of trying to merge ctxt->emul_flags into vcpu->arch.hflags after
an instruction is emulated, this commit deletes emul_flags altogether and
makes the emulator access vcpu->arch.hflags using two new accessors. This
way all changes, on the emulator side as well as in functions called from
the emulator and accessing vcpu state with emul_to_vcpu, are preserved.

More details on the bug and its manifestation with Windows and OVMF:

  It's a KVM bug in the interaction between SMI/SMM and NMI, specific to AMD.
  I believe that the SMM part explains why we started seeing this only with
  OVMF.

  KVM masks and unmasks NMI when entering and leaving SMM. When KVM emulates
  the RSM instruction in em_rsm, the set_nmi_mask call doesn't stick because
  later on in x86_emulate_instruction we overwrite arch.hflags with
  ctxt->emul_flags, effectively reverting the effect of the set_nmi_mask call.
  The AMD-specific hflag of interest here is HF_NMI_MASK.

  When rebooting the system, Windows sends an NMI IPI to all but the current
  cpu to shut them down. Only after all of them are parked in HLT will the
  initiating cpu finish the restart. If NMI is masked, other cpus never get
  the memo and the initiating cpu spins forever, waiting for
  hal!HalpInterruptProcessorsStarted to drop. That's the symptom we observe.

Fixes: a584539b24b8 ("KVM: x86: pass the whole hflags field to emulator and back")
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/include/asm/kvm_emulate.h |    4 +++-
 arch/x86/kvm/emulate.c             |   16 +++++++++-------
 arch/x86/kvm/x86.c                 |   15 ++++++++++++---
 3 files changed, 24 insertions(+), 11 deletions(-)

--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -221,6 +221,9 @@ struct x86_emulate_ops {
 	void (*get_cpuid)(struct x86_emulate_ctxt *ctxt,
 			  u32 *eax, u32 *ebx, u32 *ecx, u32 *edx);
 	void (*set_nmi_mask)(struct x86_emulate_ctxt *ctxt, bool masked);
+
+	unsigned (*get_hflags)(struct x86_emulate_ctxt *ctxt);
+	void (*set_hflags)(struct x86_emulate_ctxt *ctxt, unsigned hflags);
 };
 
 typedef u32 __attribute__((vector_size(16))) sse128_t;
@@ -290,7 +293,6 @@ struct x86_emulate_ctxt {
 
 	/* interruptibility state, as a result of execution of STI or MOV SS */
 	int interruptibility;
-	int emul_flags;
 
 	bool perm_ok; /* do not check permissions if true */
 	bool ud;	/* inject an #UD if host doesn't support insn */
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2543,7 +2543,7 @@ static int em_rsm(struct x86_emulate_ctx
 	u64 smbase;
 	int ret;
 
-	if ((ctxt->emul_flags & X86EMUL_SMM_MASK) == 0)
+	if ((ctxt->ops->get_hflags(ctxt) & X86EMUL_SMM_MASK) == 0)
 		return emulate_ud(ctxt);
 
 	/*
@@ -2592,11 +2592,11 @@ static int em_rsm(struct x86_emulate_ctx
 		return X86EMUL_UNHANDLEABLE;
 	}
 
-	if ((ctxt->emul_flags & X86EMUL_SMM_INSIDE_NMI_MASK) == 0)
+	if ((ctxt->ops->get_hflags(ctxt) & X86EMUL_SMM_INSIDE_NMI_MASK) == 0)
 		ctxt->ops->set_nmi_mask(ctxt, false);
 
-	ctxt->emul_flags &= ~X86EMUL_SMM_INSIDE_NMI_MASK;
-	ctxt->emul_flags &= ~X86EMUL_SMM_MASK;
+	ctxt->ops->set_hflags(ctxt, ctxt->ops->get_hflags(ctxt) &
+		~(X86EMUL_SMM_INSIDE_NMI_MASK | X86EMUL_SMM_MASK));
 	return X86EMUL_CONTINUE;
 }
 
@@ -5312,6 +5312,7 @@ int x86_emulate_insn(struct x86_emulate_
 	const struct x86_emulate_ops *ops = ctxt->ops;
 	int rc = X86EMUL_CONTINUE;
 	int saved_dst_type = ctxt->dst.type;
+	unsigned emul_flags;
 
 	ctxt->mem_read.pos = 0;
 
@@ -5326,6 +5327,7 @@ int x86_emulate_insn(struct x86_emulate_
 		goto done;
 	}
 
+	emul_flags = ctxt->ops->get_hflags(ctxt);
 	if (unlikely(ctxt->d &
 		     (No64|Undefined|Sse|Mmx|Intercept|CheckPerm|Priv|Prot|String))) {
 		if ((ctxt->mode == X86EMUL_MODE_PROT64 && (ctxt->d & No64)) ||
@@ -5359,7 +5361,7 @@ int x86_emulate_insn(struct x86_emulate_
 				fetch_possible_mmx_operand(ctxt, &ctxt->dst);
 		}
 
-		if (unlikely(ctxt->emul_flags & X86EMUL_GUEST_MASK) && ctxt->intercept) {
+		if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && ctxt->intercept) {
 			rc = emulator_check_intercept(ctxt, ctxt->intercept,
 						      X86_ICPT_PRE_EXCEPT);
 			if (rc != X86EMUL_CONTINUE)
@@ -5388,7 +5390,7 @@ int x86_emulate_insn(struct x86_emulate_
 				goto done;
 		}
 
-		if (unlikely(ctxt->emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
+		if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
 			rc = emulator_check_intercept(ctxt, ctxt->intercept,
 						      X86_ICPT_POST_EXCEPT);
 			if (rc != X86EMUL_CONTINUE)
@@ -5442,7 +5444,7 @@ int x86_emulate_insn(struct x86_emulate_
 
 special_insn:
 
-	if (unlikely(ctxt->emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
+	if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
 		rc = emulator_check_intercept(ctxt, ctxt->intercept,
 					      X86_ICPT_POST_MEMACCESS);
 		if (rc != X86EMUL_CONTINUE)
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5154,6 +5154,16 @@ static void emulator_set_nmi_mask(struct
 	kvm_x86_ops->set_nmi_mask(emul_to_vcpu(ctxt), masked);
 }
 
+static unsigned emulator_get_hflags(struct x86_emulate_ctxt *ctxt)
+{
+	return emul_to_vcpu(ctxt)->arch.hflags;
+}
+
+static void emulator_set_hflags(struct x86_emulate_ctxt *ctxt, unsigned emul_flags)
+{
+	kvm_set_hflags(emul_to_vcpu(ctxt), emul_flags);
+}
+
 static const struct x86_emulate_ops emulate_ops = {
 	.read_gpr            = emulator_read_gpr,
 	.write_gpr           = emulator_write_gpr,
@@ -5193,6 +5203,8 @@ static const struct x86_emulate_ops emul
 	.intercept           = emulator_intercept,
 	.get_cpuid           = emulator_get_cpuid,
 	.set_nmi_mask        = emulator_set_nmi_mask,
+	.get_hflags          = emulator_get_hflags,
+	.set_hflags          = emulator_set_hflags,
 };
 
 static void toggle_interruptibility(struct kvm_vcpu *vcpu, u32 mask)
@@ -5245,7 +5257,6 @@ static void init_emulate_ctxt(struct kvm
 	BUILD_BUG_ON(HF_GUEST_MASK != X86EMUL_GUEST_MASK);
 	BUILD_BUG_ON(HF_SMM_MASK != X86EMUL_SMM_MASK);
 	BUILD_BUG_ON(HF_SMM_INSIDE_NMI_MASK != X86EMUL_SMM_INSIDE_NMI_MASK);
-	ctxt->emul_flags = vcpu->arch.hflags;
 
 	init_decode_cache(ctxt);
 	vcpu->arch.emulate_regs_need_sync_from_vcpu = false;
@@ -5636,8 +5647,6 @@ restart:
 		unsigned long rflags = kvm_x86_ops->get_rflags(vcpu);
 		toggle_interruptibility(vcpu, ctxt->interruptibility);
 		vcpu->arch.emulate_regs_need_sync_to_vcpu = false;
-		if (vcpu->arch.hflags != ctxt->emul_flags)
-			kvm_set_hflags(vcpu, ctxt->emul_flags);
 		kvm_rip_write(vcpu, ctxt->eip);
 		if (r == EMULATE_DONE)
 			kvm_vcpu_check_singlestep(vcpu, rflags, &r);

[toc] | [prev] | [next] | [standalone]


#1680176 — [PATCH 4.9 168/172] arm64: fix NULL dereference in have_cpu_die()

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 16:10 +0200
Subject[PATCH 4.9 168/172] arm64: fix NULL dereference in have_cpu_die()
Message-ID<tZad4-2zr-27@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Salter <msalter@redhat.com>

commit 335d2c2d192266358c5dfa64953a4c162f46e464 upstream.

Commit 5c492c3f5255 ("arm64: smp: Add function to determine if cpus are
stuck in the kernel") added a helper function to determine if die() is
supported in cpu_ops. This function assumes a cpu will have a valid
cpu_ops entry, but that may not be the case for cpu0 is spin-table or
parking protocol is used to boot secondary cpus. In that case, there
is a NULL dereference if have_cpu_die() is called by cpu0. So add a
check for a valid cpu_ops before dereferencing it.

Fixes: 5c492c3f5255 ("arm64: smp: Add function to determine if cpus are stuck in the kernel")
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm64/kernel/smp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -934,7 +934,7 @@ static bool have_cpu_die(void)
 #ifdef CONFIG_HOTPLUG_CPU
 	int any_cpu = raw_smp_processor_id();
 
-	if (cpu_ops[any_cpu]->cpu_die)
+	if (cpu_ops[any_cpu] && cpu_ops[any_cpu]->cpu_die)
 		return true;
 #endif
 	return false;

[toc] | [prev] | [next] | [standalone]


#1680184 — [PATCH 4.9 125/172] be2net: fix status check in be_cmd_pmac_add()

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 16:10 +0200
Subject[PATCH 4.9 125/172] be2net: fix status check in be_cmd_pmac_add()
Message-ID<tZad5-2zr-51@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ivan Vecera <cera@cera.cz>


[ Upstream commit fe68d8bfe59c561664aa87d827aa4b320eb08895 ]

Return value from be_mcc_notify_wait() contains a base completion status
together with an additional status. The base_status() macro need to be
used to access base status.

Fixes: e3a7ae2 be2net: Changing MAC Address of a VF was broken
Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1118,7 +1118,7 @@ int be_cmd_pmac_add(struct be_adapter *a
 err:
 	mutex_unlock(&adapter->mcc_lock);
 
-	 if (status == MCC_STATUS_UNAUTHORIZED_REQUEST)
+	 if (base_status(status) == MCC_STATUS_UNAUTHORIZED_REQUEST)
 		status = -EPERM;
 
 	return status;

[toc] | [prev] | [next] | [standalone]


#1680190 — [PATCH 4.9 133/172] sctp: check af before verify address in sctp_addr_id2transport

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 16:10 +0200
Subject[PATCH 4.9 133/172] sctp: check af before verify address in sctp_addr_id2transport
Message-ID<tZad6-2zr-61@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Xin Long <lucien.xin@gmail.com>


[ Upstream commit 912964eacb111551db73429719eb5fadcab0ff8a ]

Commit 6f29a1306131 ("sctp: sctp_addr_id2transport should verify the
addr before looking up assoc") invoked sctp_verify_addr to verify the
addr.

But it didn't check af variable beforehand, once users pass an address
with family = 0 through sockopt, sctp_get_af_specific will return NULL
and NULL pointer dereference will be caused by af->sockaddr_len.

This patch is to fix it by returning NULL if af variable is NULL.

Fixes: 6f29a1306131 ("sctp: sctp_addr_id2transport should verify the addr before looking up assoc")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/sctp/socket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -239,7 +239,7 @@ static struct sctp_transport *sctp_addr_
 	union sctp_addr *laddr = (union sctp_addr *)addr;
 	struct sctp_transport *transport;
 
-	if (sctp_verify_addr(sk, laddr, af->sockaddr_len))
+	if (!af || sctp_verify_addr(sk, laddr, af->sockaddr_len))
 		return NULL;
 
 	addr_asoc = sctp_endpoint_lookup_assoc(sctp_sk(sk)->ep,

[toc] | [prev] | [next] | [standalone]


#1680197 — [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated functions in modules

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 16:10 +0200
Subject[PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated functions in modules
Message-ID<tZad7-2zr-73@gated-at.bofh.it>
In reply to#1680105
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Masami Hiramatsu <mhiramat@kernel.org>


[ Upstream commit 613f050d68a8ed3c0b18b9568698908ef7bbc1f7 ]

Fix to probe on gcc generated functions on modules. Since
probing on a module is based on its symbol name, it should
be adjusted on actual symbols.

E.g. without this fix, perf probe shows probe definition
on non-exist symbol as below.

  $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -F in_range*
  in_range.isra.12
  $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
  p:probe/in_range nf_nat:in_range+0

With this fix, perf probe correctly shows a probe on
gcc-generated symbol.

  $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
  p:probe/in_range nf_nat:in_range.isra.12+0

This also fixes same problem on online module as below.

  $ perf probe -m i915 -D assert_plane
  p:probe/assert_plane i915:assert_plane.constprop.134+0

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/148411450673.9978.14905987549651656075.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 tools/perf/util/probe-event.c  |   45 ++++++++++++++++++++++++++---------------
 tools/perf/util/probe-finder.c |    7 ++++--
 tools/perf/util/probe-finder.h |    3 ++
 3 files changed, 37 insertions(+), 18 deletions(-)

--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -645,18 +645,31 @@ static int add_exec_to_probe_trace_event
 	return ret;
 }
 
-static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
-					    int ntevs, const char *module)
+static int
+post_process_module_probe_trace_events(struct probe_trace_event *tevs,
+				       int ntevs, const char *module,
+				       struct debuginfo *dinfo)
 {
+	Dwarf_Addr text_offs = 0;
 	int i, ret = 0;
 	char *mod_name = NULL;
+	struct map *map;
 
 	if (!module)
 		return 0;
 
-	mod_name = find_module_name(module);
+	map = get_target_map(module, false);
+	if (!map || debuginfo__get_text_offset(dinfo, &text_offs, true) < 0) {
+		pr_warning("Failed to get ELF symbols for %s\n", module);
+		return -EINVAL;
+	}
 
+	mod_name = find_module_name(module);
 	for (i = 0; i < ntevs; i++) {
+		ret = post_process_probe_trace_point(&tevs[i].point,
+						map, (unsigned long)text_offs);
+		if (ret < 0)
+			break;
 		tevs[i].point.module =
 			strdup(mod_name ? mod_name : module);
 		if (!tevs[i].point.module) {
@@ -666,6 +679,8 @@ static int add_module_to_probe_trace_eve
 	}
 
 	free(mod_name);
+	map__put(map);
+
 	return ret;
 }
 
@@ -722,7 +737,7 @@ arch__post_process_probe_trace_events(st
 static int post_process_probe_trace_events(struct perf_probe_event *pev,
 					   struct probe_trace_event *tevs,
 					   int ntevs, const char *module,
-					   bool uprobe)
+					   bool uprobe, struct debuginfo *dinfo)
 {
 	int ret;
 
@@ -730,7 +745,8 @@ static int post_process_probe_trace_even
 		ret = add_exec_to_probe_trace_events(tevs, ntevs, module);
 	else if (module)
 		/* Currently ref_reloc_sym based probe is not for drivers */
-		ret = add_module_to_probe_trace_events(tevs, ntevs, module);
+		ret = post_process_module_probe_trace_events(tevs, ntevs,
+							     module, dinfo);
 	else
 		ret = post_process_kernel_probe_trace_events(tevs, ntevs);
 
@@ -774,30 +790,27 @@ static int try_to_find_probe_trace_event
 		}
 	}
 
-	debuginfo__delete(dinfo);
-
 	if (ntevs > 0) {	/* Succeeded to find trace events */
 		pr_debug("Found %d probe_trace_events.\n", ntevs);
 		ret = post_process_probe_trace_events(pev, *tevs, ntevs,
-						pev->target, pev->uprobes);
+					pev->target, pev->uprobes, dinfo);
 		if (ret < 0 || ret == ntevs) {
+			pr_debug("Post processing failed or all events are skipped. (%d)\n", ret);
 			clear_probe_trace_events(*tevs, ntevs);
 			zfree(tevs);
+			ntevs = 0;
 		}
-		if (ret != ntevs)
-			return ret < 0 ? ret : ntevs;
-		ntevs = 0;
-		/* Fall through */
 	}
 
+	debuginfo__delete(dinfo);
+
 	if (ntevs == 0)	{	/* No error but failed to find probe point. */
 		pr_warning("Probe point '%s' not found.\n",
 			   synthesize_perf_probe_point(&pev->point));
 		return -ENOENT;
-	}
-	/* Error path : ntevs < 0 */
-	pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
-	if (ntevs < 0) {
+	} else if (ntevs < 0) {
+		/* Error path : ntevs < 0 */
+		pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
 		if (ntevs == -EBADF)
 			pr_warning("Warning: No dwarf info found in the vmlinux - "
 				"please rebuild kernel with CONFIG_DEBUG_INFO=y.\n");
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1501,7 +1501,8 @@ int debuginfo__find_available_vars_at(st
 }
 
 /* For the kernel module, we need a special code to get a DIE */
-static int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs)
+int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
+				bool adjust_offset)
 {
 	int n, i;
 	Elf32_Word shndx;
@@ -1530,6 +1531,8 @@ static int debuginfo__get_text_offset(st
 			if (!shdr)
 				return -ENOENT;
 			*offs = shdr->sh_addr;
+			if (adjust_offset)
+				*offs -= shdr->sh_offset;
 		}
 	}
 	return 0;
@@ -1545,7 +1548,7 @@ int debuginfo__find_probe_point(struct d
 	int baseline = 0, lineno = 0, ret = 0;
 
 	/* We always need to relocate the address for aranges */
-	if (debuginfo__get_text_offset(dbg, &baseaddr) == 0)
+	if (debuginfo__get_text_offset(dbg, &baseaddr, false) == 0)
 		addr += baseaddr;
 	/* Find cu die */
 	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -46,6 +46,9 @@ int debuginfo__find_trace_events(struct
 int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr,
 				struct perf_probe_point *ppt);
 
+int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
+			       bool adjust_offset);
+
 /* Find a line range */
 int debuginfo__find_line_range(struct debuginfo *dbg, struct line_range *lr);
 

[toc] | [prev] | [next] | [standalone]


#1681763 — Re: [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated functions in modules

FromKrister Johansen <kjlx@templeofstupid.com>
Date2017-07-05 22:10 +0200
SubjectRe: [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated functions in modules
Message-ID<tZYMz-2CG-41@gated-at.bofh.it>
In reply to#1680197
Hey Greg,

> 4.9-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Masami Hiramatsu <mhiramat@kernel.org>
> 
> 
> [ Upstream commit 613f050d68a8ed3c0b18b9568698908ef7bbc1f7 ]
> 
> Fix to probe on gcc generated functions on modules. Since
> probing on a module is based on its symbol name, it should
> be adjusted on actual symbols.
> 
> E.g. without this fix, perf probe shows probe definition
> on non-exist symbol as below.
> 
>   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -F in_range*
>   in_range.isra.12
>   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
>   p:probe/in_range nf_nat:in_range+0
> 
> With this fix, perf probe correctly shows a probe on
> gcc-generated symbol.
> 
>   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
>   p:probe/in_range nf_nat:in_range.isra.12+0
> 
> This also fixes same problem on online module as below.
> 
>   $ perf probe -m i915 -D assert_plane
>   p:probe/assert_plane i915:assert_plane.constprop.134+0
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Link: http://lkml.kernel.org/r/148411450673.9978.14905987549651656075.stgit@devbox
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  tools/perf/util/probe-event.c  |   45 ++++++++++++++++++++++++++---------------
>  tools/perf/util/probe-finder.c |    7 ++++--
>  tools/perf/util/probe-finder.h |    3 ++
>  3 files changed, 37 insertions(+), 18 deletions(-)
> 
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -645,18 +645,31 @@ static int add_exec_to_probe_trace_event
>  	return ret;
>  }
>  
> -static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
> -					    int ntevs, const char *module)
> +static int
> +post_process_module_probe_trace_events(struct probe_trace_event *tevs,
> +				       int ntevs, const char *module,
> +				       struct debuginfo *dinfo)
>  {
> +	Dwarf_Addr text_offs = 0;
>  	int i, ret = 0;
>  	char *mod_name = NULL;
> +	struct map *map;
>  
>  	if (!module)
>  		return 0;
>  
> -	mod_name = find_module_name(module);
> +	map = get_target_map(module, false);
> +	if (!map || debuginfo__get_text_offset(dinfo, &text_offs, true) < 0) {
> +		pr_warning("Failed to get ELF symbols for %s\n", module);
> +		return -EINVAL;
> +	}
>  
> +	mod_name = find_module_name(module);
>  	for (i = 0; i < ntevs; i++) {
> +		ret = post_process_probe_trace_point(&tevs[i].point,
> +						map, (unsigned long)text_offs);
> +		if (ret < 0)
> +			break;
>  		tevs[i].point.module =
>  			strdup(mod_name ? mod_name : module);
>  		if (!tevs[i].point.module) {
> @@ -666,6 +679,8 @@ static int add_module_to_probe_trace_eve
>  	}
>  
>  	free(mod_name);
> +	map__put(map);
> +
>  	return ret;
>  }
>  
> @@ -722,7 +737,7 @@ arch__post_process_probe_trace_events(st
>  static int post_process_probe_trace_events(struct perf_probe_event *pev,
>  					   struct probe_trace_event *tevs,
>  					   int ntevs, const char *module,
> -					   bool uprobe)
> +					   bool uprobe, struct debuginfo *dinfo)
>  {
>  	int ret;
>  
> @@ -730,7 +745,8 @@ static int post_process_probe_trace_even
>  		ret = add_exec_to_probe_trace_events(tevs, ntevs, module);
>  	else if (module)
>  		/* Currently ref_reloc_sym based probe is not for drivers */
> -		ret = add_module_to_probe_trace_events(tevs, ntevs, module);
> +		ret = post_process_module_probe_trace_events(tevs, ntevs,
> +							     module, dinfo);
>  	else
>  		ret = post_process_kernel_probe_trace_events(tevs, ntevs);
>  
> @@ -774,30 +790,27 @@ static int try_to_find_probe_trace_event
>  		}
>  	}
>  
> -	debuginfo__delete(dinfo);
> -
>  	if (ntevs > 0) {	/* Succeeded to find trace events */
>  		pr_debug("Found %d probe_trace_events.\n", ntevs);
>  		ret = post_process_probe_trace_events(pev, *tevs, ntevs,
> -						pev->target, pev->uprobes);
> +					pev->target, pev->uprobes, dinfo);
>  		if (ret < 0 || ret == ntevs) {
> +			pr_debug("Post processing failed or all events are skipped. (%d)\n", ret);
>  			clear_probe_trace_events(*tevs, ntevs);
>  			zfree(tevs);
> +			ntevs = 0;
>  		}
> -		if (ret != ntevs)
> -			return ret < 0 ? ret : ntevs;
> -		ntevs = 0;
> -		/* Fall through */
>  	}
>  
> +	debuginfo__delete(dinfo);
> +
>  	if (ntevs == 0)	{	/* No error but failed to find probe point. */
>  		pr_warning("Probe point '%s' not found.\n",
>  			   synthesize_perf_probe_point(&pev->point));
>  		return -ENOENT;
> -	}
> -	/* Error path : ntevs < 0 */
> -	pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
> -	if (ntevs < 0) {
> +	} else if (ntevs < 0) {
> +		/* Error path : ntevs < 0 */
> +		pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
>  		if (ntevs == -EBADF)
>  			pr_warning("Warning: No dwarf info found in the vmlinux - "
>  				"please rebuild kernel with CONFIG_DEBUG_INFO=y.\n");
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -1501,7 +1501,8 @@ int debuginfo__find_available_vars_at(st
>  }
>  
>  /* For the kernel module, we need a special code to get a DIE */
> -static int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs)
> +int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
> +				bool adjust_offset)
>  {
>  	int n, i;
>  	Elf32_Word shndx;
> @@ -1530,6 +1531,8 @@ static int debuginfo__get_text_offset(st
>  			if (!shdr)
>  				return -ENOENT;
>  			*offs = shdr->sh_addr;
> +			if (adjust_offset)
> +				*offs -= shdr->sh_offset;
>  		}
>  	}
>  	return 0;
> @@ -1545,7 +1548,7 @@ int debuginfo__find_probe_point(struct d
>  	int baseline = 0, lineno = 0, ret = 0;
>  
>  	/* We always need to relocate the address for aranges */
> -	if (debuginfo__get_text_offset(dbg, &baseaddr) == 0)
> +	if (debuginfo__get_text_offset(dbg, &baseaddr, false) == 0)
>  		addr += baseaddr;
>  	/* Find cu die */
>  	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
> --- a/tools/perf/util/probe-finder.h
> +++ b/tools/perf/util/probe-finder.h
> @@ -46,6 +46,9 @@ int debuginfo__find_trace_events(struct
>  int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr,
>  				struct perf_probe_point *ppt);
>  
> +int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
> +			       bool adjust_offset);
> +
>  /* Find a line range */
>  int debuginfo__find_line_range(struct debuginfo *dbg, struct line_range *lr);

I'm getting the following error when I try to build perf from 4.9.36:

   util/probe-event.c: In function ‘post_process_module_probe_trace_events’:
   util/probe-event.c:685:3: error: implicit declaration of function ‘post_process_probe_trace_point’ [-Werror=implicit-function-declaration]
      ret = post_process_probe_trace_point(&tevs[i].point,
      ^
   util/probe-event.c:685:3: error: nested extern declaration of ‘post_process_probe_trace_point’ [-Werror=nested-externs]
   cc1: all warnings being treated as errors

At first blush, it looks like we're missing another patch upon which
this one depends.  However, after cherry-picking the fix for
3e96dac7c956089d3f23aca98c4dfca57b6aaf8a back to 4.9.36, the build then
fails with:

   util/probe-event.c:549:12: note: declared here
    static int get_text_start_address(const char *exec, unsigned long *address,
               ^
   util/probe-event.c: At top level:
   util/probe-event.c:672:1: error: ‘post_process_offline_probe_trace_events’ defined but not used [-Werror=unused-function]
    post_process_offline_probe_trace_events(struct probe_trace_event *tevs,
    ^
   cc1: all warnings being treated as errors

It turns out that this has a second dependency,
8a937a25a7e3c19d5fb3f9d92f605cf5fda219d8.  After fiddling with this a
little bit more, I realized I need to invert the order to get a clean
merge of the two fixes.  This ordering is good:

8a937a25a7e3c19d5fb3f9d92f605cf5fda219d8
3e96dac7c956089d3f23aca98c4dfca57b6aaf8a 

With that I can get a clean build of the perf tree.  All of that said,
I'm not sure whether there are additional patches needed to fully
leverage the added functionality.  Perhaps Arnaldo or Masami can
comment?

Thanks,

-K

[toc] | [prev] | [next] | [standalone]


#1686526 — Re: [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated functions in modules

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-13 15:10 +0200
SubjectRe: [PATCH 4.9 131/172] perf probe: Fix to probe on gcc generated functions in modules
Message-ID<u2M2v-62P-29@gated-at.bofh.it>
In reply to#1681763
On Wed, Jul 05, 2017 at 01:02:36PM -0700, Krister Johansen wrote:
> Hey Greg,
> 
> > 4.9-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Masami Hiramatsu <mhiramat@kernel.org>
> > 
> > 
> > [ Upstream commit 613f050d68a8ed3c0b18b9568698908ef7bbc1f7 ]
> > 
> > Fix to probe on gcc generated functions on modules. Since
> > probing on a module is based on its symbol name, it should
> > be adjusted on actual symbols.
> > 
> > E.g. without this fix, perf probe shows probe definition
> > on non-exist symbol as below.
> > 
> >   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -F in_range*
> >   in_range.isra.12
> >   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
> >   p:probe/in_range nf_nat:in_range+0
> > 
> > With this fix, perf probe correctly shows a probe on
> > gcc-generated symbol.
> > 
> >   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
> >   p:probe/in_range nf_nat:in_range.isra.12+0
> > 
> > This also fixes same problem on online module as below.
> > 
> >   $ perf probe -m i915 -D assert_plane
> >   p:probe/assert_plane i915:assert_plane.constprop.134+0
> > 
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Cc: Jiri Olsa <jolsa@redhat.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Link: http://lkml.kernel.org/r/148411450673.9978.14905987549651656075.stgit@devbox
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  tools/perf/util/probe-event.c  |   45 ++++++++++++++++++++++++++---------------
> >  tools/perf/util/probe-finder.c |    7 ++++--
> >  tools/perf/util/probe-finder.h |    3 ++
> >  3 files changed, 37 insertions(+), 18 deletions(-)
> > 
> > --- a/tools/perf/util/probe-event.c
> > +++ b/tools/perf/util/probe-event.c
> > @@ -645,18 +645,31 @@ static int add_exec_to_probe_trace_event
> >  	return ret;
> >  }
> >  
> > -static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
> > -					    int ntevs, const char *module)
> > +static int
> > +post_process_module_probe_trace_events(struct probe_trace_event *tevs,
> > +				       int ntevs, const char *module,
> > +				       struct debuginfo *dinfo)
> >  {
> > +	Dwarf_Addr text_offs = 0;
> >  	int i, ret = 0;
> >  	char *mod_name = NULL;
> > +	struct map *map;
> >  
> >  	if (!module)
> >  		return 0;
> >  
> > -	mod_name = find_module_name(module);
> > +	map = get_target_map(module, false);
> > +	if (!map || debuginfo__get_text_offset(dinfo, &text_offs, true) < 0) {
> > +		pr_warning("Failed to get ELF symbols for %s\n", module);
> > +		return -EINVAL;
> > +	}
> >  
> > +	mod_name = find_module_name(module);
> >  	for (i = 0; i < ntevs; i++) {
> > +		ret = post_process_probe_trace_point(&tevs[i].point,
> > +						map, (unsigned long)text_offs);
> > +		if (ret < 0)
> > +			break;
> >  		tevs[i].point.module =
> >  			strdup(mod_name ? mod_name : module);
> >  		if (!tevs[i].point.module) {
> > @@ -666,6 +679,8 @@ static int add_module_to_probe_trace_eve
> >  	}
> >  
> >  	free(mod_name);
> > +	map__put(map);
> > +
> >  	return ret;
> >  }
> >  
> > @@ -722,7 +737,7 @@ arch__post_process_probe_trace_events(st
> >  static int post_process_probe_trace_events(struct perf_probe_event *pev,
> >  					   struct probe_trace_event *tevs,
> >  					   int ntevs, const char *module,
> > -					   bool uprobe)
> > +					   bool uprobe, struct debuginfo *dinfo)
> >  {
> >  	int ret;
> >  
> > @@ -730,7 +745,8 @@ static int post_process_probe_trace_even
> >  		ret = add_exec_to_probe_trace_events(tevs, ntevs, module);
> >  	else if (module)
> >  		/* Currently ref_reloc_sym based probe is not for drivers */
> > -		ret = add_module_to_probe_trace_events(tevs, ntevs, module);
> > +		ret = post_process_module_probe_trace_events(tevs, ntevs,
> > +							     module, dinfo);
> >  	else
> >  		ret = post_process_kernel_probe_trace_events(tevs, ntevs);
> >  
> > @@ -774,30 +790,27 @@ static int try_to_find_probe_trace_event
> >  		}
> >  	}
> >  
> > -	debuginfo__delete(dinfo);
> > -
> >  	if (ntevs > 0) {	/* Succeeded to find trace events */
> >  		pr_debug("Found %d probe_trace_events.\n", ntevs);
> >  		ret = post_process_probe_trace_events(pev, *tevs, ntevs,
> > -						pev->target, pev->uprobes);
> > +					pev->target, pev->uprobes, dinfo);
> >  		if (ret < 0 || ret == ntevs) {
> > +			pr_debug("Post processing failed or all events are skipped. (%d)\n", ret);
> >  			clear_probe_trace_events(*tevs, ntevs);
> >  			zfree(tevs);
> > +			ntevs = 0;
> >  		}
> > -		if (ret != ntevs)
> > -			return ret < 0 ? ret : ntevs;
> > -		ntevs = 0;
> > -		/* Fall through */
> >  	}
> >  
> > +	debuginfo__delete(dinfo);
> > +
> >  	if (ntevs == 0)	{	/* No error but failed to find probe point. */
> >  		pr_warning("Probe point '%s' not found.\n",
> >  			   synthesize_perf_probe_point(&pev->point));
> >  		return -ENOENT;
> > -	}
> > -	/* Error path : ntevs < 0 */
> > -	pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
> > -	if (ntevs < 0) {
> > +	} else if (ntevs < 0) {
> > +		/* Error path : ntevs < 0 */
> > +		pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
> >  		if (ntevs == -EBADF)
> >  			pr_warning("Warning: No dwarf info found in the vmlinux - "
> >  				"please rebuild kernel with CONFIG_DEBUG_INFO=y.\n");
> > --- a/tools/perf/util/probe-finder.c
> > +++ b/tools/perf/util/probe-finder.c
> > @@ -1501,7 +1501,8 @@ int debuginfo__find_available_vars_at(st
> >  }
> >  
> >  /* For the kernel module, we need a special code to get a DIE */
> > -static int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs)
> > +int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
> > +				bool adjust_offset)
> >  {
> >  	int n, i;
> >  	Elf32_Word shndx;
> > @@ -1530,6 +1531,8 @@ static int debuginfo__get_text_offset(st
> >  			if (!shdr)
> >  				return -ENOENT;
> >  			*offs = shdr->sh_addr;
> > +			if (adjust_offset)
> > +				*offs -= shdr->sh_offset;
> >  		}
> >  	}
> >  	return 0;
> > @@ -1545,7 +1548,7 @@ int debuginfo__find_probe_point(struct d
> >  	int baseline = 0, lineno = 0, ret = 0;
> >  
> >  	/* We always need to relocate the address for aranges */
> > -	if (debuginfo__get_text_offset(dbg, &baseaddr) == 0)
> > +	if (debuginfo__get_text_offset(dbg, &baseaddr, false) == 0)
> >  		addr += baseaddr;
> >  	/* Find cu die */
> >  	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
> > --- a/tools/perf/util/probe-finder.h
> > +++ b/tools/perf/util/probe-finder.h
> > @@ -46,6 +46,9 @@ int debuginfo__find_trace_events(struct
> >  int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr,
> >  				struct perf_probe_point *ppt);
> >  
> > +int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
> > +			       bool adjust_offset);
> > +
> >  /* Find a line range */
> >  int debuginfo__find_line_range(struct debuginfo *dbg, struct line_range *lr);
> 
> I'm getting the following error when I try to build perf from 4.9.36:
> 
>    util/probe-event.c: In function ‘post_process_module_probe_trace_events’:
>    util/probe-event.c:685:3: error: implicit declaration of function ‘post_process_probe_trace_point’ [-Werror=implicit-function-declaration]
>       ret = post_process_probe_trace_point(&tevs[i].point,
>       ^
>    util/probe-event.c:685:3: error: nested extern declaration of ‘post_process_probe_trace_point’ [-Werror=nested-externs]
>    cc1: all warnings being treated as errors
> 
> At first blush, it looks like we're missing another patch upon which
> this one depends.  However, after cherry-picking the fix for
> 3e96dac7c956089d3f23aca98c4dfca57b6aaf8a back to 4.9.36, the build then
> fails with:
> 
>    util/probe-event.c:549:12: note: declared here
>     static int get_text_start_address(const char *exec, unsigned long *address,
>                ^
>    util/probe-event.c: At top level:
>    util/probe-event.c:672:1: error: ‘post_process_offline_probe_trace_events’ defined but not used [-Werror=unused-function]
>     post_process_offline_probe_trace_events(struct probe_trace_event *tevs,
>     ^
>    cc1: all warnings being treated as errors
> 
> It turns out that this has a second dependency,
> 8a937a25a7e3c19d5fb3f9d92f605cf5fda219d8.  After fiddling with this a
> little bit more, I realized I need to invert the order to get a clean
> merge of the two fixes.  This ordering is good:
> 
> 8a937a25a7e3c19d5fb3f9d92f605cf5fda219d8
> 3e96dac7c956089d3f23aca98c4dfca57b6aaf8a 
> 
> With that I can get a clean build of the perf tree.  All of that said,
> I'm not sure whether there are additional patches needed to fully
> leverage the added functionality.  Perhaps Arnaldo or Masami can
> comment?

Thanks for these, I've now queued them up.

greg k-h

[toc] | [prev] | [next] | [standalone]


Page 1 of 7  [1] 2 3 4 5 6 7  Next page →

Back to top | Article view | linux.kernel


csiph-web