27 Nov, 2018

40 commits

  • commit 19422a9f2a3be7f3a046285ffae4cbb571aa853a upstream.

    On x86_64, PTI entry trampolines are less than the start of kernel text,
    but still above 2^63. So leave kernel_start = 1ULL << 63 for x86_64.

    Signed-off-by: Adrian Hunter
    Tested-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: H. Peter Anvin
    Cc: Joerg Roedel
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: x86@kernel.org
    Link: http://lkml.kernel.org/r/1526548928-20790-7-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Adrian Hunter
     
  • commit dbbd34a666ee117d0e39e71a47f38f02c4a5c698 upstream.

    Add a function to identify the machine architecture.

    Signed-off-by: Adrian Hunter
    Tested-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: H. Peter Anvin
    Cc: Joerg Roedel
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: x86@kernel.org
    Link: http://lkml.kernel.org/r/1526548928-20790-6-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Adrian Hunter
     
  • [ Upstream commit 5a802a7a285c8877ca872e44eeb0f06afcb5212f ]

    After we added quirk for Lenovo Z50-70 it turns out there are at least
    two more systems where WDAT table includes instructions accessing RTC
    SRAM. Instead of quirking each system separately, look for such
    instructions in the table and automatically prefer iTCO_wdt if found.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=199033
    Reported-by: Arnold Guy
    Reported-by: Alois Nespor
    Reported-by: Yury Pakin
    Reported-by: Ihor Chyhin
    Signed-off-by: Mika Westerberg
    Acked-by: Guenter Roeck
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Sasha Levin

    Mika Westerberg
     
  • [ Upstream commit 025911a5f4e36955498ed50806ad1b02f0f76288 ]

    There is no need to have the '__be32 *p' variable static since new value
    always be assigned before use it.

    Signed-off-by: YueHaibing
    Cc: stable@vger.kernel.org
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Sasha Levin

    YueHaibing
     
  • commit fef912bf860e upstream.
    commit 98af4d4df889 upstream.

    I got a report from Howard Chen that he saw zram and sysfs race(ie,
    zram block device file is created but sysfs for it isn't yet)
    when he tried to create new zram devices via hotadd knob.

    v4.20 kernel fixes it by [1, 2] but it's too large size to merge
    into -stable so this patch fixes the problem by registering defualt
    group by Greg KH's approach[3].

    This patch should be applied to every stable tree [3.16+] currently
    existing from kernel.org because the problem was introduced at 2.6.37
    by [4].

    [1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk
    [2] 98af4d4df889, zram: register default groups with device_add_disk()
    [3] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
    [4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface

    Cc: Sergey Senozhatsky
    Cc: Hannes Reinecke
    Tested-by: Howard Chen
    Signed-off-by: Minchan Kim
    Signed-off-by: Sasha Levin

    Minchan Kim
     
  • [ Upstream commit 8137b6ef0ce469154e5cf19f8e7fe04d9a72ac5e ]

    Ping problems with packets > 8191 as shown:

    PING 192.168.1.99 (192.168.1.99) 8150(8178) bytes of data.
    8158 bytes from 192.168.1.99: icmp_seq=1 ttl=64 time=0.669 ms
    wrong data byte 8144 should be 0xd0 but was 0x0
    16 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
    20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
    %< ---------------snip--------------------------------------
    8112 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf
    c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf
    8144 0 0 0 0 d0 d1
    ^^^^^^^
    Notice the 4 bytes of 0 before the expected byte of d0.

    Databook notes that the RX buffer must be a multiple of 4/8/16
    bytes [1].

    Update the DMA Buffer size define to 8188 instead of 8192. Remove
    the -1 from the RX buffer size allocations and use the new
    DMA Buffer size directly.

    [1] Synopsys DesignWare Cores Ethernet MAC Universal v3.70a
    [section 8.4.2 - Table 8-24]

    Tested on SoCFPGA Stratix10 with ping sweep from 100 to 8300 byte packets.

    Fixes: 286a83721720 ("stmmac: add CHAINED descriptor mode support (V4)")
    Suggested-by: Jose Abreu
    Signed-off-by: Thor Thayer
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Thor Thayer
     
  • [ Upstream commit fa5c448d98f0df660bfcad3dd5facc027ef84cd3 ]

    A stuck ramrod should be deleted from the completion_pending list,
    otherwise it will be added again in the future and corrupt the list.

    Return error value to inform that ramrod is stuck and should be deleted.

    Signed-off-by: Sagiv Ozeri
    Signed-off-by: Denis Bolotin
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Sagiv Ozeri
     
  • [ Upstream commit 2632f22ebd08da249c2017962a199a0cfb2324bf ]

    When there are no SPQ entries left in the free_pool, new entries are
    allocated and are added to the unlimited list. When an entry in the pool
    is available, the content is copied from the original entry, and the new
    entry is sent to the device. qed_spq_post() is not aware of that, so the
    additional entry is stored in the original entry as p_post_ent, which can
    later be returned to the pool.

    Signed-off-by: Denis Bolotin
    Signed-off-by: Michal Kalderon
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Denis Bolotin
     
  • [ Upstream commit 39477551df940ddb1339203817de04f5caaacf7a ]

    Free the allocated SPQ entry or return the acquired SPQ entry to the free
    list in error flows.

    Signed-off-by: Denis Bolotin
    Signed-off-by: Michal Kalderon
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Denis Bolotin
     
  • [ Upstream commit ba766b8b99c30ad3c55ed8cf224d1185ecff1476 ]

    Since commit bacd75cfac8a ("i40e/i40evf: Add capability exchange for
    outer checksum", 2017-04-06) the i40e driver has not reported support
    for IP-in-IP offloads. This likely occurred due to a bad rebase, as the
    commit extracts hw_enc_features into its own variable. As part of this
    change, it dropped the NETIF_F_FSO_IPXIP flags from the
    netdev->hw_enc_features. This was unfortunately not caught during code
    review.

    Fix this by adding back the missing feature flags.

    For reference, NETIF_F_GSO_IPXIP4 was added in commit 7e13318daa4a
    ("net: define gso types for IPx over IPv4 and IPv6", 2016-05-20),
    replacing NETIF_F_GSO_IPIP and NETIF_F_GSO_SIT.

    NETIF_F_GSO_IPXIP6 was added in commit bf2d1df39502 ("intel: Add support
    for IPv6 IP-in-IP offload", 2016-05-20).

    Signed-off-by: Jacob Keller
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Sasha Levin

    Jacob Keller
     
  • [ Upstream commit 6ac2226229d931153331a93d90655a3de05b9290 ]

    Currently jvmti agent can not be used because function scnprintf is not
    present in the agent libperf-jvmti.so. As a result the JVM when using
    such agent to record JITed code profiling information will fail on
    looking up scnprintf:

    java: symbol lookup error: lib/libperf-jvmti.so: undefined symbol: scnprintf

    This commit fixes that by reverting to the use of snprintf, that can be
    looked up, instead of scnprintf, adding a proper check for the returned
    value in order to print a better error message when the jitdump file
    pathname is too long. Checking the returned value also helps to comply
    with some recent gcc versions, like gcc8, which will fail due to
    truncated writing checks related to the -Werror=format-truncation= flag.

    Signed-off-by: Gustavo Romero
    Acked-by: Jiri Olsa
    LPU-Reference: 1541117601-18937-2-git-send-email-gromero@linux.vnet.ibm.com
    Link: https://lkml.kernel.org/n/tip-mvpxxxy7wnzaj74cq75muw3f@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Gustavo Romero
     
  • [ Upstream commit 40fa3780bac2b654edf23f6b13f4e2dd550aea10 ]

    When running on linux-next (8c60c36d0b8c ("Add linux-next specific files
    for 20181019")) + CONFIG_PROVE_LOCKING=y on a big.LITTLE system (e.g.
    Juno or HiKey960), we get the following report:

    [ 0.748225] Call trace:
    [ 0.750685] lockdep_assert_cpus_held+0x30/0x40
    [ 0.755236] static_key_enable_cpuslocked+0x20/0xc8
    [ 0.760137] build_sched_domains+0x1034/0x1108
    [ 0.764601] sched_init_domains+0x68/0x90
    [ 0.768628] sched_init_smp+0x30/0x80
    [ 0.772309] kernel_init_freeable+0x278/0x51c
    [ 0.776685] kernel_init+0x10/0x108
    [ 0.780190] ret_from_fork+0x10/0x18

    The static_key in question is 'sched_asym_cpucapacity' introduced by
    commit:

    df054e8445a4 ("sched/topology: Add static_key for asymmetric CPU capacity optimizations")

    In this particular case, we enable it because smp_prepare_cpus() will
    end up fetching the capacity-dmips-mhz entry from the devicetree,
    so we already have some asymmetry detected when entering sched_init_smp().

    This didn't get detected in tip/sched/core because we were missing:

    commit cb538267ea1e ("jump_label/lockdep: Assert we hold the hotplug lock for _cpuslocked() operations")

    Calls to build_sched_domains() post sched_init_smp() will hold the
    hotplug lock, it just so happens that this very first call is a
    special case. As stated by a comment in sched_init_smp(), "There's no
    userspace yet to cause hotplug operations" so this is a harmless
    warning.

    However, to both respect the semantics of underlying
    callees and make lockdep happy, take the hotplug lock in
    sched_init_smp(). This also satisfies the comment atop
    sched_init_domains() that says "Callers must hold the hotplug lock".

    Reported-by: Sudeep Holla
    Tested-by: Sudeep Holla
    Signed-off-by: Valentin Schneider
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Dietmar.Eggemann@arm.com
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: morten.rasmussen@arm.com
    Cc: quentin.perret@arm.com
    Link: http://lkml.kernel.org/r/1540301851-3048-1-git-send-email-valentin.schneider@arm.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin

    Valentin Schneider
     
  • [ Upstream commit 0bb2ae1b26e1fb7543ec7474cdd374ac4b88c4da ]

    The function perf_init_event() creates a new event and
    assignes it to a PMU. This a done in a loop over all existing
    PMUs. For each listed PMU the event init function is called
    and if this function does return any other error than -ENOENT,
    the loop is terminated the creation of the event fails.

    If the event is invalid, return -ENOENT to try other PMUs.

    Signed-off-by: Thomas Richter
    Reviewed-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Sasha Levin

    Thomas Richter
     
  • [ Upstream commit 313a06e636808387822af24c507cba92703568b1 ]

    The lib/raid6/test fails to build the neon objects
    on arm64 because the correct machine type is 'aarch64'.

    Once this is correctly enabled, the neon recovery objects
    need to be added to the build.

    Reviewed-by: Ard Biesheuvel
    Signed-off-by: Jeremy Linton
    Signed-off-by: Catalin Marinas
    Signed-off-by: Sasha Levin

    Jeremy Linton
     
  • [ Upstream commit f98e8a572bddbf27032114127d2fcc78fa5e6a9d ]

    When the fixed factor clock is created by devicetree,
    of_clk_add_provider is called. Add a call to
    of_clk_del_provider in the remove function to balance
    it out.

    Reported-by: Alan Tull
    Fixes: 971451b3b15d ("clk: fixed-factor: Convert into a module platform driver")
    Signed-off-by: Ricardo Ribalda Delgado
    Signed-off-by: Stephen Boyd
    Signed-off-by: Sasha Levin

    Ricardo Ribalda Delgado
     
  • [ Upstream commit 6ca469e22a30992b4478d2ab88737c70667c1e00 ]

    This reverts commit 0586feba322e1de05075700eb4b835c8b683e62b

    This patch makes it to need get_vblank_counter callback in crtc
    to get frame counter from decon driver.

    However, drm_dev->max_vblank_count is a member unique to
    vendor's DRM driver but in case of ARM DRM, some CRTC devices
    don't provide the frame counter value. As a result, this patch
    made extension and clone mode not working.

    Instead of this patch, we may need separated max_vblank_count
    which belongs to each CRTC device, or need to implement frame
    counter emulation for them who don't support HW frame counter.

    Signed-off-by: Inki Dae
    Signed-off-by: Sasha Levin

    Inki Dae
     
  • [ Upstream commit e3e61f01d755188cb6c2dcf5a244b9c0937c258e ]

    If gcc decides not to inline make_sensor_label():

    WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label()
    The function .create_device_attrs() references
    the function __init .make_sensor_label().
    This is often because .create_device_attrs lacks a __init
    annotation or the annotation of .make_sensor_label is wrong.

    As .probe() can be called after freeing of __init memory, all __init
    annotiations in the driver are bogus, and should be removed.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Guenter Roeck
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     
  • [ Upstream commit bd74a7f9cc033cf4d405788f80292268987dc0c5 ]

    Sniffing mode for L3 HiperSockets requires that no IP addresses are
    registered with the HW. The preferred way to achieve this is for
    userspace to delete all the IPs on the interface. But qeth is expected
    to also tolerate a configuration where that is not the case, by skipping
    the IP registration when in sniffer mode.
    Since commit 5f78e29ceebf ("qeth: optimize IP handling in rx_mode callback")
    reworked the IP registration logic in the L3 subdriver, this no longer
    works. When the qeth device is set online, qeth_l3_recover_ip() now
    unconditionally registers all unicast addresses from our internal
    IP table.

    While we could fix this particular problem by skipping
    qeth_l3_recover_ip() on a sniffer device, the more future-proof change
    is to skip the IP address registration at the lowest level. This way we
    a) catch any future code path that attempts to register an IP address
    without considering the sniffer scenario, and
    b) continue to build up our internal IP table, so that if sniffer mode
    is switched off later we can operate just like normal.

    Fixes: 5f78e29ceebf ("qeth: optimize IP handling in rx_mode callback")
    Signed-off-by: Julian Wiedmann
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Julian Wiedmann
     
  • [ Upstream commit 54451f60c8fa061af9051a53be9786393947367c ]

    When IDLETIMER rule is added, sysfs file is created under
    /sys/class/xt_idletimer/timers/
    But some label name shouldn't be used.
    ".", "..", "power", "uevent", "subsystem", etc...
    So that sysfs filename checking routine is needed.

    test commands:
    %iptables -I INPUT -j IDLETIMER --timeout 1 --label "power"

    splat looks like:
    [95765.423132] sysfs: cannot create duplicate filename '/devices/virtual/xt_idletimer/timers/power'
    [95765.433418] CPU: 0 PID: 8446 Comm: iptables Not tainted 4.19.0-rc6+ #20
    [95765.449755] Call Trace:
    [95765.449755] dump_stack+0xc9/0x16b
    [95765.449755] ? show_regs_print_info+0x5/0x5
    [95765.449755] sysfs_warn_dup+0x74/0x90
    [95765.449755] sysfs_add_file_mode_ns+0x352/0x500
    [95765.449755] sysfs_create_file_ns+0x179/0x270
    [95765.449755] ? sysfs_add_file_mode_ns+0x500/0x500
    [95765.449755] ? idletimer_tg_checkentry+0x3e5/0xb1b [xt_IDLETIMER]
    [95765.449755] ? rcu_read_lock_sched_held+0x114/0x130
    [95765.449755] ? __kmalloc_track_caller+0x211/0x2b0
    [95765.449755] ? memcpy+0x34/0x50
    [95765.449755] idletimer_tg_checkentry+0x4e2/0xb1b [xt_IDLETIMER]
    [ ... ]

    Fixes: 0902b469bd25 ("netfilter: xtables: idletimer target implementation")
    Signed-off-by: Taehee Yoo
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Sasha Levin

    Taehee Yoo
     
  • [ Upstream commit 17b8b74c0f8dbf9b9e3301f9ca5b65dd1c079951 ]

    The function is called when rcu_read_lock() is held and not
    when rcu_read_lock_bh() is held.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Sasha Levin

    Jozsef Kadlecsik
     
  • [ Upstream commit a541f0ebcc08ed8bc0cc492eec9a86cb280a9f24 ]

    Fixes:
    ERROR: "__node_distance" [drivers/nvme/host/nvme-core.ko] undefined!
    make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
    make: *** [Makefile:1275: modules] Error 2
    + exit 1

    Signed-off-by: Justin M. Forbes
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Sasha Levin

    Justin M. Forbes
     
  • [ Upstream commit 886503f34d63e681662057448819edb5b1057a97 ]

    Allow /0 as advertised for hash:net,port,net sets.

    For "hash:net,port,net", ipset(8) says that "either subnet
    is permitted to be a /0 should you wish to match port
    between all destinations."

    Make that statement true.

    Before:

    # ipset create cidrzero hash:net,port,net
    # ipset add cidrzero 0.0.0.0/0,12345,0.0.0.0/0
    ipset v6.34: The value of the CIDR parameter of the IP address is invalid

    # ipset create cidrzero6 hash:net,port,net family inet6
    # ipset add cidrzero6 ::/0,12345,::/0
    ipset v6.34: The value of the CIDR parameter of the IP address is invalid

    After:

    # ipset create cidrzero hash:net,port,net
    # ipset add cidrzero 0.0.0.0/0,12345,0.0.0.0/0
    # ipset test cidrzero 192.168.205.129,12345,172.16.205.129
    192.168.205.129,tcp:12345,172.16.205.129 is in set cidrzero.

    # ipset create cidrzero6 hash:net,port,net family inet6
    # ipset add cidrzero6 ::/0,12345,::/0
    # ipset test cidrzero6 fe80::1,12345,ff00::1
    fe80::1,tcp:12345,ff00::1 is in set cidrzero6.

    See also:

    https://bugzilla.kernel.org/show_bug.cgi?id=200897
    https://github.com/ewestbrook/linux/commit/df7ff6efb0934ab6acc11f003ff1a7580d6c1d9c

    Signed-off-by: Eric Westbrook
    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Sasha Levin

    Eric Westbrook
     
  • [ Upstream commit 439cd39ea136d2c026805264d58a91f36b6b64ca ]

    Commit 45040978c899 ("netfilter: ipset: Fix set:list type crash
    when flush/dump set in parallel") postponed decreasing set
    reference counters to the RCU callback.

    An 'ipset del' command can terminate before the RCU grace period
    is elapsed, and if sets are listed before then, the reference
    counter shown in userspace will be wrong:

    # ipset create h hash:ip; ipset create l list:set; ipset add l
    # ipset del l h; ipset list h
    Name: h
    Type: hash:ip
    Revision: 4
    Header: family inet hashsize 1024 maxelem 65536
    Size in memory: 88
    References: 1
    Number of entries: 0
    Members:
    # sleep 1; ipset list h
    Name: h
    Type: hash:ip
    Revision: 4
    Header: family inet hashsize 1024 maxelem 65536
    Size in memory: 88
    References: 0
    Number of entries: 0
    Members:

    Fix this by making the reference count update synchronous again.

    As a result, when sets are listed, ip_set_name_byindex() might
    now fetch a set whose reference count is already zero. Instead
    of relying on the reference count to protect against concurrent
    set renaming, grab ip_set_ref_lock as reader and copy the name,
    while holding the same lock in ip_set_rename() as writer
    instead.

    Reported-by: Li Shuang
    Fixes: 45040978c899 ("netfilter: ipset: Fix set:list type crash when flush/dump set in parallel")
    Signed-off-by: Stefano Brivio
    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Sasha Levin

    Stefano Brivio
     
  • [ Upstream commit b44b136a3773d8a9c7853f8df716bd1483613cbb ]

    According to Documentation/kbuild/makefiles.txt all build targets using
    if_changed should use FORCE as well. Add missing FORCE to make sure
    vdso targets are rebuild properly when not just immediate prerequisites
    have changed but also when build command differs.

    Reviewed-by: Philipp Rudo
    Signed-off-by: Vasily Gorbik
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Sasha Levin

    Vasily Gorbik
     
  • [ Upstream commit b5bb425871186303e6936fa2581521bdd1964a58 ]

    Clang warns that if the default case is taken, ret will be
    uninitialized.

    ./arch/arm64/include/asm/percpu.h:196:2: warning: variable 'ret' is used
    uninitialized whenever switch default is taken
    [-Wsometimes-uninitialized]
    default:
    ^~~~~~~
    ./arch/arm64/include/asm/percpu.h:200:9: note: uninitialized use occurs
    here
    return ret;
    ^~~
    ./arch/arm64/include/asm/percpu.h:157:19: note: initialize the variable
    'ret' to silence this warning
    unsigned long ret, loop;
    ^
    = 0

    This warning appears several times while building the erofs filesystem.
    While it's not strictly wrong, the BUILD_BUG will prevent this from
    becoming a true problem. Initialize ret to 0 in the default case right
    before the BUILD_BUG to silence all of these warnings.

    Reported-by: Prasad Sodagudi
    Signed-off-by: Nathan Chancellor
    Reviewed-by: Nick Desaulniers
    Signed-off-by: Dennis Zhou
    Signed-off-by: Sasha Levin

    Nathan Chancellor
     
  • [ Upstream commit 684238d79ad85c5e19a71bb5818e77e329912fbc ]

    To fix:

    acerhdf: unknown (unsupported) BIOS version Gateway /LT31 /v1.3307 , please report, aborting!

    As can be seen in the context, the BIOS registers haven't changed in
    the previous versions, so the assumption is they won't have changed
    in this last update for this somewhat older platform either.

    Cc: Peter Feuerer
    Cc: Darren Hart
    Cc: Andy Shevchenko
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Andy Shevchenko
    Reviewed-by: Peter Feuerer
    Signed-off-by: Sasha Levin

    Paul Gortmaker
     
  • [ Upstream commit d2266bbfa9e3e32e3b642965088ca461bd24a94f ]

    The "pciserial" earlyprintk variant helps much on many modern x86
    platforms, but unfortunately there are still some platforms with PCI
    UART devices which have the wrong PCI class code. In that case, the
    current class code check does not allow for them to be used for logging.

    Add a sub-option "force" which overrides the class code check and thus
    the use of such device can be enforced.

    [ bp: massage formulations. ]

    Suggested-by: Borislav Petkov
    Signed-off-by: Feng Tang
    Signed-off-by: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: "Stuart R . Anderson"
    Cc: Bjorn Helgaas
    Cc: David Rientjes
    Cc: Feng Tang
    Cc: Frederic Weisbecker
    Cc: Greg Kroah-Hartman
    Cc: H Peter Anvin
    Cc: Ingo Molnar
    Cc: Jiri Kosina
    Cc: Jonathan Corbet
    Cc: Kai-Heng Feng
    Cc: Kate Stewart
    Cc: Konrad Rzeszutek Wilk
    Cc: Peter Zijlstra
    Cc: Philippe Ombredanne
    Cc: Thomas Gleixner
    Cc: Thymo van Beers
    Cc: alan@linux.intel.com
    Cc: linux-doc@vger.kernel.org
    Link: http://lkml.kernel.org/r/20181002164921.25833-1-feng.tang@intel.com
    Signed-off-by: Sasha Levin

    Feng Tang
     
  • [ Upstream commit 250f2da49cb8e582215a65c03f50e8ddf5cd119c ]

    Syzkaller reported a OOB-read with the stacktrace below. This occurs
    inside __aa_lookupn_ns as `n` is not initialized. `n` is obtained from
    aa_splitn_fqname. In cases where `name` is invalid, aa_splitn_fqname
    returns without initializing `ns_name` and `ns_len`.

    Fix this by always initializing `ns_name` and `ns_len`.

    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113
    print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256
    kasan_report_error mm/kasan/report.c:354 [inline]
    kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412
    __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
    memcmp+0xe3/0x160 lib/string.c:861
    strnstr+0x4b/0x70 lib/string.c:934
    __aa_lookupn_ns+0xc1/0x570 security/apparmor/policy_ns.c:209
    aa_lookupn_ns+0x88/0x1e0 security/apparmor/policy_ns.c:240
    aa_fqlookupn_profile+0x1b9/0x1010 security/apparmor/policy.c:468
    fqlookupn_profile+0x80/0xc0 security/apparmor/label.c:1844
    aa_label_strn_parse+0xa3a/0x1230 security/apparmor/label.c:1908
    aa_label_parse+0x42/0x50 security/apparmor/label.c:1943
    aa_change_profile+0x513/0x3510 security/apparmor/domain.c:1362
    apparmor_setprocattr+0xaa4/0x1150 security/apparmor/lsm.c:658
    security_setprocattr+0x66/0xc0 security/security.c:1298
    proc_pid_attr_write+0x301/0x540 fs/proc/base.c:2555
    __vfs_write+0x119/0x9f0 fs/read_write.c:485
    vfs_write+0x1fc/0x560 fs/read_write.c:549
    ksys_write+0x101/0x260 fs/read_write.c:598
    __do_sys_write fs/read_write.c:610 [inline]
    __se_sys_write fs/read_write.c:607 [inline]
    __x64_sys_write+0x73/0xb0 fs/read_write.c:607
    do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
    entry_SYSCALL_64_after_hwframe+0x49/0xbe

    Fixes: 3b0aaf5866bf ("apparmor: add lib fn to find the "split" for fqnames")
    Reported-by: syzbot+61e4b490d9d2da591b50@syzkaller.appspotmail.com
    Signed-off-by: Zubin Mithra
    Reviewed-by: Kees Cook
    Signed-off-by: John Johansen
    Signed-off-by: Sasha Levin

    Zubin Mithra
     
  • [ Upstream commit b33228029d842269e17bba591609e83ed422005d ]

    Ensure that clocks for core SoC modules (including TZPC0..9 modules)
    are enabled for suspend/resume cycle. This fixes suspend/resume
    support on Exynos5422-based Odroid XU3/XU4 boards.

    Suggested-by: Joonyoung Shim
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Sasha Levin

    Marek Szyprowski
     
  • [ Upstream commit 515f1867addaba49c1c6ac73abfaffbc192c1db4 ]

    There are some cases can cause memory leak when parsing
    option 'osdname'.

    Signed-off-by: Chengguang Xu
    Signed-off-by: Al Viro
    Signed-off-by: Sasha Levin

    Chengguang Xu
     
  • [ Upstream commit d6afa561e1471ccfdaf7191230c0c59a37e45a5b ]

    Using the sh_entsize for both values isn't correct. It happens to be
    correct on x86...

    For both 32-bit and 64-bit sparc, there are four PLT entries in the PLT
    section.

    Signed-off-by: David S. Miller
    Cc: Alexander Shishkin
    Cc: Alexis Berlemont
    Cc: David Tolnay
    Cc: Hanjun Guo
    Cc: Hemant Kumar
    Cc: Li Bin
    Cc: Masami Hiramatsu
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Cc: zhangmengting@huawei.com
    Fixes: b2f7605076d6 ("perf symbols: Fix plt entry calculation for ARM and AARCH64")
    Link: http://lkml.kernel.org/r/20181017.120859.2268840244308635255.davem@davemloft.net
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    David Miller
     
  • [ Upstream commit 52091c256bdcad0d01e2852a63f19cd2cce6af96 ]

    When the fixed rate clock is created by devicetree,
    of_clk_add_provider is called. Add a call to
    of_clk_del_provider in the remove function to balance
    it out.

    Signed-off-by: Alan Tull
    Fixes: 435779fe1336 ("clk: fixed-rate: Convert into a module platform driver")
    Signed-off-by: Stephen Boyd
    Signed-off-by: Sasha Levin

    Alan Tull
     
  • [ Upstream commit 8d98b1ef368feeb7720b8b9b6f3bd93f2ad892bc ]

    On some Goldmont based systems such as ASRock J3455M the BIOS may not
    enable the IPC1 device that provides access to the PMC and PUNIT. In
    such scenarios, the IOSS and PSS resources from the platform device can
    not be obtained and result in a invalid telemetry_plt_config which is an
    internal data structure that holds platform config and is maintained by
    the telemetry platform driver.

    This is also applicable to the platforms where the BIOS supports IPC1
    device under debug configurations but IPC1 is disabled by user or the
    policy.

    This change allows user to know the reason for not seeing entries under
    /sys/kernel/debug/telemetry/* when there is no apparent failure at boot.

    Cc: Matt Turner
    Cc: Len Brown
    Cc: Souvik Kumar Chakravarty
    Cc: Kuppuswamy Sathyanarayanan

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198779
    Acked-by: Matt Turner
    Signed-off-by: Rajneesh Bhardwaj
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Sasha Levin

    Rajneesh Bhardwaj
     
  • [ Upstream commit 922dceff8dc1fb4dafc9af78139ba65671408103 ]

    BOE panel (ID: 0x0771) that reports "DFP 1.x compliant TMDS".
    But it's 6bpc panel only instead of 8 bpc.

    Add panel ID to edid quirk list and set 6 bpc as default to
    work around this issue.

    Cc: Jani Nikula
    Cc: Maarten Lankhorst
    Cc: Gustavo Padovan
    Cc: Cooper Chiou
    Signed-off-by: Lee, Shawn C >
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/1540792173-7288-1-git-send-email-shawn.c.lee@intel.com
    Signed-off-by: Sasha Levin

    Lee, Shawn C
     
  • [ Upstream commit 7ff1e34bbdc15acab823b1ee4240e94623d50ee8 ]

    Fixes:
    arch/um/os-Linux/skas/process.c:613:1: warning: control reaches end of
    non-void function [-Wreturn-type]

    longjmp() never returns but gcc still warns that the end of the function
    can be reached.
    Add a return code and debug aid to detect this impossible case.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Sasha Levin

    Richard Weinberger
     
  • [ Upstream commit 0a3021d4f5295aa073c7bf5c5e4de60a2e292578 ]

    Creating, renaming or deleting a file may cause catalog corruption and
    data loss. This bug is randomly triggered by xfstests generic/027, but
    here is a faster reproducer:

    truncate -s 50M fs.iso
    mkfs.hfsplus fs.iso
    mount fs.iso /mnt
    i=100
    while [ $i -le 150 ]; do
    touch /mnt/$i &>/dev/null
    ((++i))
    done
    i=100
    while [ $i -le 150 ]; do
    mv /mnt/$i /mnt/$(perl -e "print $i x82") &>/dev/null
    ((++i))
    done
    umount /mnt
    fsck.hfsplus -n fs.iso

    The bug is triggered whenever hfs_brec_update_parent() needs to split the
    root node. The height of the btree is not increased, which leaves the new
    node orphaned and its records lost.

    Link: http://lkml.kernel.org/r/26d882184fc43043a810114258f45277752186c7.1535682461.git.ernesto.mnd.fernandez@gmail.com
    Signed-off-by: Ernesto A. Fernández
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Ernesto A. Fernández
     
  • [ Upstream commit d057c036672f33d43a5f7344acbb08cf3a8a0c09 ]

    This bug is triggered whenever hfs_brec_update_parent() needs to split
    the root node. The height of the btree is not increased, which leaves
    the new node orphaned and its records lost. It is not possible for this
    to happen on a valid hfs filesystem because the index nodes have fixed
    length keys.

    For reasons I ignore, the hfs module does have support for a number of
    hfsplus features. A corrupt btree header may report variable length
    keys and trigger this bug, so it's better to fix it.

    Link: http://lkml.kernel.org/r/9750b1415685c4adca10766895f6d5ef12babdb0.1535682463.git.ernesto.mnd.fernandez@gmail.com
    Signed-off-by: Ernesto A. Fernández
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Ernesto A. Fernández
     
  • [ Upstream commit b10298d56c9623f9b173f19959732d3184b35f4f ]

    fill_with_dentries() failed to propagate errors up to
    reiserfs_for_each_xattr() properly. Plumb them through.

    Note that reiserfs_for_each_xattr() is only used by
    reiserfs_delete_xattrs() and reiserfs_chown_xattrs(). The result of
    reiserfs_delete_xattrs() is discarded anyway, the only difference there is
    whether a warning is printed to dmesg. The result of
    reiserfs_chown_xattrs() does matter because it can block chowning of the
    file to which the xattrs belong; but either way, the resulting state can
    have misaligned ownership, so my patch doesn't improve things greatly.

    Credit for making me look at this code goes to Al Viro, who pointed out
    that the ->actor calling convention is suboptimal and should be changed.

    Link: http://lkml.kernel.org/r/20180802163335.83312-1-jannh@google.com
    Signed-off-by: Jann Horn
    Reviewed-by: Andrew Morton
    Cc: Jeff Mahoney
    Cc: Eric Biggers
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Jann Horn
     
  • [ Upstream commit 6702185c1ffec3421181b5e24491e3fac920cb61 ]

    This change resolves a driver bug where the driver is logging a
    message that says "Spoofed packets detected". This can occur on the PF
    (host) when a VF has VLAN+MACVLAN enabled and is re-started with a
    different MAC address.

    MAC and VLAN anti-spoofing filters are to be enabled together.

    Signed-off-by: Radoslaw Tyl
    Tested-by: Andrew Bowers
    Acked-by: Piotr Skajewski
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Sasha Levin

    Radoslaw Tyl
     
  • [ Upstream commit 966866892cf89d606544bca22d584ba2ef9ec208 ]

    Commit 1404d6f13e47 ("arm64: dump: Add checking for writable and exectuable pages")
    has successfully identified code that leaves a page with W+X
    permissions.

    [ 3.245140] arm64/mm: Found insecure W+X mapping at address (____ptrval____)/0xffff000000d90000
    [ 3.245771] WARNING: CPU: 0 PID: 1 at ../arch/arm64/mm/dump.c:232 note_page+0x410/0x420
    [ 3.246141] Modules linked in:
    [ 3.246653] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.0-rc5-next-20180928-00001-ge70ae259b853-dirty #62
    [ 3.247008] Hardware name: linux,dummy-virt (DT)
    [ 3.247347] pstate: 80000005 (Nzcv daif -PAN -UAO)
    [ 3.247623] pc : note_page+0x410/0x420
    [ 3.247898] lr : note_page+0x410/0x420
    [ 3.248071] sp : ffff00000804bcd0
    [ 3.248254] x29: ffff00000804bcd0 x28: ffff000009274000
    [ 3.248578] x27: ffff00000921a000 x26: ffff80007dfff000
    [ 3.248845] x25: ffff0000093f5000 x24: ffff000009526f6a
    [ 3.249109] x23: 0000000000000004 x22: ffff000000d91000
    [ 3.249396] x21: ffff000000d90000 x20: 0000000000000000
    [ 3.249661] x19: ffff00000804bde8 x18: 0000000000000400
    [ 3.249924] x17: 0000000000000000 x16: 0000000000000000
    [ 3.250271] x15: ffffffffffffffff x14: 295f5f5f5f6c6176
    [ 3.250594] x13: 7274705f5f5f5f28 x12: 2073736572646461
    [ 3.250941] x11: 20746120676e6970 x10: 70616d20582b5720
    [ 3.251252] x9 : 6572756365736e69 x8 : 3039643030303030
    [ 3.251519] x7 : 306666666678302f x6 : ffff0000095467b2
    [ 3.251802] x5 : 0000000000000000 x4 : 0000000000000000
    [ 3.252060] x3 : 0000000000000000 x2 : ffffffffffffffff
    [ 3.252323] x1 : 4d151327adc50b00 x0 : 0000000000000000
    [ 3.252664] Call trace:
    [ 3.252953] note_page+0x410/0x420
    [ 3.253186] walk_pgd+0x12c/0x238
    [ 3.253417] ptdump_check_wx+0x68/0xf8
    [ 3.253637] mark_rodata_ro+0x68/0x98
    [ 3.253847] kernel_init+0x38/0x160
    [ 3.254103] ret_from_fork+0x10/0x18

    kprobes allocates a writable executable page with module_alloc() in
    order to store executable code.
    Reworked to that when allocate a page it sets mode RO. Inspired by
    commit 63fef14fc98a ("kprobes/x86: Make insn buffer always ROX and use text_poke()").

    Suggested-by: Arnd Bergmann
    Suggested-by: Ard Biesheuvel
    Acked-by: Will Deacon
    Acked-by: Masami Hiramatsu
    Reviewed-by: Laura Abbott
    Signed-off-by: Anders Roxell
    [catalin.marinas@arm.com: removed unnecessary casts]
    Signed-off-by: Catalin Marinas
    Signed-off-by: Sasha Levin

    Anders Roxell