1. 25 Jan, 2023 14 commits
    • Steven Rostedt (Google)'s avatar
      tracing/histogram: Add simple tests for stacktrace usage of synthetic events · b81a3a10
      Steven Rostedt (Google) authored
      Update the selftests to include a test of passing a stacktrace between the
      events of a synthetic event.
      
      Link: https://lkml.kernel.org/r/20230117152236.475439286@goodmis.org
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Ross Zwisler <zwisler@google.com>
      Cc: Ching-lin Yu <chinglinyu@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      b81a3a10
    • Steven Rostedt (Google)'s avatar
      tracing/histogram: Document variable stacktrace · 88238513
      Steven Rostedt (Google) authored
      Add a little documentation (and a useful example) of how a stacktrace can
      be used within a histogram variable and synthetic event.
      
      Link: https://lkml.kernel.org/r/20230117152236.320181354@goodmis.org
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Ross Zwisler <zwisler@google.com>
      Cc: Ching-lin Yu <chinglinyu@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      88238513
    • Steven Rostedt (Google)'s avatar
      tracing/histogram: Add stacktrace type · cc5fc8bf
      Steven Rostedt (Google) authored
      Now that stacktraces can be part of synthetic events, allow a key to be
      typed as a stacktrace.
      
        # cd /sys/kernel/tracing
        # echo 's:block_lat u64 delta; unsigned long stack[];' >> dynamic_events
        # echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=stacktrace if prev_state == 2' >> events/sched/sched_switch/trigger
        # echo 'hist:keys=prev_pid:delta=common_timestamp.usecs-$ts,st2=$st:onmatch(sched.sched_switch).trace(block_lat,$delta,$st2)' >> events/sched/sched_switch/trigger
        # echo 'hist:keys=delta.buckets=100,stack.stacktrace:sort=delta' > events/synthetic/block_lat/trigger
      
        # cat events/synthetic/block_lat/hist
      
        # event histogram
        #
        # trigger info: hist:keys=delta.buckets=100,stacktrace:vals=hitcount:sort=delta.buckets=100:size=2048 [active]
        #
      
        { delta: ~ 0-99, stacktrace:
                 event_hist_trigger+0x464/0x480
                 event_triggers_call+0x52/0xe0
                 trace_event_buffer_commit+0x193/0x250
                 trace_event_raw_event_sched_switch+0xfc/0x150
                 __traceiter_sched_switch+0x41/0x60
                 __schedule+0x448/0x7b0
                 schedule_idle+0x26/0x40
                 cpu_startup_entry+0x19/0x20
                 start_secondary+0xed/0xf0
                 secondary_startup_64_no_verify+0xe0/0xeb
        } hitcount:          6
        { delta: ~ 0-99, stacktrace:
                 event_hist_trigger+0x464/0x480
                 event_triggers_call+0x52/0xe0
                 trace_event_buffer_commit+0x193/0x250
                 trace_event_raw_event_sched_switch+0xfc/0x150
                 __traceiter_sched_switch+0x41/0x60
                 __schedule+0x448/0x7b0
                 schedule_idle+0x26/0x40
                 cpu_startup_entry+0x19/0x20
                 __pfx_kernel_init+0x0/0x10
                 arch_call_rest_init+0xa/0x24
                 start_kernel+0x964/0x98d
                 secondary_startup_64_no_verify+0xe0/0xeb
        } hitcount:          3
        { delta: ~ 0-99, stacktrace:
                 event_hist_trigger+0x464/0x480
                 event_triggers_call+0x52/0xe0
                 trace_event_buffer_commit+0x193/0x250
                 trace_event_raw_event_sched_switch+0xfc/0x150
                 __traceiter_sched_switch+0x41/0x60
                 __schedule+0x448/0x7b0
                 schedule+0x5a/0xb0
                 worker_thread+0xaf/0x380
                 kthread+0xe9/0x110
                 ret_from_fork+0x2c/0x50
        } hitcount:          1
        { delta: ~ 100-199, stacktrace:
                 event_hist_trigger+0x464/0x480
                 event_triggers_call+0x52/0xe0
                 trace_event_buffer_commit+0x193/0x250
                 trace_event_raw_event_sched_switch+0xfc/0x150
                 __traceiter_sched_switch+0x41/0x60
                 __schedule+0x448/0x7b0
                 schedule_idle+0x26/0x40
                 cpu_startup_entry+0x19/0x20
                 start_secondary+0xed/0xf0
                 secondary_startup_64_no_verify+0xe0/0xeb
        } hitcount:         15
        [..]
        { delta: ~ 8500-8599, stacktrace:
                 event_hist_trigger+0x464/0x480
                 event_triggers_call+0x52/0xe0
                 trace_event_buffer_commit+0x193/0x250
                 trace_event_raw_event_sched_switch+0xfc/0x150
                 __traceiter_sched_switch+0x41/0x60
                 __schedule+0x448/0x7b0
                 schedule_idle+0x26/0x40
                 cpu_startup_entry+0x19/0x20
                 start_secondary+0xed/0xf0
                 secondary_startup_64_no_verify+0xe0/0xeb
        } hitcount:          1
      
        Totals:
            Hits: 89
            Entries: 11
            Dropped: 0
      
      Link: https://lkml.kernel.org/r/20230117152236.167046397@goodmis.org
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Ross Zwisler <zwisler@google.com>
      Cc: Ching-lin Yu <chinglinyu@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      cc5fc8bf
    • Steven Rostedt (Google)'s avatar
      tracing: Allow synthetic events to pass around stacktraces · 00cf3d67
      Steven Rostedt (Google) authored
      Allow a stacktrace from one event to be displayed by the end event of a
      synthetic event. This is very useful when looking for the longest latency
      of a sleep or something blocked on I/O.
      
       # cd /sys/kernel/tracing/
       # echo 's:block_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events
       # echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=stacktrace  if prev_state == 1||prev_state == 2' > events/sched/sched_switch/trigger
       # echo 'hist:keys=prev_pid:delta=common_timestamp.usecs-$ts,s=$st:onmax($delta).trace(block_lat,prev_pid,$delta,$s)' >> events/sched/sched_switch/trigger
      
      The above creates a "block_lat" synthetic event that take the stacktrace of
      when a task schedules out in either the interruptible or uninterruptible
      states, and on a new per process max $delta (the time it was scheduled
      out), will print the process id and the stacktrace.
      
        # echo 1 > events/synthetic/block_lat/enable
        # cat trace
       #           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
       #              | |         |   |||||     |         |
          kworker/u16:0-767     [006] d..4.   560.645045: block_lat: pid=767 delta=66 stack=STACK:
       => __schedule
       => schedule
       => pipe_read
       => vfs_read
       => ksys_read
       => do_syscall_64
       => 0x966000aa
      
                 <idle>-0       [003] d..4.   561.132117: block_lat: pid=0 delta=413787 stack=STACK:
       => __schedule
       => schedule
       => schedule_hrtimeout_range_clock
       => do_sys_poll
       => __x64_sys_poll
       => do_syscall_64
       => 0x966000aa
      
                  <...>-153     [006] d..4.   562.068407: block_lat: pid=153 delta=54 stack=STACK:
       => __schedule
       => schedule
       => io_schedule
       => rq_qos_wait
       => wbt_wait
       => __rq_qos_throttle
       => blk_mq_submit_bio
       => submit_bio_noacct_nocheck
       => ext4_bio_write_page
       => mpage_submit_page
       => mpage_process_page_bufs
       => mpage_prepare_extent_to_map
       => ext4_do_writepages
       => ext4_writepages
       => do_writepages
       => __writeback_single_inode
      
      Link: https://lkml.kernel.org/r/20230117152236.010941267@goodmis.org
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Ross Zwisler <zwisler@google.com>
      Cc: Ching-lin Yu <chinglinyu@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      00cf3d67
    • Steven Rostedt (Google)'s avatar
      tracing: Allow stacktraces to be saved as histogram variables · 288709c9
      Steven Rostedt (Google) authored
      Allow to save stacktraces into a histogram variable. This will be used by
      synthetic events to allow a stacktrace from one event to be passed and
      displayed by another event.
      
      The special keyword "stacktrace" is to be used to trigger a stack
      trace for the event that the histogram trigger is attached to.
      
        echo 'hist:keys=pid:st=stacktrace" > events/sched/sched_waking/trigger
      
      Currently nothing can get access to the "$st" variable above that contains
      the stack trace, but that will soon change.
      
      Link: https://lkml.kernel.org/r/20230117152235.856323729@goodmis.org
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Ross Zwisler <zwisler@google.com>
      Cc: Ching-lin Yu <chinglinyu@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      288709c9
    • Steven Rostedt (Google)'s avatar
      tracing: Simplify calculating entry size using struct_size() · 19ff8049
      Steven Rostedt (Google) authored
      When tracing a dynamic string field for a synthetic event, the offset
      calculation for where to write the next event can use struct_size() to
      find what the current size of the structure is.
      
      This simplifies the code and makes it less error prone.
      
      Link: https://lkml.kernel.org/r/20230117152235.698632147@goodmis.org
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Ross Zwisler <zwisler@google.com>
      Cc: Ching-lin Yu <chinglinyu@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      19ff8049
    • Jia-Ju Bai's avatar
      tracing: Add NULL checks for buffer in ring_buffer_free_read_page() · 3e4272b9
      Jia-Ju Bai authored
      In a previous commit 7433632c, buffer, buffer->buffers and
      buffer->buffers[cpu] in ring_buffer_wake_waiters() can be NULL,
      and thus the related checks are added.
      
      However, in the same call stack, these variables are also used in
      ring_buffer_free_read_page():
      
      tracing_buffers_release()
        ring_buffer_wake_waiters(iter->array_buffer->buffer)
          cpu_buffer = buffer->buffers[cpu] -> Add checks by previous commit
        ring_buffer_free_read_page(iter->array_buffer->buffer)
          cpu_buffer = buffer->buffers[cpu] -> No check
      
      Thus, to avod possible null-pointer derefernces, the related checks
      should be added.
      
      These results are reported by a static tool designed by myself.
      
      Link: https://lkml.kernel.org/r/20230113125501.760324-1-baijiaju1990@gmail.comReported-by: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
      Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      3e4272b9
    • Mark Rutland's avatar
      ftrace: Add sample with custom ops · b56c68f7
      Mark Rutland authored
      When reworking core ftrace code or architectural ftrace code, it's often
      necessary to test/analyse/benchmark a number of ftrace_ops
      configurations. This patch adds a module which can be used to explore
      some of those configurations.
      
      I'm using this to benchmark various options for changing the way
      trampolines and handling of ftrace_ops work on arm64, and ensuring other
      architectures aren't adversely affected.
      
      For example, in a QEMU+KVM VM running on a 2GHz Xeon E5-2660
      workstation, loading the module in various configurations produces:
      
      | # insmod ftrace-ops.ko
      | ftrace_ops: registering:
      |   relevant ops: 1
      |     tracee: tracee_relevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   irrelevant ops: 0
      |     tracee: tracee_irrelevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   saving registers: NO
      |   assist recursion: NO
      |   assist RCU: NO
      | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 1681558ns (16ns / call)
      
      | # insmod ftrace-ops.ko nr_ops_irrelevant=5
      | ftrace_ops: registering:
      |   relevant ops: 1
      |     tracee: tracee_relevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   irrelevant ops: 5
      |     tracee: tracee_irrelevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   saving registers: NO
      |   assist recursion: NO
      |   assist RCU: NO
      | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 1693042ns (16ns / call)
      
      | # insmod ftrace-ops.ko nr_ops_relevant=2
      | ftrace_ops: registering:
      |   relevant ops: 2
      |     tracee: tracee_relevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   irrelevant ops: 0
      |     tracee: tracee_irrelevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   saving registers: NO
      |   assist recursion: NO
      |   assist RCU: NO
      | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 11965582ns (119ns / call)
      
      | # insmod ftrace-ops.ko save_regs=true
      | ftrace_ops: registering:
      |   relevant ops: 1
      |     tracee: tracee_relevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   irrelevant ops: 0
      |     tracee: tracee_irrelevant [ftrace_ops]
      |     tracer: ops_func_nop [ftrace_ops]
      |   saving registers: YES
      |   assist recursion: NO
      |   assist RCU: NO
      | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 4459624ns (44ns / call)
      
      Link: https://lkml.kernel.org/r/20230103124912.2948963-4-mark.rutland@arm.com
      
      Cc: Florent Revest <revest@chromium.org>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      b56c68f7
    • Steven Rostedt (Google)'s avatar
      tracing/selftests: Add test for event filtering on function name · 7f09d639
      Steven Rostedt (Google) authored
      With the new filter logic of passing in the name of a function to match an
      instruction pointer (or the address of the function), add a test to make
      sure that it is functional.
      
      This is also the first test to test plain filtering. The filtering has
      been tested via the trigger logic, which uses the same code, but there was
      nothing to test just the event filter, so this test is the first to add
      such a case.
      
      Link: https://lkml.kernel.org/r/20221219183214.075559302@goodmis.org
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Zheng Yejian <zhengyejian1@huawei.com>
      Cc: linux-kselftest@vger.kernel.org
      Suggested-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Reviewed-by: default avatarRoss Zwisler <zwisler@google.com>
      Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      7f09d639
    • Steven Rostedt (Google)'s avatar
      tracing: Add a way to filter function addresses to function names · e6745a4d
      Steven Rostedt (Google) authored
      There's been several times where an event records a function address in
      its field and I needed to filter on that address for a specific function
      name. It required looking up the function in kallsyms, finding its size,
      and doing a compare of "field >= function_start && field < function_end".
      
      But this would change from boot to boot and is unreliable in scripts.
      Also, it is useful to have this at boot up, where the addresses will not
      be known. For example, on the boot command line:
      
        trace_trigger="initcall_finish.traceoff if func.function == acpi_init"
      
      To implement this, add a ".function" prefix, that will check that the
      field is of size long, and the only operations allowed (so far) are "=="
      and "!=".
      
      Link: https://lkml.kernel.org/r/20221219183213.916833763@goodmis.org
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Zheng Yejian <zhengyejian1@huawei.com>
      Reviewed-by: default avatarRoss Zwisler <zwisler@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      e6745a4d
    • Colin Ian King's avatar
      rv: remove redundant initialization of pointer ptr · ae3edea8
      Colin Ian King authored
      The pointer ptr is being initialized with a value that is never read,
      it is being updated later on a call to strim. Remove the extraneous
      initialization.
      
      Link: https://lkml.kernel.org/r/20230116161612.77192-1-colin.i.king@gmail.com
      
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      ae3edea8
    • Mark Rutland's avatar
      ftrace: Maintain samples/ftrace · 34226fc6
      Mark Rutland authored
      There's no entry in MAINTAINERS for samples/ftrace. Add one so that the
      FTRACE maintainers are kept in the loop.
      
      Link: https://lkml.kernel.org/r/20230103124912.2948963-2-mark.rutland@arm.comAcked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      34226fc6
    • Randy Dunlap's avatar
      tracing/filter: fix kernel-doc warnings · d5090d91
      Randy Dunlap authored
      Use the 'struct' keyword for a struct's kernel-doc notation and
      use the correct function parameter name to eliminate kernel-doc
      warnings:
      
      kernel/trace/trace_events_filter.c:136: warning: cannot understand function prototype: 'struct prog_entry '
      kerne/trace/trace_events_filter.c:155: warning: Excess function parameter 'when_to_branch' description in 'update_preds'
      
      Also correct some trivial punctuation problems.
      
      Link: https://lkml.kernel.org/r/20230108021238.16398-1-rdunlap@infradead.orgSigned-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      d5090d91
    • Randy Dunlap's avatar
      lib: Kconfig: fix spellos · ca0f2cfc
      Randy Dunlap authored
      Fix spelling in lib/ Kconfig files.
      (reported by codespell)
      
      Link: https://lkml.kernel.org/r/20230124181655.16269-1-rdunlap@infradead.org
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Marco Elver <elver@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: kasan-dev@googlegroups.com
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      ca0f2cfc
  2. 24 Jan, 2023 6 commits
  3. 22 Jan, 2023 2 commits
    • Linus Torvalds's avatar
      Linux 6.2-rc5 · 2241ab53
      Linus Torvalds authored
      2241ab53
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux · 95f184d0
      Linus Torvalds authored
      Pull another io_uring fix from Jens Axboe:
       "Just a single fix for a regression that happened in this release due
        to a poll change. Normally I would've just deferred it to next week,
        but since the original fix got picked up by stable, I think it's
        better to just send this one off separately.
      
        The issue is around the poll race fix, and how it mistakenly also got
        applied to multishot polling. Those don't need the race fix, and we
        should not be doing any reissues for that case. Exhaustive test cases
        were written and committed to the liburing regression suite for the
        reported issue, and additions for similar issues"
      
      * tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux:
        io_uring/poll: don't reissue in case of poll race on multishot request
      95f184d0
  4. 21 Jan, 2023 9 commits
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · f6714402
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char/misc and other subsystem driver fixes for
        6.2-rc5 to resolve a few reported issues. They include:
      
         - long time pending fastrpc fixes (should have gone into 6.1, my
           fault)
      
         - mei driver/bus fixes and new device ids
      
         - interconnect driver fixes for reported problems
      
         - vmci bugfix
      
         - w1 driver bugfixes for reported problems
      
        Almost all of these have been in linux-next with no reported problems,
        the rest have all passed 0-day bot testing in my tree and on the
        mailing lists where they have sat too long due to me taking a long
        time to catch up on my pending patch queue"
      
      * tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        VMCI: Use threaded irqs instead of tasklets
        misc: fastrpc: Pass bitfield into qcom_scm_assign_mem
        gsmi: fix null-deref in gsmi_get_variable
        misc: fastrpc: Fix use-after-free race condition for maps
        misc: fastrpc: Don't remove map on creater_process and device_release
        misc: fastrpc: Fix use-after-free and race in fastrpc_map_find
        misc: fastrpc: fix error code in fastrpc_req_mmap()
        mei: me: add meteor lake point M DID
        mei: bus: fix unlink on bus in error path
        w1: fix WARNING after calling w1_process()
        w1: fix deadloop in __w1_remove_master_device()
        comedi: adv_pci1760: Fix PWM instruction handling
        interconnect: qcom: rpm: Use _optional func for provider clocks
        interconnect: qcom: msm8996: Fix regmap max_register values
        interconnect: qcom: msm8996: Provide UFS clocks to A2NoC
        dt-bindings: interconnect: Add UFS clocks to MSM8996 A2NoC
      f6714402
    • Linus Torvalds's avatar
      Merge tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · c88a3114
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are three small driver and kernel core fixes for 6.2-rc5. They
        include:
      
         - potential gadget fixup in do_prlimit
      
         - device property refcount leak fix
      
         - test_async_probe bugfix for reported problem"
      
      * tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        prlimit: do_prlimit needs to have a speculation check
        driver core: Fix test_async_probe_init saves device in wrong array
        device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
      c88a3114
    • Linus Torvalds's avatar
      Merge tag 'staging-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · bb86d657
      Linus Torvalds authored
      Pull staging driver fix from Greg KH:
       "Here is a single staging driver fix for 6.2-rc5. It resolves a build
        issue reported and Fixed by Arnd in the vc04_services driver. It's
        been in linux-next this week with no reported problems"
      
      * tag 'staging-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vchiq_arm: fix enum vchiq_status return types
      bb86d657
    • Linus Torvalds's avatar
      Merge tag 'tty-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · bd5cc6ee
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are some small tty and serial driver fixes for 6.2-rc5 that
        resolve a number of tiny reported issues and some new device ids. They
        include:
      
         - new device id for the exar serial driver
      
         - speakup tty driver bugfix
      
         - atmel serial driver baudrate fixup
      
         - stm32 serial driver bugfix and then revert as the bugfix broke the
           build. That will come back in a later pull request once it is all
           worked out properly.
      
         - amba-pl011 serial driver rs486 mode bugfix
      
         - qcom_geni serial driver bugfix
      
        Most of these have been in linux-next with no reported problems (well,
        other than the build breakage which generated the revert), the new
        device id passed 0-day testing"
      
      * tag 'tty-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: exar: Add support for Sealevel 7xxxC serial cards
        Revert "serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler"
        tty: serial: qcom_geni: avoid duplicate struct member init
        serial: atmel: fix incorrect baudrate setup
        tty: fix possible null-ptr-defer in spk_ttyio_release
        serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler
        serial: amba-pl011: fix high priority character transmission in rs486 mode
        serial: pch_uart: Pass correct sg to dma_unmap_sg()
        tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer
      bd5cc6ee
    • Linus Torvalds's avatar
      Merge tag 'usb-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · e67da288
      Linus Torvalds authored
      Pull USB / Thunderbolt fixes from Greg KH:
       "Here are a number of small USB and Thunderbolt driver fixes and new
        device id changes for 6.2-rc5. Included in here are:
      
         - thunderbolt bugfixes for reported problems
      
         - new usb-serial driver ids added
      
         - onboard_hub usb driver fixes for much-reported problems
      
         - xhci bugfixes
      
         - typec bugfixes
      
         - ehci-fsl driver module alias fix
      
         - iowarrior header size fix
      
         - usb gadget driver fixes
      
        All of these, except for the iowarrior fix, have been in linux-next
        with no reported issues. The iowarrior fix passed the 0-day testing
        and is a one digit change based on a reported problem in the driver
        (which was written to a spec, not the real device that is now
        available)"
      
      * tag 'usb-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (40 commits)
        USB: misc: iowarrior: fix up header size for USB_DEVICE_ID_CODEMERCS_IOW100
        usb: host: ehci-fsl: Fix module alias
        usb: dwc3: fix extcon dependency
        usb: core: hub: disable autosuspend for TI TUSB8041
        USB: fix misleading usb_set_intfdata() kernel doc
        usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate()
        USB: gadget: Add ID numbers to configfs-gadget driver names
        usb: typec: tcpm: Fix altmode re-registration causes sysfs create fail
        usb: gadget: g_webcam: Send color matching descriptor per frame
        usb: typec: altmodes/displayport: Use proper macro for pin assignment check
        usb: typec: altmodes/displayport: Fix pin assignment calculation
        usb: typec: altmodes/displayport: Add pin assignment helper
        usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
        usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
        usb: misc: onboard_hub: Move 'attach' work to the driver
        usb: misc: onboard_hub: Invert driver registration order
        usb: ucsi: Ensure connector delayed work items are flushed
        usb: musb: fix error return code in omap2430_probe()
        usb: chipidea: core: fix possible constant 0 if use IS_ERR(ci->role_switch)
        xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables
        ...
      e67da288
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.2-3' of... · 83cd5fd0
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Hide LDFLAGS_vmlinux from decompressor Makefiles to fix error
         messages when GNU Make 4.4 is used.
      
       - Fix 'make modules' build error when CONFIG_DEBUG_INFO_BTF_MODULES=y.
      
       - Fix warnings emitted by GNU Make 4.4 in scripts/kconfig/Makefile.
      
       - Support GNU Make 4.4 for scripts/jobserver-exec.
      
       - Show clearer error message when kernel/gen_kheaders.sh fails due to
         missing cpio.
      
      * tag 'kbuild-fixes-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kheaders: explicitly validate existence of cpio command
        scripts: support GNU make 4.4 in jobserver-exec
        kconfig: Update all declared targets
        scripts: rpm: make clear that mkspec script contains 4.13 feature
        init/Kconfig: fix LOCALVERSION_AUTO help text
        kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y
        kbuild: export top-level LDFLAGS_vmlinux only to scripts/Makefile.vmlinux
        init/version-timestamp.c: remove unneeded #include <linux/version.h>
        docs: kbuild: remove mention to dropped $(objtree) feature
      83cd5fd0
    • Linus Torvalds's avatar
      ext4: deal with legacy signed xattr name hash values · f3bbac32
      Linus Torvalds authored
      We potentially have old hashes of the xattr names generated on systems
      with signed 'char' types.  Now that everybody uses '-funsigned-char',
      those hashes will no longer match.
      
      This only happens if you use xattrs names that have the high bit set,
      which probably doesn't happen in practice, but the xfstest generic/454
      shows it.
      
      Instead of adding a new "signed xattr hash filesystem" bit and having to
      deal with all the possible combinations, just calculate the hash both
      ways if the first one fails, and always generate new hashes with the
      proper unsigned char version.
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Link: https://lore.kernel.org/oe-lkp/202212291509.704a11c9-oliver.sang@intel.com
      Link: https://lore.kernel.org/all/CAHk-=whUNjwqZXa-MH9KMmc_CpQpoFKFjAB9ZKHuu=TbsouT4A@mail.gmail.com/
      Exposed-by: 3bc753c0 ("kbuild: treat char as always unsigned")
      Cc: Eric Biggers <ebiggers@kernel.org>
      Cc: Andreas Dilger <adilger@dilger.ca>
      Cc: Theodore Ts'o <tytso@mit.edu>,
      Cc: Jason Donenfeld <Jason@zx2c4.com>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f3bbac32
    • Greg Kroah-Hartman's avatar
      prlimit: do_prlimit needs to have a speculation check · 73979060
      Greg Kroah-Hartman authored
      do_prlimit() adds the user-controlled resource value to a pointer that
      will subsequently be dereferenced.  In order to help prevent this
      codepath from being used as a spectre "gadget" a barrier needs to be
      added after checking the range.
      Reported-by: default avatarJordy Zomer <jordyzomer@google.com>
      Tested-by: default avatarJordy Zomer <jordyzomer@google.com>
      Suggested-by: default avatarLinus Torvalds <torvalds@linuxfoundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      73979060
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · f883675b
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix a potential race condition and always set GPIOs used as interrupt
         source to input in gpio-mxc
      
       - fix a GPIO ACPI-related issue with system suspend on Clevo NL5xRU
      
      * tag 'gpio-fixes-for-v6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
        gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI
        gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
        gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
      f883675b
  5. 20 Jan, 2023 9 commits
    • Linus Torvalds's avatar
      Merge tag '6.2-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 4e31bada
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
      
       - important fix for packet signature calculation error
      
       - three fixes to correct DFS deadlock, and DFS refresh problem
      
       - remove an unused DFS function, and duplicate tcon refresh code
      
       - DFS cache lookup fix
      
       - uninitialized rc fix
      
      * tag '6.2-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: remove unused function
        cifs: do not include page data when checking signature
        cifs: fix return of uninitialized rc in dfs_cache_update_tgthint()
        cifs: handle cache lookup errors different than -ENOENT
        cifs: remove duplicate code in __refresh_tcon()
        cifs: don't take exclusive lock for updating target hints
        cifs: avoid re-lookups in dfs_cache_find()
        cifs: fix potential deadlock in cache_refresh_path()
      4e31bada
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 8440ffcd
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
      
       - Compilation fix for Sunplus sp7021
      
       - Add some missing headers after a cleanup to the Nomadik driver
      
       - Fix pull type and mux routes on Rockchip RK3568
      
      * tag 'pinctrl-v6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: rockchip: fix mux route data for rk3568
        pinctrl: rockchip: fix reading pull type on rk3568
        pinctrl: nomadik: Add missing header(s)
        pinctrl: sp7021: fix unused function warning
      8440ffcd
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 8974efaa
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
      
       - Several hfi1 patches fixing some long standing driver bugs
      
       - Overflow when working with sg lists with elements greater than 4G
      
       - An rxe regression with object numbering after the mrs reach their
         limit
      
       - A theoretical problem with the scatterlist merging code
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        lib/scatterlist: Fix to calculate the last_pg properly
        IB/hfi1: Remove user expected buffer invalidate race
        IB/hfi1: Immediately remove invalid memory from hardware
        IB/hfi1: Fix expected receive setup error exit issues
        IB/hfi1: Reserve user expected TIDs
        IB/hfi1: Reject a zero-length user expected buffer
        RDMA/core: Fix ib block iterator counter overflow
        RDMA/rxe: Prevent faulty rkey generation
        RDMA/rxe: Fix inaccurate constants in rxe_type_info
      8974efaa
    • Jens Axboe's avatar
      io_uring/poll: don't reissue in case of poll race on multishot request · 8caa03f1
      Jens Axboe authored
      A previous commit fixed a poll race that can occur, but it's only
      applicable for multishot requests. For a multishot request, we can safely
      ignore a spurious wakeup, as we never leave the waitqueue to begin with.
      
      A blunt reissue of a multishot armed request can cause us to leak a
      buffer, if they are ring provided. While this seems like a bug in itself,
      it's not really defined behavior to reissue a multishot request directly.
      It's less efficient to do so as well, and not required to rearm anything
      like it is for singleshot poll requests.
      
      Cc: stable@vger.kernel.org
      Fixes: 6e5aedb9 ("io_uring/poll: attempt request issue after racy poll wakeup")
      Reported-and-tested-by: default avatarOlivier Langlois <olivier@trillion01.com>
      Link: https://github.com/axboe/liburing/issues/778Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      8caa03f1
    • Linus Torvalds's avatar
      Merge tag 'block-6.2-2023-01-20' of git://git.kernel.dk/linux · edc00350
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Various little tweaks all over the place:
      
         - NVMe pull request via Christoph:
             - fix controller shutdown regression in nvme-apple (Janne Grunau)
             - fix a polling on timeout regression in nvme-pci (Keith Busch)
      
         - Fix a bug in the read request side request allocation caching
           (Pavel)
      
         - pktcdvd was brought back after we configured a NULL return on bio
           splits, make it consistent with the others (me)
      
         - BFQ refcount fix (Yu)
      
         - Block cgroup policy activation fix (Yu)
      
         - Fix for an md regression introduced in the 6.2 cycle (Adrian)"
      
      * tag 'block-6.2-2023-01-20' of git://git.kernel.dk/linux:
        nvme-pci: fix timeout request state check
        nvme-apple: only reset the controller when RTKit is running
        nvme-apple: reset controller during shutdown
        block: fix hctx checks for batch allocation
        block/rnbd-clt: fix wrong max ID in ida_alloc_max
        blk-cgroup: fix missing pd_online_fn() while activating policy
        pktcdvd: check for NULL returna fter calling bio_split_to_limits()
        block, bfq: switch 'bfqg->ref' to use atomic refcount apis
        md: fix incorrect declaration about claim_rdev in md_import_device
      edc00350
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.2-2023-01-20' of git://git.kernel.dk/linux · 9c38747f
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Fixes for the MSG_RING opcode. Nothing really major:
      
         - Fix an overflow missing serialization around posting CQEs to the
           target ring (me)
      
         - Disable MSG_RING on a ring that isn't enabled yet. There's nothing
           really wrong with allowing it, but 1) it's somewhat odd as nobody
           can receive them yet, and 2) it means that using the right delivery
           mechanism might change. As nobody should be sending CQEs to a ring
           that isn't enabled yet, let's just disable it (Pavel)
      
         - Tweak to when we decide to post remotely or not for MSG_RING
           (Pavel)"
      
      * tag 'io_uring-6.2-2023-01-20' of git://git.kernel.dk/linux:
        io_uring/msg_ring: fix remote queue to disabled ring
        io_uring/msg_ring: fix flagging remote execution
        io_uring/msg_ring: fix missing lock on overflow for IOPOLL
        io_uring/msg_ring: move double lock/unlock helpers higher up
      9c38747f
    • Linus Torvalds's avatar
      Merge tag 'for-6.2-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 26e57507
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - fix potential out-of-bounds access to leaf data when seeking in an
         inline file
      
       - fix potential crash in quota when rescan races with disable
      
       - reimplement super block signature scratching by marking page/folio
         dirty and syncing block device, allow removing write_one_page
      
      * tag 'for-6.2-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix race between quota rescan and disable leading to NULL pointer deref
        btrfs: fix invalid leaf access due to inline extent during lseek
        btrfs: stop using write_one_page in btrfs_scratch_superblock
        btrfs: factor out scratching of one regular super block
      26e57507
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-fixes-6.2-rc5' of... · d9166cb3
      Linus Torvalds authored
      Merge tag 'linux-kselftest-fixes-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest fix from Shuah Khan:
       "Fix an error seen during unconfigured LLVM builds"
      
      * tag 'linux-kselftest-fixes-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        kselftest: Fix error message for unconfigured LLVM builds
      d9166cb3
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · dc181759
      Linus Torvalds authored
      Pull thermal control fix from Rafael Wysocki:
       "Modify __thermal_cooling_device_register() to make it call
        put_device() after invoking device_register() and fix up a few error
        paths calling thermal_cooling_device_destroy_sysfs() unnecessarily
        (Viresh Kumar)"
      
      * tag 'thermal-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: core: call put_device() only after device_register() fails
      dc181759