1. 08 Aug, 2020 5 commits
    • Stafford Horne's avatar
      openrisc: uaccess: Add user address space check to access_ok · 55b2662e
      Stafford Horne authored
      Now that __user annotations are fixed for openrisc uaccess api's we can
      add checking to the access_ok macro.  This patch adds the __chk_user_ptr
      check, on normal builds the added check is a nop.
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      55b2662e
    • Stafford Horne's avatar
      openrisc: signal: Fix sparse address space warnings · d9959664
      Stafford Horne authored
      The __user annotations in signal.c were mostly missing.  The missing
      annotations caused the warnings listed below.  This patch fixes them up
      by adding the __user annotations.
      
      arch/openrisc/kernel/signal.c:71:38: warning: incorrect type in initializer (different address spaces)
      arch/openrisc/kernel/signal.c:71:38:    expected struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:71:38:    got struct rt_sigframe [noderef] __user *
      arch/openrisc/kernel/signal.c:82:14: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:82:14:    expected void const volatile [noderef] __user *
      arch/openrisc/kernel/signal.c:82:14:    got struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:84:37: warning: incorrect type in argument 2 (different address spaces)
      arch/openrisc/kernel/signal.c:84:37:    expected void const [noderef] __user *from
      arch/openrisc/kernel/signal.c:84:37:    got struct sigset_t *
      arch/openrisc/kernel/signal.c:89:39: warning: incorrect type in argument 2 (different address spaces)
      arch/openrisc/kernel/signal.c:89:39:    expected struct sigcontext [noderef] __user *sc
      arch/openrisc/kernel/signal.c:89:39:    got struct sigcontext *
      arch/openrisc/kernel/signal.c:92:31: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:92:31:    expected struct sigaltstack const [noderef] [usertype] __user *
      arch/openrisc/kernel/signal.c:92:31:    got struct sigaltstack *
      arch/openrisc/kernel/signal.c:158:15: warning: incorrect type in assignment (different address spaces)
      arch/openrisc/kernel/signal.c:158:15:    expected struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:158:15:    got void [noderef] __user *
      arch/openrisc/kernel/signal.c:160:14: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:160:14:    expected void const volatile [noderef] __user *
      arch/openrisc/kernel/signal.c:160:14:    got struct rt_sigframe *frame
      arch/openrisc/kernel/signal.c:165:46: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:165:46:    expected struct siginfo [noderef] [usertype] __user *to
      arch/openrisc/kernel/signal.c:165:46:    got struct siginfo *
      arch/openrisc/kernel/signal.c:170:33: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:170:33:    expected struct sigaltstack [noderef] [usertype] __user *
      arch/openrisc/kernel/signal.c:170:33:    got struct sigaltstack *
      arch/openrisc/kernel/signal.c:171:40: warning: incorrect type in argument 2 (different address spaces)
      arch/openrisc/kernel/signal.c:171:40:    expected struct sigcontext [noderef] __user *sc
      arch/openrisc/kernel/signal.c:171:40:    got struct sigcontext *
      arch/openrisc/kernel/signal.c:173:32: warning: incorrect type in argument 1 (different address spaces)
      arch/openrisc/kernel/signal.c:173:32:    expected void [noderef] __user *to
      arch/openrisc/kernel/signal.c:173:32:    got struct sigset_t *
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      d9959664
    • Stafford Horne's avatar
      openrisc: uaccess: Remove unused macro __addr_ok · aac9a9b5
      Stafford Horne authored
      Since commit b48b2c3e ("openrisc: use generic strnlen_user()
      function") the macro __addr_ok is no longer used.  It is safe to remove
      so this patch removes it.
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      aac9a9b5
    • Stafford Horne's avatar
      openrisc: uaccess: Use static inline function in access_ok · af84b16e
      Stafford Horne authored
      As suggested by Linus when reviewing commit 9cb2feb4
      ("arch/openrisc: Fix issues with access_ok()") last year; making
      __range_ok an inline function also fixes the used twice issue that the
      commit was fixing.  I agree it's a good cleanup.  This patch addresses
      that as I am currently working on the access_ok macro to fixup sparse
      annotations in OpenRISC.
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      af84b16e
    • Stafford Horne's avatar
      openrisc: uaccess: Fix sparse address space warnings · 17fcd83c
      Stafford Horne authored
      The OpenRISC user access functions put_user(), get_user() and
      clear_user() were missing proper sparse annotations.  This generated
      warnings like the below.
      
      This patch adds the annotations to fix the warnings.
      
      Example warnings:
      
      net/ipv4/ip_sockglue.c:759:29: warning: incorrect type in argument 1 (different address spaces)
      net/ipv4/ip_sockglue.c:759:29:    expected void const volatile [noderef] __user *
      net/ipv4/ip_sockglue.c:759:29:    got int const *__gu_addr
      net/ipv4/ip_sockglue.c:764:29: warning: incorrect type in initializer (different address spaces)
      net/ipv4/ip_sockglue.c:764:29:    expected unsigned char const *__gu_addr
      net/ipv4/ip_sockglue.c:764:29:    got unsigned char [noderef] __user *
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Reviewed-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      17fcd83c
  2. 05 Aug, 2020 1 commit
  3. 04 Aug, 2020 6 commits
    • Stafford Horne's avatar
      asm-generic/io.h: Fix sparse warnings on big-endian architectures · c1d55d50
      Stafford Horne authored
      On big-endian architectures like OpenRISC, sparse outputs below warnings on
      asm-generic/io.h.  This is due to io statements like:
      
        __raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
      
      The __raw_writel() function expects native endianness, however
      cpu_to_le32() returns __le32.  On little-endian machines these match up
      and there is no issue.  However, on big-endian we get warnings, for IO
      that is defined as little-endian the mismatch is expected.
      
      The fix I propose is to __force to native endian.
      
      Warnings:
      
      ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16
      ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16
      ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16
      ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16
      ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32
      ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32
      ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32
      ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32
      ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32
      ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32
      ./include/asm-generic/io.h:215:22: warning: incorrect type in argument 1 (different base types)
      ./include/asm-generic/io.h:215:22:    expected unsigned short [usertype] value
      ./include/asm-generic/io.h:215:22:    got restricted __le16 [usertype]
      ./include/asm-generic/io.h:225:22: warning: incorrect type in argument 1 (different base types)
      ./include/asm-generic/io.h:225:22:    expected unsigned int [usertype] value
      ./include/asm-generic/io.h:225:22:    got restricted __le32 [usertype]
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      c1d55d50
    • Stafford Horne's avatar
      openrisc: Implement proper SMP tlb flushing · c28b2741
      Stafford Horne authored
      Up until now when flushing pages from the TLB on SMP OpenRISC was always
      resorting to flush the entire TLB on all CPUs.  This patch adds the
      mechanics for flushing specific ranges and pages based on the usage.
      
      The function switch_mm is updated to account for cpu usage by updating
      mm_struct's cpumask.  This is used in the SMP flush routines.
      
      This mostly follows the riscv implementation.
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      c28b2741
    • Stafford Horne's avatar
      openrisc: Fix oops caused when dumping stack · 57b8e277
      Stafford Horne authored
      When dumping a stack with 'cat /proc/#/stack' the kernel would oops.
      For example:
      
          # cat /proc/690/stack
          Unable to handle kernel access
           at virtual address 0x7fc60f58
      
          Oops#: 0000
          CPU #: 0
             PC: c00097fc    SR: 0000807f    SP: d6f09b9c
          GPR00: 00000000 GPR01: d6f09b9c GPR02: d6f09bb8 GPR03: d6f09bc4
          GPR04: 7fc60f5c GPR05: c00099b4 GPR06: 00000000 GPR07: d6f09ba3
          GPR08: ffffff00 GPR09: c0009804 GPR10: d6f08000 GPR11: 00000000
          GPR12: ffffe000 GPR13: dbb86000 GPR14: 00000001 GPR15: dbb86250
          GPR16: 7fc60f63 GPR17: 00000f5c GPR18: d6f09bc4 GPR19: 00000000
          GPR20: c00099b4 GPR21: ffffffc0 GPR22: 00000000 GPR23: 00000000
          GPR24: 00000001 GPR25: 000002c6 GPR26: d78b6850 GPR27: 00000001
          GPR28: 00000000 GPR29: dbb86000 GPR30: ffffffff GPR31: dbb862fc
            RES: 00000000 oGPR11: ffffffff
          Process cat (pid: 702, stackpage=d79d6000)
      
          Stack:
          Call trace:
          [<598977f2>] save_stack_trace_tsk+0x40/0x74
          [<95063f0e>] stack_trace_save_tsk+0x44/0x58
          [<b557bfdd>] proc_pid_stack+0xd0/0x13c
          [<a2df8eda>] proc_single_show+0x6c/0xf0
          [<e5a737b7>] seq_read+0x1b4/0x688
          [<2d6c7480>] do_iter_read+0x208/0x248
          [<2182a2fb>] vfs_readv+0x64/0x90
      
      This was caused by the stack trace code in save_stack_trace_tsk using
      the wrong stack pointer.  It was using the user stack pointer instead of
      the kernel stack pointer.  Fix this by using the right stack.
      
      Also for good measure we add try_get_task_stack/put_task_stack to ensure
      the task is not lost while we are walking it's stack.
      
      Fixes: eecac38b ("openrisc: support framepointers and STACKTRACE_SUPPORT")
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      57b8e277
    • Stafford Horne's avatar
      openrisc: Add support for external initrd images · ff6c923d
      Stafford Horne authored
      In OpenRISC we set the initrd_start and initrd_end based on the symbols
      we setup in vmlinux.lds.S.  However, this is not needed if we use the
      generic linker description in INIT_DATA_SECTION.
      
      Removing our own initrd setup reduces code, but also the generic code
      supports loading external initrd images.  A bootloader can load a rootfs
      image into memory and we can configure devicetree to load it with:
      
              chosen {
                      bootargs = "earlycon";
                      stdout-path = "uart0:115200";
                      linux,initrd-start = < 0x08000100 >;
                      linux,initrd-end = < 0x08200000 >;
              };
      Reported-by: default avatarMateusz Holenko <mholenko@antmicro.com>
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      ff6c923d
    • Stafford Horne's avatar
      init: Align init_task to avoid conflict with MUTEX_FLAGS · d0b7213f
      Stafford Horne authored
      When booting on 32-bit machines (seen on OpenRISC) I saw this warning
      with CONFIG_DEBUG_MUTEXES turned on.
      
          ------------[ cut here ]------------
          WARNING: CPU: 0 PID: 0 at kernel/locking/mutex.c:1242 __mutex_unlock_slowpath+0x328/0x3ec
          DEBUG_LOCKS_WARN_ON(__owner_task(owner) != current)
          Modules linked in:
          CPU: 0 PID: 0 Comm: swapper Not tainted 5.8.0-rc1-simple-smp-00005-g2864e2171db4-dirty #179
          Call trace:
          [<(ptrval)>] dump_stack+0x34/0x48
          [<(ptrval)>] __warn+0x104/0x158
          [<(ptrval)>] ? __mutex_unlock_slowpath+0x328/0x3ec
          [<(ptrval)>] warn_slowpath_fmt+0x7c/0x94
          [<(ptrval)>] __mutex_unlock_slowpath+0x328/0x3ec
          [<(ptrval)>] mutex_unlock+0x18/0x28
          [<(ptrval)>] __cpuhp_setup_state_cpuslocked.part.0+0x29c/0x2f4
          [<(ptrval)>] ? page_alloc_cpu_dead+0x0/0x30
          [<(ptrval)>] ? start_kernel+0x0/0x684
          [<(ptrval)>] __cpuhp_setup_state+0x4c/0x5c
          [<(ptrval)>] page_alloc_init+0x34/0x68
          [<(ptrval)>] ? start_kernel+0x1a0/0x684
          [<(ptrval)>] ? early_init_dt_scan_nodes+0x60/0x70
          irq event stamp: 0
      
      I traced this to kernel/locking/mutex.c storing 3 bits of MUTEX_FLAGS in
      the task_struct pointer (mutex.owner).  There is a comment saying that
      task_structs are always aligned to L1_CACHE_BYTES.  This is not true for
      the init_task.
      
      On 64-bit machines this is not a problem because symbol addresses are
      naturally aligned to 64-bits providing 3 bits for MUTEX_FLAGS.  Howerver,
      for 32-bit machines the symbol address only has 2 bits available.
      
      Fix this by setting init_task alignment to at least L1_CACHE_BYTES.
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      d0b7213f
    • Luc Van Oostenryck's avatar
      openrisc: fix __user in raw_copy_to_user()'s prototype · 9e9da641
      Luc Van Oostenryck authored
      raw_copy_to_user()'s prototype seems to be a copy & paste of
      raw_copy_from_user() and as such has the __user annotation
      in the 'from' argument instead of the 'to'.
      
      So, move the __user annotation in the prototype to the 'to'.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      9e9da641
  4. 02 Aug, 2020 6 commits
  5. 01 Aug, 2020 14 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · ac3a0c84
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Encap offset calculation is incorrect in esp6, from Sabrina Dubroca.
      
       2) Better parameter validation in pfkey_dump(), from Mark Salyzyn.
      
       3) Fix several clang issues on powerpc in selftests, from Tanner Love.
      
       4) cmsghdr_from_user_compat_to_kern() uses the wrong length, from Al
          Viro.
      
       5) Out of bounds access in mlx5e driver, from Raed Salem.
      
       6) Fix transfer buffer memleak in lan78xx, from Johan Havold.
      
       7) RCU fixups in rhashtable, from Herbert Xu.
      
       8) Fix ipv6 nexthop refcnt leak, from Xiyu Yang.
      
       9) vxlan FDB dump must be done under RCU, from Ido Schimmel.
      
      10) Fix use after free in mlxsw, from Ido Schimmel.
      
      11) Fix map leak in HASH_OF_MAPS bpf code, from Andrii Nakryiko.
      
      12) Fix bug in mac80211 Tx ack status reporting, from Vasanthakumar
          Thiagarajan.
      
      13) Fix memory leaks in IPV6_ADDRFORM code, from Cong Wang.
      
      14) Fix bpf program reference count leaks in mlx5 during
          mlx5e_alloc_rq(), from Xin Xiong.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (86 commits)
        vxlan: fix memleak of fdb
        rds: Prevent kernel-infoleak in rds_notify_queue_get()
        net/sched: The error lable position is corrected in ct_init_module
        net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq
        net/mlx5e: E-Switch, Specify flow_source for rule with no in_port
        net/mlx5e: E-Switch, Add misc bit when misc fields changed for mirroring
        net/mlx5e: CT: Support restore ipv6 tunnel
        net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe()
        ionic: unlock queue mutex in error path
        atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent
        net: ethernet: mtk_eth_soc: fix MTU warnings
        net: nixge: fix potential memory leak in nixge_probe()
        devlink: ignore -EOPNOTSUPP errors on dumpit
        rxrpc: Fix race between recvmsg and sendmsg on immediate call failure
        MAINTAINERS: Replace Thor Thayer as Altera Triple Speed Ethernet maintainer
        selftests/bpf: fix netdevsim trap_flow_action_cookie read
        ipv6: fix memory leaks on IPV6_ADDRFORM path
        net/bpfilter: Initialize pos in __bpfilter_process_sockopt
        igb: reinit_locked() should be called with rtnl_lock
        e1000e: continue to init PHY even when failed to disable ULP
        ...
      ac3a0c84
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · 0ae3495b
      Linus Torvalds authored
      Pull thread fix from Christian Brauner:
       "A simple spelling fix for dequeue_synchronous_signal()"
      
      * tag 'for-linus-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        signal: fix typo in dequeue_synchronous_signal()
      0ae3495b
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux · bf121a0b
      Linus Torvalds authored
      Pull perf tooling fixes from Arnaldo Carvalho de Melo:
      
       - Fix libtraceevent build with binutils 2.35
      
       - Fix memory leak in process_dynamic_array_len in libtraceevent
      
       - Fix 'perf test 68' zstd compression for s390
      
       - Fix record failure when mixed with ARM SPE event
      
      * tag 'perf-tools-fixes-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        libtraceevent: Fix build with binutils 2.35
        perf tools: Fix record failure when mixed with ARM SPE event
        perf tests: Fix test 68 zstd compression for s390
        tools lib traceevent: Fix memory leak in process_dynamic_array_len
      bf121a0b
    • Taehee Yoo's avatar
      vxlan: fix memleak of fdb · fda2ec62
      Taehee Yoo authored
      When vxlan interface is deleted, all fdbs are deleted by vxlan_flush().
      vxlan_flush() flushes fdbs but it doesn't delete fdb, which contains
      all-zeros-mac because it is deleted by vxlan_uninit().
      But vxlan_uninit() deletes only the fdb, which contains both all-zeros-mac
      and default vni.
      So, the fdb, which contains both all-zeros-mac and non-default vni
      will not be deleted.
      
      Test commands:
          ip link add vxlan0 type vxlan dstport 4789 external
          ip link set vxlan0 up
          bridge fdb add to 00:00:00:00:00:00 dst 172.0.0.1 dev vxlan0 via lo \
      	    src_vni 10000 self permanent
          ip link del vxlan0
      
      kmemleak reports as follows:
      unreferenced object 0xffff9486b25ced88 (size 96):
        comm "bridge", pid 2151, jiffies 4294701712 (age 35506.901s)
        hex dump (first 32 bytes):
          02 00 00 00 ac 00 00 01 40 00 09 b1 86 94 ff ff  ........@.......
          46 02 00 00 00 00 00 00 a7 03 00 00 12 b5 6a 6b  F.............jk
        backtrace:
          [<00000000c10cf651>] vxlan_fdb_append.part.51+0x3c/0xf0 [vxlan]
          [<000000006b31a8d9>] vxlan_fdb_create+0x184/0x1a0 [vxlan]
          [<0000000049399045>] vxlan_fdb_update+0x12f/0x220 [vxlan]
          [<0000000090b1ef00>] vxlan_fdb_add+0x12a/0x1b0 [vxlan]
          [<0000000056633c2c>] rtnl_fdb_add+0x187/0x270
          [<00000000dd5dfb6b>] rtnetlink_rcv_msg+0x264/0x490
          [<00000000fc44dd54>] netlink_rcv_skb+0x4a/0x110
          [<00000000dff433e7>] netlink_unicast+0x18e/0x250
          [<00000000b87fb421>] netlink_sendmsg+0x2e9/0x400
          [<000000002ed55153>] ____sys_sendmsg+0x237/0x260
          [<00000000faa51c66>] ___sys_sendmsg+0x88/0xd0
          [<000000006c3982f1>] __sys_sendmsg+0x4e/0x80
          [<00000000a8f875d2>] do_syscall_64+0x56/0xe0
          [<000000003610eefa>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      unreferenced object 0xffff9486b1c40080 (size 128):
        comm "bridge", pid 2157, jiffies 4294701754 (age 35506.866s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 f8 dc 42 b2 86 94 ff ff  ..........B.....
          6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
        backtrace:
          [<00000000a2981b60>] vxlan_fdb_create+0x67/0x1a0 [vxlan]
          [<0000000049399045>] vxlan_fdb_update+0x12f/0x220 [vxlan]
          [<0000000090b1ef00>] vxlan_fdb_add+0x12a/0x1b0 [vxlan]
          [<0000000056633c2c>] rtnl_fdb_add+0x187/0x270
          [<00000000dd5dfb6b>] rtnetlink_rcv_msg+0x264/0x490
          [<00000000fc44dd54>] netlink_rcv_skb+0x4a/0x110
          [<00000000dff433e7>] netlink_unicast+0x18e/0x250
          [<00000000b87fb421>] netlink_sendmsg+0x2e9/0x400
          [<000000002ed55153>] ____sys_sendmsg+0x237/0x260
          [<00000000faa51c66>] ___sys_sendmsg+0x88/0xd0
          [<000000006c3982f1>] __sys_sendmsg+0x4e/0x80
          [<00000000a8f875d2>] do_syscall_64+0x56/0xe0
          [<000000003610eefa>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: 3ad7a4b1 ("vxlan: support fdb and learning in COLLECT_METADATA mode")
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fda2ec62
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · d52daa86
      Linus Torvalds authored
      Pull pin control fix from Linus Walleij:
       "A single last minute pin control fix to the Qualcomm driver fixing
        missing dual edge PCH interrupts"
      
      * tag 'pinctrl-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: qcom: Handle broken/missing PDC dual edge IRQs on sc7180
      d52daa86
    • Masahiro Yamada's avatar
      Revert "kconfig: qconf: don't show goback button on splitMode" · 4b20e103
      Masahiro Yamada authored
      This reverts commit cc1c08ed.
      
      Maxim Levitsky reports 'make xconfig' crashes since that commit
      (https://lkml.org/lkml/2020/7/18/411)
      
      Or, the following is simple test code that makes it crash:
      
          menu "Menu"
      
          config FOO
                  bool "foo"
                  default y
      
          menuconfig BAR
                  bool "bar"
                  depends on FOO
      
          endmenu
      
      Select the Split View mode, and double-click "bar" in the right
      window, then you will see Segmentation fault.
      
      When 'last' is not set for symbolMode, the following code in
      ConfigList::updateList() calls firstChild().
      
        item = last ? last->nextSibling() : firstChild();
      
      However, the pointer returned by ConfigList::firstChild() does not
      seem to be compatible with (ConfigItem *), which seems another bug.
      
      I'd rather want to reconsider whether hiding the goback icon is the
      right thing to do.
      
      In the following test code, the Split View shows "Menu2" and "Menu3"
      in the right window. You can descend into "Menu3", but there is no way
      to ascend back to "Menu2" from "Menu3".
      
          menu "Menu1"
      
          config FOO
                  bool "foo"
                  default y
      
          menu "Menu2"
                  depends on FOO
      
          menu "Menu3"
      
          config BAZ
                  bool "baz"
      
          endmenu
      
          endmenu
      
          endmenu
      
      It is true that the goback button is currently not functional due to
      yet another bug, but hiding the problem is not the right way to go.
      
      Anyway, Segmentation fault is fatal. Revert the offending commit for
      now, and we should find the right solution.
      Reported-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      4b20e103
    • Masahiro Yamada's avatar
      Revert "kconfig: qconf: Change title for the item window" · 97bebbcd
      Masahiro Yamada authored
      This reverts commit 5752ff07.
      
      It added dead code to ConfigList:ConfigList().
      
      The constructor of ConfigList has the initializer, mode(singleMode).
      
          if (mode == symbolMode)
                 setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value");
          else
                 setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
      
      ... always takes the else part.
      
      The change to ConfigList::updateSelection() is strange too.
      When you click the split view icon for the first time, the titles in
      both windows show "Option". After you click something in the right
      window, the title suddenly changes to "Item".
      
      ConfigList::updateSelection() is not the right place to do this,
      at least. It was not a good idea, I think.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      97bebbcd
    • Masahiro Yamada's avatar
      kconfig: qconf: remove "goBack" debug message · ce02397f
      Masahiro Yamada authored
      Every time the goback icon is clicked, the annoying message "goBack"
      is displayed on the console.
      
      I guess this line is the left-over debug code of commit af737b4d
      ("kconfig: qconf: simplify the goBack() logic").
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      ce02397f
    • Masahiro Yamada's avatar
      kconfig: qconf: use delete[] instead of delete to free array · c9b09a92
      Masahiro Yamada authored
      cppcheck reports "Mismatching allocation and deallocation".
      
      $ cppcheck scripts/kconfig/qconf.cc
      Checking scripts/kconfig/qconf.cc ...
      scripts/kconfig/qconf.cc:1242:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc]
        delete data;
               ^
      scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and deallocation: data
       char *data = new char[count + 1];
                    ^
      scripts/kconfig/qconf.cc:1242:10: note: Mismatching allocation and deallocation: data
        delete data;
               ^
      scripts/kconfig/qconf.cc:1255:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc]
        delete data;
               ^
      scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and deallocation: data
       char *data = new char[count + 1];
                    ^
      scripts/kconfig/qconf.cc:1255:10: note: Mismatching allocation and deallocation: data
        delete data;
               ^
      
      Fixes: c4f7398b ("kconfig: qconf: make debug links work again")
      Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      c9b09a92
    • Masahiro Yamada's avatar
      kconfig: qconf: compile moc object separately · 0e912c03
      Masahiro Yamada authored
      Currently, qconf.moc is included from qconf.cc but they can be compiled
      independently.
      
      When you modify qconf.cc, qconf.moc does not need recompiling.
      
      Rename qconf.moc to qconf-moc.cc, and split it out as an independent
      compilation unit.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      0e912c03
    • Masahiro Yamada's avatar
      kconfig: qconf: use if_changed for qconf.moc rule · c3cd7cfa
      Masahiro Yamada authored
      Regenerate qconf.moc when the moc command is changed.
      
      This also allows 'make mrproper' to clean it up. Previously, it was
      not cleaned up because 'clean-files += qconf.moc' was missing.
      Now 'make mrproper' correctly cleans it up because files listed in
      'targets' are cleaned.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      c3cd7cfa
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 69138b34
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2020-07-31
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 5 non-merge commits during the last 21 day(s) which contain
      a total of 5 files changed, 126 insertions(+), 18 deletions(-).
      
      The main changes are:
      
      1) Fix a map element leak in HASH_OF_MAPS map type, from Andrii Nakryiko.
      
      2) Fix a NULL pointer dereference in __btf_resolve_helper_id() when no
         btf_vmlinux is available, from Peilin Ye.
      
      3) Init pos variable in __bpfilter_process_sockopt(), from Christoph Hellwig.
      
      4) Fix a cgroup sockopt verifier test by specifying expected attach type,
         from Jean-Philippe Brucker.
      
      Note that when net gets merged into net-next later on, there is a small
      merge conflict in kernel/bpf/btf.c between commit 5b801dfb ("bpf: Fix
      NULL pointer dereference in __btf_resolve_helper_id()") from the bpf tree
      and commit 138b9a05 ("bpf: Remove btf_id helpers resolving") from the
      net-next tree.
      
      Resolve as follows: remove the old hunk with the __btf_resolve_helper_id()
      function. Change the btf_resolve_helper_id() so it actually tests for a
      NULL btf_vmlinux and bails out:
      
      int btf_resolve_helper_id(struct bpf_verifier_log *log,
                                const struct bpf_func_proto *fn, int arg)
      {
              int id;
      
              if (fn->arg_type[arg] != ARG_PTR_TO_BTF_ID || !btf_vmlinux)
                      return -EINVAL;
              id = fn->btf_id[arg];
              if (!id || id > btf_vmlinux->nr_types)
                      return -EINVAL;
              return id;
      }
      
      Let me know if you run into any others issues (CC'ing Jiri Olsa so he's in
      the loop with regards to merge conflict resolution).
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69138b34
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec · 8d46215a
      David S. Miller authored
      Steffen Klassert says:
      
      ====================
      pull request (net): ipsec 2020-07-31
      
      1) Fix policy matching with mark and mask on userspace interfaces.
         From Xin Long.
      
      2) Several fixes for the new ESP in TCP encapsulation.
         From Sabrina Dubroca.
      
      3) Fix crash when the hold queue is used. The assumption that
         xdst->path and dst->child are not a NULL pointer only if dst->xfrm
         is not a NULL pointer is true with the exception of using the
         hold queue. Fix this by checking for hold queue usage before
         dereferencing xdst->path or dst->child.
      
      4) Validate pfkey_dump parameter before sending them.
         From Mark Salyzyn.
      
      5) Fix the location of the transport header with ESP in UDPv6
         encapsulation. From Sabrina Dubroca.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d46215a
    • David S. Miller's avatar
      Merge tag 'mlx5-fixes-2020-07-30' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · e535d87d
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      Mellanox, mlx5 fixes 2020-07-30
      
      This small patchset introduces some fixes to mlx5 driver.
      
      Please pull and let me know if there is any problem.
      
      For -stable v4.18:
       ('net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq')
      
      For -stable v5.7:
       ('net/mlx5e: E-Switch, Add misc bit when misc fields changed for mirroring')
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e535d87d
  6. 31 Jul, 2020 8 commits