1. 29 6月, 2022 1 次提交
  2. 12 6月, 2022 1 次提交
  3. 11 6月, 2022 2 次提交
    • D
      netfs: Rename the netfs_io_request cleanup op and give it an op pointer · 40a81101
      David Howells 提交于
      The netfs_io_request cleanup op is now always in a position to be given a
      pointer to a netfs_io_request struct, so this can be passed in instead of
      the mapping and private data arguments (both of which are included in the
      struct).
      
      So rename the ->cleanup op to ->free_request (to match ->init_request) and
      pass in the I/O pointer.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@kernel.org>
      cc: linux-cachefs@redhat.com
      40a81101
    • L
      netfs: Further cleanups after struct netfs_inode wrapper introduced · e81fb419
      Linus Torvalds 提交于
      Change the signature of netfs helper functions to take a struct netfs_inode
      pointer rather than a struct inode pointer where appropriate, thereby
      relieving the need for the network filesystem to convert its internal inode
      format down to the VFS inode only for netfslib to bounce it back up.  For
      type safety, it's better not to do that (and it's less typing too).
      
      Give netfs_write_begin() an extra argument to pass in a pointer to the
      netfs_inode struct rather than deriving it internally from the file
      pointer.  Note that the ->write_begin() and ->write_end() ops are intended
      to be replaced in the future by netfslib code that manages this without the
      need to call in twice for each page.
      
      netfs_readpage() and similar are intended to be pointed at directly by the
      address_space_operations table, so must stick to the signature dictated by
      the function pointers there.
      
      Changes
      =======
      - Updated the kerneldoc comments and documentation [DH].
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      cc: linux-cachefs@redhat.com
      Link: https://lore.kernel.org/r/CAHk-=wgkwKyNmNdKpQkqZ6DnmUL-x9hp0YBnUGjaPFEAdxDTbw@mail.gmail.com/
      e81fb419
  4. 10 6月, 2022 6 次提交
  5. 09 6月, 2022 4 次提交
    • J
      vdpa: make get_vq_group and set_group_asid optional · 00d1f546
      Jason Wang 提交于
      This patch makes get_vq_group and set_group_asid optional. This is
      needed to unbreak the vDPA parent that doesn't support multiple
      address spaces.
      
      Cc: Gautam Dawar <gautam.dawar@xilinx.com>
      Fixes: aaca8373 ("vhost-vdpa: support ASID based IOTLB API")
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Message-Id: <20220609041901.2029-1-jasowang@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      00d1f546
    • C
      block: remove bioset_init_from_src · d5a37b19
      Christoph Hellwig 提交于
      Unused now, and the interface never really made a whole lot of sense to
      start with.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NMike Snitzer <snitzer@kernel.org>
      d5a37b19
    • W
      ipv6: Fix signed integer overflow in __ip6_append_data · f93431c8
      Wang Yufen 提交于
      Resurrect ubsan overflow checks and ubsan report this warning,
      fix it by change the variable [length] type to size_t.
      
      UBSAN: signed-integer-overflow in net/ipv6/ip6_output.c:1489:19
      2147479552 + 8567 cannot be represented in type 'int'
      CPU: 0 PID: 253 Comm: err Not tainted 5.16.0+ #1
      Hardware name: linux,dummy-virt (DT)
      Call trace:
        dump_backtrace+0x214/0x230
        show_stack+0x30/0x78
        dump_stack_lvl+0xf8/0x118
        dump_stack+0x18/0x30
        ubsan_epilogue+0x18/0x60
        handle_overflow+0xd0/0xf0
        __ubsan_handle_add_overflow+0x34/0x44
        __ip6_append_data.isra.48+0x1598/0x1688
        ip6_append_data+0x128/0x260
        udpv6_sendmsg+0x680/0xdd0
        inet6_sendmsg+0x54/0x90
        sock_sendmsg+0x70/0x88
        ____sys_sendmsg+0xe8/0x368
        ___sys_sendmsg+0x98/0xe0
        __sys_sendmmsg+0xf4/0x3b8
        __arm64_sys_sendmmsg+0x34/0x48
        invoke_syscall+0x64/0x160
        el0_svc_common.constprop.4+0x124/0x300
        do_el0_svc+0x44/0xc8
        el0_svc+0x3c/0x1e8
        el0t_64_sync_handler+0x88/0xb0
        el0t_64_sync+0x16c/0x170
      
      Changes since v1:
      -Change the variable [length] type to unsigned, as Eric Dumazet suggested.
      Changes since v2:
      -Don't change exthdrlen type in ip6_make_skb, as Paolo Abeni suggested.
      Changes since v3:
      -Don't change ulen type in udpv6_sendmsg and l2tp_ip6_sendmsg, as
      Jakub Kicinski suggested.
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWang Yufen <wangyufen@huawei.com>
      Link: https://lore.kernel.org/r/20220607120028.845916-1-wangyufen@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      f93431c8
    • C
      SUNRPC: Optimize xdr_reserve_space() · 62ed448c
      Chuck Lever 提交于
      Transitioning between encode buffers is quite infrequent. It happens
      about 1 time in 400 calls to xdr_reserve_space(), measured on NFSD
      with a typical build/test workload.
      
      Force the compiler to remove that code from xdr_reserve_space(),
      which is a hot path on both the server and the client. This change
      reduces the size of xdr_reserve_space() from 10 cache lines to 2
      when compiled with -Os.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Reviewed-by: NJ. Bruce Fields <bfields@fieldses.org>
      62ed448c
  6. 08 6月, 2022 2 次提交
    • W
      workqueue: Fix type of cpu in trace event · 873a4009
      Wonhyuk Yang 提交于
      The trace event "workqueue_queue_work" use unsigned int type for
      req_cpu, cpu. This casue confusing cpu number like below log.
      
      $ cat /sys/kernel/debug/tracing/trace
      cat-317  [001] ...: workqueue_queue_work: ... req_cpu=8192 cpu=4294967295
      
      So, change unsigned type to signed type in the trace event. After
      applying this patch, cpu number will be printed as -1 instead of
      4294967295 as folllows.
      
      $ cat /sys/kernel/debug/tracing/trace
      cat-1338  [002] ...: workqueue_queue_work: ... req_cpu=8192 cpu=-1
      
      Cc: Baik Song An <bsahn@etri.re.kr>
      Cc: Hong Yeon Kim <kimhy@etri.re.kr>
      Cc: Taeung Song <taeung@reallinux.co.kr>
      Cc: linuxgeek@linuxgeek.io
      Signed-off-by: NWonhyuk Yang <vvghjk1234@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      873a4009
    • T
      workqueue: Wrap flush_workqueue() using a macro · c4f135d6
      Tetsuo Handa 提交于
      Since flush operation synchronously waits for completion, flushing
      system-wide WQs (e.g. system_wq) might introduce possibility of deadlock
      due to unexpected locking dependency. Tejun Heo commented at [1] that it
      makes no sense at all to call flush_workqueue() on the shared WQs as the
      caller has no idea what it's gonna end up waiting for.
      
      Although there is flush_scheduled_work() which flushes system_wq WQ with
      "Think twice before calling this function! It's very easy to get into
      trouble if you don't take great care." warning message, syzbot found a
      circular locking dependency caused by flushing system_wq WQ [2].
      
      Therefore, let's change the direction to that developers had better use
      their local WQs if flush_scheduled_work()/flush_workqueue(system_*_wq) is
      inevitable.
      
      Steps for converting system-wide WQs into local WQs are explained at [3],
      and a conversion to stop flushing system-wide WQs is in progress. Now we
      want some mechanism for preventing developers who are not aware of this
      conversion from again start flushing system-wide WQs.
      
      Since I found that WARN_ON() is complete but awkward approach for teaching
      developers about this problem, let's use __compiletime_warning() for
      incomplete but handy approach. For completeness, we will also insert
      WARN_ON() into __flush_workqueue() after all in-tree users stopped calling
      flush_scheduled_work().
      
      Link: https://lore.kernel.org/all/YgnQGZWT%2Fn3VAITX@slm.duckdns.org/ [1]
      Link: https://syzkaller.appspot.com/bug?extid=bde0f89deacca7c765b8 [2]
      Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp [3]
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      c4f135d6
  7. 07 6月, 2022 2 次提交
  8. 06 6月, 2022 10 次提交
  9. 03 6月, 2022 9 次提交
  10. 02 6月, 2022 3 次提交
    • C
      binder: fix sender_euid type in uapi header · 8cc5b032
      Carlos Llamas 提交于
      The {pid,uid}_t fields of struct binder_transaction were recently
      replaced to use kernel types in commit 169adc2b ("android/binder.h:
      add linux/android/binder(fs).h to UAPI compile-test coverage").
      
      However, using __kernel_uid_t here breaks backwards compatibility in
      architectures using 16-bits for this type, since glibc and some others
      still expect a 32-bit uid_t. Instead, let's use __kernel_uid32_t which
      avoids this compatibility problem.
      
      Fixes: 169adc2b ("android/binder.h: add linux/android/binder(fs).h to UAPI compile-test coverage")
      Reported-by: NChristopher Ferris <cferris@google.com>
      Signed-off-by: NCarlos Llamas <cmllamas@google.com>
      Acked-by: NTodd Kjos <tkjos@google.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      8cc5b032
    • D
      ax25: Fix ax25 session cleanup problems · 7d8a3a47
      Duoming Zhou 提交于
      There are session cleanup problems in ax25_release() and
      ax25_disconnect(). If we setup a session and then disconnect,
      the disconnected session is still in "LISTENING" state that
      is shown below.
      
      Active AX.25 sockets
      Dest       Source     Device  State        Vr/Vs    Send-Q  Recv-Q
      DL9SAU-4   DL9SAU-3   ???     LISTENING    000/000  0       0
      DL9SAU-3   DL9SAU-4   ???     LISTENING    000/000  0       0
      
      The first reason is caused by del_timer_sync() in ax25_release().
      The timers of ax25 are used for correct session cleanup. If we use
      ax25_release() to close ax25 sessions and ax25_dev is not null,
      the del_timer_sync() functions in ax25_release() will execute.
      As a result, the sessions could not be cleaned up correctly,
      because the timers have stopped.
      
      In order to solve this problem, this patch adds a device_up flag
      in ax25_dev in order to judge whether the device is up. If there
      are sessions to be cleaned up, the del_timer_sync() in
      ax25_release() will not execute. What's more, we add ax25_cb_del()
      in ax25_kill_by_device(), because the timers have been stopped
      and there are no functions that could delete ax25_cb if we do not
      call ax25_release(). Finally, we reorder the position of
      ax25_list_lock in ax25_cb_del() in order to synchronize among
      different functions that call ax25_cb_del().
      
      The second reason is caused by improper check in ax25_disconnect().
      The incoming ax25 sessions which ax25->sk is null will close
      heartbeat timer, because the check "if(!ax25->sk || ..)" is
      satisfied. As a result, the session could not be cleaned up properly.
      
      In order to solve this problem, this patch changes the improper
      check to "if(ax25->sk && ..)" in ax25_disconnect().
      
      What`s more, the ax25_disconnect() may be called twice, which is
      not necessary. For example, ax25_kill_by_device() calls
      ax25_disconnect() and sets ax25->state to AX25_STATE_0, but
      ax25_release() calls ax25_disconnect() again.
      
      In order to solve this problem, this patch add a check in
      ax25_release(). If the flag of ax25->sk equals to SOCK_DEAD,
      the ax25_disconnect() in ax25_release() should not be executed.
      
      Fixes: 82e31755 ("ax25: Fix UAF bugs in ax25 timers")
      Fixes: 8a367e74 ("ax25: Fix segfault after sock connection timeout")
      Reported-and-tested-by: NThomas Osterried <thomas@osterried.de>
      Signed-off-by: NDuoming Zhou <duoming@zju.edu.cn>
      Link: https://lore.kernel.org/r/20220530152158.108619-1-duoming@zju.edu.cnSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
      7d8a3a47
    • P
      netfilter: nf_tables: delete flowtable hooks via transaction list · b6d9014a
      Pablo Neira Ayuso 提交于
      Remove inactive bool field in nft_hook object that was introduced in
      abadb2f8 ("netfilter: nf_tables: delete devices from flowtable").
      Move stale flowtable hooks to transaction list instead.
      
      Deleting twice the same device does not result in ENOENT.
      
      Fixes: abadb2f8 ("netfilter: nf_tables: delete devices from flowtable")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      b6d9014a
新手
引导
客服 返回
顶部