)]}'
{
  "commit": "5472d60c129f75282d94ae5ad072ee6dfb7c7246",
  "tree": "557a4afec77e0a8388c84d85713999dade0c056c",
  "parents": [
    "80b7065ec19485943fa00d60f27b447c3f17069c",
    "64cf7d058a005c5c31eb8a0b741f35dc12915d18"
  ],
  "author": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Oct 09 12:18:22 2025 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Oct 09 12:18:22 2025 -0700"
  },
  "message": "Merge tag \u0027trace-v6.18-2\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace\n\nPull tracing clean up and fixes from Steven Rostedt:\n\n - Have osnoise tracer use memdup_user_nul()\n\n   The function osnoise_cpus_write() open codes a kmalloc() and then a\n   copy_from_user() and then adds a nul byte at the end which is the\n   same as simply using memdup_user_nul().\n\n - Fix wakeup and irq tracers when failing to acquire calltime\n\n   When the wakeup and irq tracers use the function graph tracer for\n   tracing function times, it saves a timestamp into the fgraph shadow\n   stack. It is possible that this could fail to be stored. If that\n   happens, it exits the routine early. These functions also disable\n   nesting of the operations by incremeting the data \"disable\" counter.\n   But if the calltime exits out early, it never increments the counter\n   back to what it needs to be.\n\n   Since there\u0027s only a couple of lines of code that does work after\n   acquiring the calltime, instead of exiting out early, reverse the if\n   statement to be true if calltime is acquired, and place the code that\n   is to be done within that if block. The clean up will always be done\n   after that.\n\n - Fix ring_buffer_map() return value on failure of __rb_map_vma()\n\n   If __rb_map_vma() fails in ring_buffer_map(), it does not return an\n   error. This means the caller will be working against a bad vma\n   mapping. Have ring_buffer_map() return an error when __rb_map_vma()\n   fails.\n\n - Fix regression of writing to the trace_marker file\n\n   A bug fix was made to change __copy_from_user_inatomic() to\n   copy_from_user_nofault() in the trace_marker write function. The\n   trace_marker file is used by applications to write into it (usually\n   with a file descriptor opened at the start of the program) to record\n   into the tracing system. It\u0027s usually used in critical sections so\n   the write to trace_marker is highly optimized.\n\n   The reason for copying in an atomic section is that the write\n   reserves space on the ring buffer and then writes directly into it.\n   After it writes, it commits the event. The time between reserve and\n   commit must have preemption disabled.\n\n   The trace marker write does not have any locking nor can it allocate\n   due to the nature of it being a critical path.\n\n   Unfortunately, converting __copy_from_user_inatomic() to\n   copy_from_user_nofault() caused a regression in Android. Now all the\n   writes from its applications trigger the fault that is rejected by\n   the _nofault() version that wasn\u0027t rejected by the _inatomic()\n   version. Instead of getting data, it now just gets a trace buffer\n   filled with:\n\n     tracing_mark_write: \u003cfaulted\u003e\n\n   To fix this, on opening of the trace_marker file, allocate per CPU\n   buffers that can be used by the write call. Then when entering the\n   write call, do the following:\n\n     preempt_disable();\n     cpu \u003d smp_processor_id();\n     buffer \u003d per_cpu_ptr(cpu_buffers, cpu);\n     do {\n \tcnt \u003d nr_context_switches_cpu(cpu);\n \tmigrate_disable();\n \tpreempt_enable();\n \tret \u003d copy_from_user(buffer, ptr, size);\n \tpreempt_disable();\n \tmigrate_enable();\n     } while (!ret \u0026\u0026 cnt !\u003d nr_context_switches_cpu(cpu));\n     if (!ret)\n \tring_buffer_write(buffer);\n     preempt_enable();\n\n   This works similarly to seqcount. As it must enabled preemption to do\n   a copy_from_user() into a per CPU buffer, if it gets preempted, the\n   buffer could be corrupted by another task.\n\n   To handle this, read the number of context switches of the current\n   CPU, disable migration, enable preemption, copy the data from user\n   space, then immediately disable preemption again. If the number of\n   context switches is the same, the buffer is still valid. Otherwise it\n   must be assumed that the buffer may have been corrupted and it needs\n   to try again.\n\n   Now the trace_marker write can get the user data even if it has to\n   fault it in, and still not grab any locks of its own.\n\n* tag \u0027trace-v6.18-2\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:\n  tracing: Have trace_marker use per-cpu data to read user space\n  ring buffer: Propagate __rb_map_vma return value to caller\n  tracing: Fix irqoff tracers on failure of acquiring calltime\n  tracing: Fix wakeup tracers on failure of acquiring calltime\n  tracing/osnoise: Replace kmalloc + copy_from_user with memdup_user_nul\n",
  "tree_diff": []
}
