1. 15 11月, 2019 23 次提交
    • A
      y2038: allow disabling time32 system calls · 942437c9
      Arnd Bergmann 提交于
      At the moment, the compilation of the old time32 system calls depends
      purely on the architecture. As systems with new libc based on 64-bit
      time_t are getting deployed, even architectures that previously supported
      these (notably x86-32 and arm32 but also many others) no longer depend on
      them, and removing them from a kernel image results in a smaller kernel
      binary, the same way we can leave out many other optional system calls.
      
      More importantly, on an embedded system that needs to keep working
      beyond year 2038, any user space program calling these system calls
      is likely a bug, so removing them from the kernel image does provide
      an extra debugging help for finding broken applications.
      
      I've gone back and forth on hiding this option unless CONFIG_EXPERT
      is set. This version leaves it visible based on the logic that
      eventually it will be turned off indefinitely.
      Acked-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      942437c9
    • A
      y2038: itimer: change implementation to timespec64 · bd40a175
      Arnd Bergmann 提交于
      There is no 64-bit version of getitimer/setitimer since that is not
      actually needed. However, the implementation is built around the
      deprecated 'struct timeval' type.
      
      Change the code to use timespec64 internally to reduce the dependencies
      on timeval and associated helper functions.
      
      Minor adjustments in the code are needed to make the native and compat
      version work the same way, and to keep the range check working after
      the conversion.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      bd40a175
    • A
      y2038: move itimer reset into itimer.c · ddbc7d06
      Arnd Bergmann 提交于
      Preparing for a change to the itimer internals, stop using the
      do_setitimer() symbol and instead use a new higher-level interface.
      
      The do_getitimer()/do_setitimer functions can now be made static,
      allowing the compiler to potentially produce better object code.
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      ddbc7d06
    • A
      y2038: use compat_{get,set}_itimer on alpha · 4c22ea2b
      Arnd Bergmann 提交于
      The itimer handling for the old alpha osf_setitimer/osf_getitimer
      system calls is identical to the compat version of getitimer/setitimer,
      so just use those directly.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      4c22ea2b
    • A
      y2038: itimer: compat handling to itimer.c · c1745f84
      Arnd Bergmann 提交于
      The structure is only used in one place, moving it there simplifies the
      interface and helps with later changes to this code.
      
      Rename it to match the other time32 structures in the process.
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      c1745f84
    • A
      y2038: time: avoid timespec usage in settimeofday() · 5e0fb1b5
      Arnd Bergmann 提交于
      The compat_get_timeval() and timeval_valid() interfaces are deprecated
      and getting removed along with the definition of struct timeval itself.
      
      Change the two implementations of the settimeofday() system call to
      open-code these helpers and completely avoid references to timeval.
      
      The timeval_valid() call is not needed any more here, only a check to
      avoid overflowing tv_nsec during the multiplication, as there is another
      range check in do_sys_settimeofday64().
      
      Tested-by: syzbot+dccce9b26ba09ca49966@syzkaller.appspotmail.com
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      5e0fb1b5
    • A
      y2038: timerfd: Use timespec64 internally · bde9e963
      Arnd Bergmann 提交于
      timerfd_show() uses a 'struct itimerspec' internally, but that is
      deprecated because of the time_t overflow and a conflict with the glibc
      type of the same name that is now incompatible in user space.
      
      Use a pair of timespec64 variables instead as a simple replacement.
      
      As this removes the last use of itimerspec from the kernel, allowing the
      removal of the definition from the uapi headers along with timespec and
      timeval later.
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      bde9e963
    • A
      y2038: elfcore: Use __kernel_old_timeval for process times · e2bb80d5
      Arnd Bergmann 提交于
      We store elapsed time for a crashed process in struct elf_prstatus using
      'timeval' structures. Once glibc starts using 64-bit time_t, this becomes
      incompatible with the kernel's idea of timeval since the structure layout
      no longer matches on 32-bit architectures.
      
      This changes the definition of the elf_prstatus structure to use
      __kernel_old_timeval instead, which is hardcoded to the currently used
      binary layout. There is no risk of overflow in y2038 though, because
      the time values are all relative times, and can store up to 68 years
      of process elapsed time.
      
      There is a risk of applications breaking at build time when they
      use the new kernel headers and expect the type to be exactly 'timeval'
      rather than a structure that has the same fields as before. Those
      applications have to be modified to deal with 64-bit time_t anyway.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      e2bb80d5
    • A
      y2038: make ns_to_compat_timeval use __kernel_old_timeval · 693737b6
      Arnd Bergmann 提交于
      This gets us one step closer to removing 'struct timeval' from the
      kernel. We still keep __kernel_old_timeval for interfaces that we cannot
      fix otherwise, and ns_to_compat_timeval() is provably safe for interfaces
      that are legitimate users of __kernel_old_timeval on native kernels,
      so this is an obvious change.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      693737b6
    • A
      y2038: socket: use __kernel_old_timespec instead of timespec · df1b4ba9
      Arnd Bergmann 提交于
      The 'timespec' type definition and helpers like ktime_to_timespec()
      or timespec64_to_timespec() should no longer be used in the kernel so
      we can remove them and avoid introducing y2038 issues in new code.
      
      Change the socket code that needs to pass a timespec to user space for
      backward compatibility to use __kernel_old_timespec instead.  This type
      has the same layout but with a clearer defined name.
      
      Slightly reformat tcp_recv_timestamp() for consistency after the removal
      of timespec64_to_timespec().
      Acked-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      df1b4ba9
    • A
      y2038: socket: remove timespec reference in timestamping · 0309f98f
      Arnd Bergmann 提交于
      In order to remove the 'struct timespec' definition and the
      timespec64_to_timespec() helper function, change over the in-kernel
      definition of 'struct scm_timestamping' to use the __kernel_old_timespec
      replacement and open-code the assignment.
      Acked-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      0309f98f
    • A
      y2038: syscalls: change remaining timeval to __kernel_old_timeval · 75d319c0
      Arnd Bergmann 提交于
      All of the remaining syscalls that pass a timeval (gettimeofday, utime,
      futimesat) can trivially be changed to pass a __kernel_old_timeval
      instead, which has a compatible layout, but avoids ambiguity with
      the timeval type in user space.
      Acked-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      75d319c0
    • A
      y2038: rusage: use __kernel_old_timeval · bdd565f8
      Arnd Bergmann 提交于
      There are two 'struct timeval' fields in 'struct rusage'.
      
      Unfortunately the definition of timeval is now ambiguous when used in
      user space with a libc that has a 64-bit time_t, and this also changes
      the 'rusage' definition in user space in a way that is incompatible with
      the system call interface.
      
      While there is no good solution to avoid all ambiguity here, change
      the definition in the kernel headers to be compatible with the kernel
      ABI, using __kernel_old_timeval as an unambiguous base type.
      
      In previous discussions, there was also a plan to add a replacement
      for rusage based on 64-bit timestamps and nanosecond resolution,
      i.e. 'struct __kernel_timespec'. I have patches for that as well,
      if anyone thinks we should do that.
      Reviewed-by: NCyrill Gorcunov <gorcunov@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      bdd565f8
    • A
      y2038: uapi: change __kernel_time_t to __kernel_old_time_t · 2a785996
      Arnd Bergmann 提交于
      This is mainly a patch for clarification, and to let us remove
      the time_t definition from the kernel to prevent new users from
      creeping in that might not be y2038-safe.
      
      All remaining uses of 'time_t' or '__kernel_time_t' are part of
      the user API that cannot be changed by that either have a
      replacement or that do not suffer from the y2038 overflow.
      Acked-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      2a785996
    • A
      y2038: stat: avoid 'time_t' in 'struct stat' · 1bf883c1
      Arnd Bergmann 提交于
      The time_t definition may differ between user space and kernel space,
      so replace time_t with an unambiguous 'long' for the mips and sparc.
      
      The same structures also contain 'off_t', which has the same problem,
      so replace that as well on those two architectures and powerpc.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      1bf883c1
    • A
      y2038: ipc: remove __kernel_time_t reference from headers · caf5e32d
      Arnd Bergmann 提交于
      There are two structures based on time_t that conflict between libc and
      kernel: timeval and timespec. Both are now renamed to __kernel_old_timeval
      and __kernel_old_timespec.
      
      For time_t, the old typedef is still __kernel_time_t. There is nothing
      wrong with that name, but it would be nice to not use that going forward
      as this type is used almost only in deprecated interfaces because of
      the y2038 overflow.
      
      In the IPC headers (msgbuf.h, sembuf.h, shmbuf.h), __kernel_time_t is only
      used for the 64-bit variants, which are not deprecated.
      
      Change these to a plain 'long', which is the same type as __kernel_time_t
      on all 64-bit architectures anyway, to reduce the number of users of the
      old type.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      caf5e32d
    • A
      y2038: vdso: powerpc: avoid timespec references · 176ed98c
      Arnd Bergmann 提交于
      As a preparation to stop using 'struct timespec' in the kernel,
      change the powerpc vdso implementation:
      
      - split up the vdso data definition to have equivalent members
         for seconds and nanoseconds instead of an xtime structure
      
      - use timespec64 as an intermediate for the xtime update
      
      - change the asm-offsets definition to be based the appropriate
        fixed-length types
      
      This is only a temporary fix for changing the types, in order
      to actually support a 64-bit safe vdso32 version of clock_gettime(),
      the entire powerpc vdso should be replaced with the generic
      lib/vdso/ implementation. If that happens first, this patch
      becomes obsolete.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      176ed98c
    • A
      y2038: vdso: nds32: open-code timespec_add_ns() · e6071b18
      Arnd Bergmann 提交于
      The nds32 vdso is now the last user of the deprecated timespec_add_ns().
      
      Change it to an open-coded version like the one it already uses in
      do_realtime(). What we should really do though is to use the
      generic vdso implementation that is now used in x86. arm and mips.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      e6071b18
    • A
      y2038: vdso: change time_t to __kernel_old_time_t · 21346564
      Arnd Bergmann 提交于
      Only x86 uses the 'time' syscall in vdso, so change that to
      __kernel_old_time_t as a preparation for removing 'time_t' and
      '__kernel_time_t' later.
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      21346564
    • A
      y2038: vdso: change timespec to __kernel_old_timespec · 82210fc7
      Arnd Bergmann 提交于
      In order to remove 'timespec' completely from the kernel, all
      internal uses should be converted to a y2038-safe type, while
      those that are only for compatibity with existing user space
      should be marked appropriately.
      
      Change vdso to use __kernel_old_timespec in order to avoid
      the deprecated type and mark these interfaces as outdated.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      82210fc7
    • A
      y2038: vdso: change timeval to __kernel_old_timeval · ddccf40f
      Arnd Bergmann 提交于
      The gettimeofday() function in vdso uses the traditional 'timeval'
      structure layout, which will be incompatible with future versions of
      glibc on 32-bit architectures that use a 64-bit time_t.
      
      This interface is problematic for y2038, when time_t overflows on 32-bit
      architectures, but the plan so far is that a libc with 64-bit time_t
      will not call into the gettimeofday() vdso helper at all, and only
      have a method for entering clock_gettime().  This means we don't have
      to fix it here, though we probably want to add a new clock_gettime()
      entry point using a 64-bit version of 'struct timespec' at some point.
      
      Changing the vdso code to use __kernel_old_timeval helps isolate
      this usage from the other ones that still need to be fixed properly,
      and it gets us closer to removing the 'timeval' definition from the
      kernel sources.
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      ddccf40f
    • A
      y2038: add __kernel_old_timespec and __kernel_old_time_t · 94c467dd
      Arnd Bergmann 提交于
      The 'struct timespec' definition can no longer be part of the uapi headers
      because it conflicts with a a now incompatible libc definition. Also,
      we really want to remove it in order to prevent new uses from creeping in.
      
      The same namespace conflict exists with time_t, which should also be
      removed. __kernel_time_t could be used safely, but adding 'old' in the
      name makes it clearer that this should not be used for new interfaces.
      
      Add a replacement __kernel_old_timespec structure and __kernel_old_time_t
      along the lines of __kernel_old_timeval.
      Acked-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      94c467dd
    • A
      y2038: remove CONFIG_64BIT_TIME · 3ca47e95
      Arnd Bergmann 提交于
      The CONFIG_64BIT_TIME option is defined on all architectures, and can
      be removed for simplicity now.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      3ca47e95
  2. 04 11月, 2019 2 次提交
    • L
      Linux 5.4-rc6 · a99d8080
      Linus Torvalds 提交于
      a99d8080
    • L
      Merge tag 'usb-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 3a69c9e5
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "The USB sub-maintainers woke up this past week and sent a bunch of
        tiny fixes. Here are a lot of small patches that that resolve a bunch
        of reported issues in the USB core, drivers, serial drivers, gadget
        drivers, and of course, xhci :)
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (31 commits)
        usb: dwc3: gadget: fix race when disabling ep with cancelled xfers
        usb: cdns3: gadget: Fix g_audio use case when connected to Super-Speed host
        usb: cdns3: gadget: reset EP_CLAIMED flag while unloading
        USB: serial: whiteheat: fix line-speed endianness
        USB: serial: whiteheat: fix potential slab corruption
        USB: gadget: Reject endpoints with 0 maxpacket value
        UAS: Revert commit 3ae62a42 ("UAS: fix alignment of scatter/gather segments")
        usb-storage: Revert commit 747668db ("usb-storage: Set virt_boundary_mask to avoid SG overflows")
        usbip: Fix free of unallocated memory in vhci tx
        usbip: tools: Fix read_usb_vudc_device() error path handling
        usb: xhci: fix __le32/__le64 accessors in debugfs code
        usb: xhci: fix Immediate Data Transfer endianness
        xhci: Fix use-after-free regression in xhci clear hub TT implementation
        USB: ldusb: fix control-message timeout
        USB: ldusb: use unsigned size format specifiers
        USB: ldusb: fix ring-buffer locking
        USB: Skip endpoints with 0 maxpacket length
        usb: cdns3: gadget: Don't manage pullups
        usb: dwc3: remove the call trace of USBx_GFLADJ
        usb: gadget: configfs: fix concurrent issue between composite APIs
        ...
      3a69c9e5
  3. 03 11月, 2019 6 次提交
  4. 02 11月, 2019 9 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 1204c70d
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix free/alloc races in batmanadv, from Sven Eckelmann.
      
       2) Several leaks and other fixes in kTLS support of mlx5 driver, from
          Tariq Toukan.
      
       3) BPF devmap_hash cost calculation can overflow on 32-bit, from Toke
          Høiland-Jørgensen.
      
       4) Add an r8152 device ID, from Kazutoshi Noguchi.
      
       5) Missing include in ipv6's addrconf.c, from Ben Dooks.
      
       6) Use siphash in flow dissector, from Eric Dumazet. Attackers can
          easily infer the 32-bit secret otherwise etc.
      
       7) Several netdevice nesting depth fixes from Taehee Yoo.
      
       8) Fix several KCSAN reported errors, from Eric Dumazet. For example,
          when doing lockless skb_queue_empty() checks, and accessing
          sk_napi_id/sk_incoming_cpu lockless as well.
      
       9) Fix jumbo packet handling in RXRPC, from David Howells.
      
      10) Bump SOMAXCONN and tcp_max_syn_backlog values, from Eric Dumazet.
      
      11) Fix DMA synchronization in gve driver, from Yangchun Fu.
      
      12) Several bpf offload fixes, from Jakub Kicinski.
      
      13) Fix sk_page_frag() recursion during memory reclaim, from Tejun Heo.
      
      14) Fix ping latency during high traffic rates in hisilicon driver, from
          Jiangfent Xiao.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (146 commits)
        net: fix installing orphaned programs
        net: cls_bpf: fix NULL deref on offload filter removal
        selftests: bpf: Skip write only files in debugfs
        selftests: net: reuseport_dualstack: fix uninitalized parameter
        r8169: fix wrong PHY ID issue with RTL8168dp
        net: dsa: bcm_sf2: Fix IMP setup for port different than 8
        net: phylink: Fix phylink_dbg() macro
        gve: Fixes DMA synchronization.
        inet: stop leaking jiffies on the wire
        ixgbe: Remove duplicate clear_bit() call
        Documentation: networking: device drivers: Remove stray asterisks
        e1000: fix memory leaks
        i40e: Fix receive buffer starvation for AF_XDP
        igb: Fix constant media auto sense switching when no cable is connected
        net: ethernet: arc: add the missed clk_disable_unprepare
        igb: Enable media autosense for the i350.
        igb/igc: Don't warn on fatal read failures when the device is removed
        tcp: increase tcp_max_syn_backlog max value
        net: increase SOMAXCONN to 4096
        netdevsim: Fix use-after-free during device dismantle
        ...
      1204c70d
    • L
      Merge tag 'nfs-for-5.4-3' of git://git.linux-nfs.org/projects/anna/linux-nfs · 372bf6c1
      Linus Torvalds 提交于
      Pull NFS client bugfixes from Anna Schumaker:
       "This contains two delegation fixes (with the RCU lock leak fix marked
        for stable), and three patches to fix destroying the the sunrpc back
        channel.
      
        Stable bugfixes:
      
         - Fix an RCU lock leak in nfs4_refresh_delegation_stateid()
      
        Other fixes:
      
         - The TCP back channel mustn't disappear while requests are
           outstanding
      
         - The RDMA back channel mustn't disappear while requests are
           outstanding
      
         - Destroy the back channel when we destroy the host transport
      
         - Don't allow a cached open with a revoked delegation"
      
      * tag 'nfs-for-5.4-3' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFS: Fix an RCU lock leak in nfs4_refresh_delegation_stateid()
        NFSv4: Don't allow a cached open with a revoked delegation
        SUNRPC: Destroy the back channel when we destroy the host transport
        SUNRPC: The RDMA back channel mustn't disappear while requests are outstanding
        SUNRPC: The TCP back channel mustn't disappear while requests are outstanding
      372bf6c1
    • L
      Merge tag 'for-linus-20191101' of git://git.kernel.dk/linux-block · 0821de28
      Linus Torvalds 提交于
      Pull block fixes from Jens Axboe:
      
       - Two small nvme fixes, one is a fabrics connection fix, the other one
         a cleanup made possible by that fix (Anton, via Keith)
      
       - Fix requeue handling in umb ubd (Anton)
      
       - Fix spin_lock_irq() nesting in blk-iocost (Dan)
      
       - Three small io_uring fixes:
           - Install io_uring fd after done with ctx (me)
           - Clear ->result before every poll issue (me)
           - Fix leak of shadow request on error (Pavel)
      
      * tag 'for-linus-20191101' of git://git.kernel.dk/linux-block:
        iocost: don't nest spin_lock_irq in ioc_weight_write()
        io_uring: ensure we clear io_kiocb->result before each issue
        um-ubd: Entrust re-queue to the upper layers
        nvme-multipath: remove unused groups_only mode in ana log
        nvme-multipath: fix possible io hang after ctrl reconnect
        io_uring: don't touch ctx in setup after ring fd install
        io_uring: Fix leaked shadow_req
      0821de28
    • L
      Merge tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · e5897c7d
      Linus Torvalds 提交于
      Pull RISC-V fixes from Paul Walmsley:
       "One fix for PCIe users:
      
         - Fix legacy PCI I/O port access emulation
      
        One set of cleanups:
      
         - Resolve most of the warnings generated by sparse across arch/riscv.
           No functional changes
      
        And one MAINTAINERS update:
      
         - Update Palmer's E-mail address"
      
      * tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        MAINTAINERS: Change to my personal email address
        RISC-V: Add PCIe I/O BAR memory mapping
        riscv: for C functions called only from assembly, mark with __visible
        riscv: fp: add missing __user pointer annotations
        riscv: add missing header file includes
        riscv: mark some code and data as file-static
        riscv: init: merge split string literals in preprocessor directive
        riscv: add prototypes for assembly language functions from head.S
      e5897c7d
    • L
      Merge branch 'parisc-5.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 31408fbe
      Linus Torvalds 提交于
      Pull parisc fix from Helge Deller:
       "Fix a parisc kernel crash with ftrace functions when compiled without
        frame pointers"
      
      * 'parisc-5.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: fix frame pointer in ftrace_regs_caller()
      31408fbe
    • D
      Merge branch 'fix-BPF-offload-related-bugs' · aeb1b85c
      David S. Miller 提交于
      Jakub Kicinski says:
      
      ====================
      fix BPF offload related bugs
      
      test_offload.py catches some recently added bugs.
      
      First of a bug in test_offload.py itself after recent changes
      to netdevsim is fixed.
      
      Second patch fixes a bug in cls_bpf, and last one addresses
      a problem with the recently added XDP installation optimization.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aeb1b85c
    • J
      net: fix installing orphaned programs · aefc3e72
      Jakub Kicinski 提交于
      When netdevice with offloaded BPF programs is destroyed
      the programs are orphaned and removed from the program
      IDA - their IDs get released (the programs may remain
      accessible via existing open file descriptors and pinned
      files). After IDs are released they are set to 0.
      
      This confuses dev_change_xdp_fd() because it compares
      the __dev_xdp_query() result where 0 means no program
      with prog->aux->id where 0 means orphaned.
      
      dev_change_xdp_fd() would have incorrectly returned success
      even though it had not installed the program.
      
      Since drivers already catch this case via bpf_offload_dev_match()
      let them handle this case. The error message drivers produce in
      this case ("program loaded for a different device") is in fact
      correct as the orphaned program must had to be loaded for a
      different device.
      
      Fixes: c14a9f63 ("net: Don't call XDP_SETUP_PROG when nothing is changed")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aefc3e72
    • J
      net: cls_bpf: fix NULL deref on offload filter removal · 41aa29a5
      Jakub Kicinski 提交于
      Commit 40119211 ("net: sched: refactor block offloads counter
      usage") missed the fact that either new prog or old prog may be
      NULL.
      
      Fixes: 40119211 ("net: sched: refactor block offloads counter usage")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41aa29a5
    • J
      selftests: bpf: Skip write only files in debugfs · 8101e069
      Jakub Kicinski 提交于
      DebugFS for netdevsim now contains some "action trigger" files
      which are write only. Don't try to capture the contents of those.
      
      Note that we can't use os.access() because the script requires
      root.
      
      Fixes: 4418f862 ("netdevsim: implement support for devlink region and snapshots")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8101e069