Commit Graph
52667 Commits
Author SHA1 Message Date
Carlos Llamas 00b31fa2fc Merge 8934827db5 ("Merge tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Iaebb984d0a7c2a6fa4677a85b72818a8466a6b2c
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-21 03:08:00 -07:00
Carlos Llamas 3e3c031b19 Merge 433b23a3da ("Merge tag 'dmi-for-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I38932d831ba74c33f9d469f6c720c62d249716c5
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 02:59:55 -07:00
Carlos Llamas 71825a2c93 Merge 43257b2ebd ("Merge tag 'kmalloc_obj-prep-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I9942f47ec7576a831834c5c4a3aa0af4c4b7affe
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 02:59:55 -07:00
Carlos Llamas 2252eb2ae4 Merge 2b7a25df82 ("Merge tag 'mm-nonmm-stable-2026-02-18-19-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I241b7a105a7073507eb26721f075f4dc4ce2c2b8
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 02:59:18 -07:00
Carlos Llamas 8db2d83b3a Merge eeccf287a2 ("Merge tag 'mm-stable-2026-02-18-19-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Ib9acccf464512994b656e43e7de5c53054b6876e
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 02:58:52 -07:00
Carlos Llamas 09656f44f8 Merge 956b9cbd7f ("Merge tag 'kbuild-fixes-7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Iac3830657c4b3bf75c8d8f6f3c2fec245f7babcf
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:11:47 -07:00
Carlos Llamas c46806a412 Merge 1d22968feb ("Merge tag 'v7.0-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Ice16aef36896de4b171a98994d684ab51c07d3ba
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:11:47 -07:00
Carlos Llamas 1aa7173e46 Merge 7b751b01ad ("Merge tag 'io_uring-7.0-20260216' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Ie34ff7c48cecc0af9ae3933751e8a53c71244285
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:09:35 -07:00
Carlos Llamas 5988cc4b82 Merge 2d10a48871 ("Merge tag 'probes-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I2b2b8f067eeb13ea25c9ebea9332562e38d20f4b
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:09:35 -07:00
Carlos Llamas fb5f04713e Merge 8b3c75a39c ("Merge tag 'fbdev-for-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I13c6c1fd941e7ab63bc8422957f0fce727a8e5b1
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:09:35 -07:00
Carlos Llamas 07177c97f0 Merge 1b49e36325 ("Merge tag 'mtd/for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I1f246fccc9008154c82cba658a57a523324c265f
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:09:35 -07:00
Carlos Llamas c7cfe45404 Merge 311aa68319 ("Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I7829ffe08db0c5dd2d949d018e7efff9081b662a
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:09:35 -07:00
Carlos Llamas 4371c3504c Merge 136114e0ab ("Merge tag 'mm-nonmm-stable-2026-02-12-10-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Ib462a9655f62136ae7c00a0773c8f93a456e90f6
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-20 01:09:35 -07:00
Carlos Llamas 7873db654c Merge 4cff5c05e0 ("Merge tag 'mm-stable-2026-02-11-19-22' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to v7.0-rc1

Resolves trivial merge conflicts in:
	mm/cma.c

Cc: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ifb7dc04f3ce279318b9c10525ef81b304201d7ae
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-17 22:51:45 -07:00
Carlos Llamas 137ec41775 Revert "ANDROID: export symbols for zram module"
This reverts commit a3654ae7c1.

It has merge conflicts with upstream patches in v7.0. It can be later
reapplied if needed.

Bug: 421065577
Cc: Richard Chang <richardycc@google.com>
Change-Id: I69cbdf92162a2c2c273331e00531aacd725d0b72
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-17 22:51:45 -07:00
Carlos Llamas 98de91adb1 Revert "ANDROID: arm64/mm: Add command line option to make ZONE_DMA32 empty"
This reverts commit 0706332e2c.

It has a conflict with upstream commit 60b35af0a6 ("arm64: introduce
arch_zone_limits_init()"), and the resolution might not be as trivial as
max_zone_pfns[] is now initialized in arch_zone_limits_init().

Bug: 372371001
Cc: Suren Baghdasaryan <surenb@google.com>
Change-Id: I8a86834557a92b4a56c2c5f2f439884f5381c20e
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-17 22:51:45 -07:00
Carlos Llamas 32a2a14c9d Merge 37a93dd5c4 ("Merge tag 'net-next-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I0943e236f0f85519a56f3433c96c4cf416be3d3e
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-04-10 15:52:03 +00:00
Carlos Llamas e2f7a805a3 Merge 1c2b4a4c2b ("Merge tag 'pci-v7.0-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I7be518d3f6c93477b74325305920acf6425de709
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-28 11:39:00 -07:00
Carlos Llamas fcc7b0beff Merge 61e629596f ("Merge tag 'for-7.0/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I0951467df3dfeace3d6ff733ea197395f9753eca
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-28 11:39:00 -07:00
Carlos Llamas c224f7f85e Merge 41f1a08645 ("Merge tag 'kbuild-7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I4dd8e5970a44391478768fbb388245bd4578ec2c
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-27 12:57:28 -07:00
Carlos Llamas 149df5f1d6 Merge 38ef046544 ("Merge tag 'sched_ext-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I4c82b0a0a1607892280f0e44678d1c32b12fd193
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-26 18:31:37 +00:00
Carlos Llamas 49aa7f8313 Merge 9bdc64892d ("Merge tag 'wq-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I25ba902c78e11fdd4d71ee78dcb166d0e5288db1
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-25 18:10:54 +00:00
Carlos Llamas 62271d70b8 Revert "ANDROID: workqueue: add vendor hook for wq lockup information"
This reverts commit 34f087452f.

It creates merge conflicts with upstream patches in kernel/workqueue.c.
It can be reapplied later if really needed. However, it doesn't seem to
provide anything critical required for android-mainline.

Bug: 169374262
Change-Id: Ib36debcf428924d1f413085ee5f96e1969f33a0b
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-25 18:09:54 +00:00
Carlos Llamas 11e334afe7 Merge be653d2d1f ("Merge tag 'chrome-platform-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Ifca8e49e14ddb6fbcdee41daafddb503234968b0
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-18 17:30:46 +00:00
Carlos Llamas 5eae9676e7 Merge ca8f421ea0 ("Merge tag 'x86_sev_for_v7.0_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I1c80f6be287d9836751eec845416282459c15b0d
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-18 17:21:29 +00:00
Carlos Llamas 736548b8aa Merge 353a7e8a69 ("Merge tag 'timers-core-2026-02-09' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I6ee568196af4f592aba29b2d8f2c3939294f35e6
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-18 17:12:07 +00:00
Carlos Llamas 35601d05ee Merge 36ae1c45b2 ("Merge tag 'sched-core-2026-02-09' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to v7.0-rc1

Resolves merge conflicts in:
	kernel/sched/core.c
	kernel/sched/fair.c

Cc: John Stultz <jstultz@google.com>
Change-Id: I915c75038ec5dc7ef9c7cc6d3e0104ab75f1f0dc
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-18 17:01:45 +00:00
Giuliano Procida 0b0b8fc11e ANDROID: sort vendor hooks and put inside keep-sorted blocks
This aims to reduce the frequency and cost of merge conflicts.

Bug: 493595150
Change-Id: I009d8fb20de99e95d74f544f2052d016aae10462
Signed-off-by: Giuliano Procida <gprocida@google.com>
2026-03-18 08:59:46 -07:00
Greg Kroah-Hartman 77c599ddc7 ANDROID: GKI: fix up exported core symbol names
In commit 0923fd0419 ("Merge tag 'locking-core-2026-02-08' of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip"), lots of
functions have been renamed to help out with testing tools.  So adjust
the exported names that some Android external modules seem to love to
rely on to match the new function names as well, to fix up the build.

What could go wrong with randomly exporting scheduler internals :)

Fixes: 0923fd0419 ("Merge tag 'locking-core-2026-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip")
Change-Id: Ida9c1b5dea3f186ffce550e129f5aa920e7ac74a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2026-03-17 13:20:57 +01:00
Greg Kroah-Hartman fccf51a9d3 Merge 0923fd0419 ("Merge tag 'locking-core-2026-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 7.0-rc1

Resolves merge conflicts in:
	kernel/sched/core.c

Change-Id: I8d8d7cb77d95d8a77e581967025e75f25804a155
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2026-03-17 08:15:21 +01:00
Carlos Llamas 1337287790 Merge 4d84667627 ("Merge tag 'perf-core-2026-02-09' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Idfad2070d52791113ad1669260aa6d738f031ee0
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-13 18:41:45 +00:00
Carlos Llamas 7d433c6177 Revert "ANDROID: Revert "perf/core: Use static_call to optimize perf_guest_info_callbacks""
This reverts commit a82e2e9f9a.

It creates merge conflicts with incoming upstream patches. Plus it is no
longer needed now that HAVE_STATIC_CALL support is in place for arm64.

Bug: 217583980
Cc: Will McVicker <willmcvicker@google.com>
Change-Id: Icfd0afc5d7fe6e9edbd899b8800ac4c53388cc40
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-13 18:39:54 +00:00
Carlos Llamas 98e52325a3 Merge f17b474e36 ("Merge tag 'bpf-next-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: I6de332151af6b4086b8f89981424fe5bf07b7bb1
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-09 12:21:26 -07:00
Carlos Llamas c74558feee Merge a7423e6ea2 ("Merge tag 'modules-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: Ib106358958f04402b076ab6887ad60bebf6deaf0
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-09 12:21:26 -07:00
Carlos Llamas 98ce85c5ff Merge 9f722cb730 ("Merge tag 'alpha-for-v7.0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/lindholm/alpha") into android-mainline
Steps on the way to v7.0-rc1

Change-Id: If91d3838d06ece37cc368563a9ef0f9e014ee407
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-03 23:08:26 +00:00
Carlos Llamas 536420681c Merge 0c00ed308d ("Merge tag 'for-7.0/block-20260206' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux") into android-mainline
Steps on the way to v7.0-rc1

Resolves conflicts in:
	block/blk-crypto-fallback.c
	include/linux/blk-crypto.h

Cc: Eric Biggers <ebiggers@google.com>
Change-Id: I7bf905c163b3d9c6cfac039fafcc3d1ce52deb4a
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2026-03-03 22:48:26 +00:00
Greg Kroah-Hartman d53cc49d2b Merge 591beb0e3a ("Merge tag 'io_uring-bpf-restrictions.4-20260206' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux") into android-mainline
Steps on the way to 7.0-rc1

Change-Id: I3b2b479391f3ce62875b2e908b5d059e7ed078c3
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2026-03-03 22:47:07 +00:00
Greg Kroah-Hartman 2466de4844 Merge 26c9342bb7 ("Merge tag 'pull-filename' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs") into android-mainline
Steps on the way to 7.0-rc1

Change-Id: Iea34c10e25f631cedf4f5b45176348c5160b194c
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2026-03-03 22:47:06 +00:00
Greg Kroah-Hartman 1653876f0e Merge 9e355113f0 ("Merge tag 'vfs-7.0-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs") into android-mainline
Steps on the way to 7.0-rc1

Change-Id: I213f54d806755875208b63d424c03cc8c74de344
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2026-03-03 22:47:04 +00:00
Kees Cook 69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
Linus Torvalds 68010e7b3d Merge tag 'trace-v7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing fixes from Steven Rostedt:

 - Fix possible dereference of uninitialized pointer

   When validating the persistent ring buffer on boot up, if the first
   validation fails, a reference to "head_page" is performed in the
   error path, but it skips over the initialization of that variable.
   Move the initialization before the first validation check.

 - Fix use of event length in validation of persistent ring buffer

   On boot up, the persistent ring buffer is checked to see if it is
   valid by several methods. One being to walk all the events in the
   memory location to make sure they are all valid. The length of the
   event is used to move to the next event. This length is determined by
   the data in the buffer. If that length is corrupted, it could
   possibly make the next event to check located at a bad memory
   location.

   Validate the length field of the event when doing the event walk.

 - Fix function graph on archs that do not support use of ftrace_ops

   When an architecture defines HAVE_DYNAMIC_FTRACE_WITH_ARGS, it means
   that its function graph tracer uses the ftrace_ops of the function
   tracer to call its callbacks. This allows a single registered
   callback to be called directly instead of checking the callback's
   meta data's hash entries against the function being traced.

   For architectures that do not support this feature, it must always
   call the loop function that tests each registered callback (even if
   there's only one). The loop function tests each callback's meta data
   against its hash of functions and will call its callback if the
   function being traced is in its hash map.

   The issue was that there was no check against this and the direct
   function was being called even if the architecture didn't support it.
   This meant that if function tracing was enabled at the same time as a
   callback was registered with the function graph tracer, its callback
   would be called for every function that the function tracer also
   traced, even if the callback's meta data only wanted to be called
   back for a small subset of functions.

   Prevent the direct calling for those architectures that do not
   support it.

 - Fix references to trace_event_file for hist files

   The hist files used event_file_data() to get a reference to the
   associated trace_event_file the histogram was attached to. This would
   return a pointer even if the trace_event_file is about to be freed
   (via RCU). Instead it should use the event_file_file() helper that
   returns NULL if the trace_event_file is marked to be freed so that no
   new references are added to it.

 - Wake up hist poll readers when an event is being freed

   When polling on a hist file, the task is only awoken when a hist
   trigger is triggered. This means that if an event is being freed
   while there's a task waiting on its hist file, it will need to wait
   until the hist trigger occurs to wake it up and allow the freeing to
   happen. Note, the event will not be completely freed until all
   references are removed, and a hist poller keeps a reference. But it
   should still be woken when the event is being freed.

* tag 'trace-v7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tracing: Wake up poll waiters for hist files when removing an event
  tracing: Fix checking of freed trace_event_file for hist files
  fgraph: Do not call handlers direct when not using ftrace_ops
  tracing: ring-buffer: Fix to check event length before using
  ring-buffer: Fix possible dereference of uninitialized pointer
2026-02-20 15:05:26 -08:00
Petr Pavlu 9678e53179 tracing: Wake up poll waiters for hist files when removing an event
The event_hist_poll() function attempts to verify whether an event file is
being removed, but this check may not occur or could be unnecessarily
delayed. This happens because hist_poll_wakeup() is currently invoked only
from event_hist_trigger() when a hist command is triggered. If the event
file is being removed, no associated hist command will be triggered and a
waiter will be woken up only after an unrelated hist command is triggered.

Fix the issue by adding a call to hist_poll_wakeup() in
remove_event_file_dir() after setting the EVENT_FILE_FL_FREED flag. This
ensures that a task polling on a hist file is woken up and receives
EPOLLERR.

Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://patch.msgid.link/20260219162737.314231-3-petr.pavlu@suse.com
Fixes: 1bd13edbbe ("tracing/hist: Add poll(POLLIN) support on hist file")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2026-02-19 15:25:11 -05:00
Petr Pavlu f0a0da1f90 tracing: Fix checking of freed trace_event_file for hist files
The event_hist_open() and event_hist_poll() functions currently retrieve
a trace_event_file pointer from a file struct by invoking
event_file_data(), which simply returns file->f_inode->i_private. The
functions then check if the pointer is NULL to determine whether the event
is still valid. This approach is flawed because i_private is assigned when
an eventfs inode is allocated and remains set throughout its lifetime.
Instead, the code should call event_file_file(), which checks for
EVENT_FILE_FL_FREED. Using the incorrect access function may result in the
code potentially opening a hist file for an event that is being removed or
becoming stuck while polling on this file.

Correct the access method to event_file_file() in both functions.

Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20260219162737.314231-2-petr.pavlu@suse.com
Fixes: 1bd13edbbe ("tracing/hist: Add poll(POLLIN) support on hist file")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2026-02-19 15:23:49 -05:00
Steven Rostedt f4ff9f646a fgraph: Do not call handlers direct when not using ftrace_ops
The function graph tracer was modified to us the ftrace_ops of the
function tracer. This simplified the code as well as allowed more features
of the function graph tracer.

Not all architectures were converted over as it required the
implementation of HAVE_DYNAMIC_FTRACE_WITH_ARGS to implement. For those
architectures, it still did it the old way where the function graph tracer
handle was called by the function tracer trampoline. The handler then had
to check the hash to see if the registered handlers wanted to be called by
that function or not.

In order to speed up the function graph tracer that used ftrace_ops, if
only one callback was registered with function graph, it would call its
function directly via a static call.

Now, if the architecture does not support the use of using ftrace_ops and
still has the ftrace function trampoline calling the function graph
handler, then by doing a direct call it removes the check against the
handler's hash (list of functions it wants callbacks to), and it may call
that handler for functions that the handler did not request calls for.

On 32bit x86, which does not support the ftrace_ops use with function
graph tracer, it shows the issue:

 ~# trace-cmd start -p function -l schedule
 ~# trace-cmd show
 # tracer: function_graph
 #
 # CPU  DURATION                  FUNCTION CALLS
 # |     |   |                     |   |   |   |
  2) * 11898.94 us |  schedule();
  3) # 1783.041 us |  schedule();
  1)               |  schedule() {
  ------------------------------------------
  1)   bash-8369    =>  kworker-7669
  ------------------------------------------
  1)               |        schedule() {
  ------------------------------------------
  1)  kworker-7669  =>   bash-8369
  ------------------------------------------
  1) + 97.004 us   |  }
  1)               |  schedule() {
 [..]

Now by starting the function tracer is another instance:

 ~# trace-cmd start -B foo -p function

This causes the function graph tracer to trace all functions (because the
function trace calls the function graph tracer for each on, and the
function graph trace is doing a direct call):

 ~# trace-cmd show
 # tracer: function_graph
 #
 # CPU  DURATION                  FUNCTION CALLS
 # |     |   |                     |   |   |   |
  1)   1.669 us    |          } /* preempt_count_sub */
  1) + 10.443 us   |        } /* _raw_spin_unlock_irqrestore */
  1)               |        tick_program_event() {
  1)               |          clockevents_program_event() {
  1)   1.044 us    |            ktime_get();
  1)   6.481 us    |            lapic_next_event();
  1) + 10.114 us   |          }
  1) + 11.790 us   |        }
  1) ! 181.223 us  |      } /* hrtimer_interrupt */
  1) ! 184.624 us  |    } /* __sysvec_apic_timer_interrupt */
  1)               |    irq_exit_rcu() {
  1)   0.678 us    |      preempt_count_sub();

When it should still only be tracing the schedule() function.

To fix this, add a macro FGRAPH_NO_DIRECT to be set to 0 when the
architecture does not support function graph use of ftrace_ops, and set to
1 otherwise. Then use this macro to know to allow function graph tracer to
call the handlers directly or not.

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://patch.msgid.link/20260218104244.5f14dade@gandalf.local.home
Fixes: cc60ee813b ("function_graph: Use static_call and branch to optimize entry function")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2026-02-19 15:21:22 -05:00
Masami Hiramatsu (Google) 912b0ee248 tracing: ring-buffer: Fix to check event length before using
Check the event length before adding it for accessing next index in
rb_read_data_buffer(). Since this function is used for validating
possibly broken ring buffers, the length of the event could be broken.
In that case, the new event (e + len) can point a wrong address.
To avoid invalid memory access at boot, check whether the length of
each event is in the possible range before using it.

Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fixes: 5f3b6e839f ("ring-buffer: Validate boot range memory events")
Link: https://patch.msgid.link/177123421541.142205.9414352170164678966.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2026-02-19 15:21:12 -05:00
Daniil Dulov f154777940 ring-buffer: Fix possible dereference of uninitialized pointer
There is a pointer head_page in rb_meta_validate_events() which is not
initialized at the beginning of a function. This pointer can be dereferenced
if there is a failure during reader page validation. In this case the control
is passed to "invalid" label where the pointer is dereferenced in a loop.

To fix the issue initialize orig_head and head_page before calling
rb_validate_buffer.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://patch.msgid.link/20260213100130.2013839-1-d.dulov@aladdin.ru
Closes: https://lore.kernel.org/r/202406130130.JtTGRf7W-lkp@intel.com/
Fixes: 5f3b6e839f ("ring-buffer: Validate boot range memory events")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2026-02-19 15:20:41 -05:00
Linus Torvalds 4f13d0dabc Merge tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Pull bpf fixes from Alexei Starovoitov:

 - Fix invalid write loop logic in libbpf's bpf_linker__add_buf() (Amery
   Hung)

 - Fix a potential use-after-free of BTF object (Anton Protopopov)

 - Add feature detection to libbpf and avoid moving arena global
   variables on older kernels (Emil Tsalapatis)

 - Remove extern declaration of bpf_stream_vprintk() from libbpf headers
   (Ihor Solodrai)

 - Fix truncated netlink dumps in bpftool (Jakub Kicinski)

 - Fix map_kptr grace period wait in bpf selftests (Kumar Kartikeya
   Dwivedi)

 - Remove hexdump dependency while building bpf selftests (Matthieu
   Baerts)

 - Complete fsession support in BPF trampolines on riscv (Menglong Dong)

* tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
  selftests/bpf: Remove hexdump dependency
  libbpf: Remove extern declaration of bpf_stream_vprintk()
  selftests/bpf: Use vmlinux.h in test_xdp_meta
  bpftool: Fix truncated netlink dumps
  libbpf: Delay feature gate check until object prepare time
  libbpf: Do not use PROG_TYPE_TRACEPOINT program for feature gating
  bpf: Add a map/btf from a fd array more consistently
  selftests/bpf: Fix map_kptr grace period wait
  selftests/bpf: enable fsession_test on riscv64
  selftests/bpf: Adjust selftest due to function rename
  bpf, riscv: add fsession support for trampolines
  bpf: Fix a potential use-after-free of BTF object
  bpf, riscv: introduce emit_store_stack_imm64() for trampoline
  libbpf: Fix invalid write loop logic in bpf_linker__add_buf()
  libbpf: Add gating for arena globals relocation feature
2026-02-19 10:36:54 -08:00
Linus Torvalds 2b7a25df82 Merge tag 'mm-nonmm-stable-2026-02-18-19-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull more non-MM updates from Andrew Morton:

 - "two fixes in kho_populate()" fixes a couple of not-major issues in
   the kexec handover code (Ran Xiaokai)

 - misc singletons

* tag 'mm-nonmm-stable-2026-02-18-19-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  lib/group_cpus: handle const qualifier from clusters allocation type
  kho: remove unnecessary WARN_ON(err) in kho_populate()
  kho: fix missing early_memunmap() call in kho_populate()
  scripts/gdb: implement x86_page_ops in mm.py
  objpool: fix the overestimation of object pooling metadata size
  selftests/memfd: use IPC semaphore instead of SIGSTOP/SIGCONT
  delayacct: fix build regression on accounting tool
2026-02-18 21:40:16 -08:00
Linus Torvalds eeccf287a2 Merge tag 'mm-stable-2026-02-18-19-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull more MM  updates from Andrew Morton:

 - "mm/vmscan: fix demotion targets checks in reclaim/demotion" fixes a
   couple of issues in the demotion code - pages were failed demotion
   and were finding themselves demoted into disallowed nodes (Bing Jiao)

 - "Remove XA_ZERO from error recovery of dup_mmap()" fixes a rare
   mapledtree race and performs a number of cleanups (Liam Howlett)

 - "mm: add bitmap VMA flag helpers and convert all mmap_prepare to use
   them" implements a lot of cleanups following on from the conversion
   of the VMA flags into a bitmap (Lorenzo Stoakes)

 - "support batch checking of references and unmapping for large folios"
   implements batching to greatly improve the performance of reclaiming
   clean file-backed large folios (Baolin Wang)

 - "selftests/mm: add memory failure selftests" does as claimed (Miaohe
   Lin)

* tag 'mm-stable-2026-02-18-19-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (36 commits)
  mm/page_alloc: clear page->private in free_pages_prepare()
  selftests/mm: add memory failure dirty pagecache test
  selftests/mm: add memory failure clean pagecache test
  selftests/mm: add memory failure anonymous page test
  mm: rmap: support batched unmapping for file large folios
  arm64: mm: implement the architecture-specific clear_flush_young_ptes()
  arm64: mm: support batch clearing of the young flag for large folios
  arm64: mm: factor out the address and ptep alignment into a new helper
  mm: rmap: support batched checks of the references for large folios
  tools/testing/vma: add VMA userland tests for VMA flag functions
  tools/testing/vma: separate out vma_internal.h into logical headers
  tools/testing/vma: separate VMA userland tests into separate files
  mm: make vm_area_desc utilise vma_flags_t only
  mm: update all remaining mmap_prepare users to use vma_flags_t
  mm: update shmem_[kernel]_file_*() functions to use vma_flags_t
  mm: update secretmem to use VMA flags on mmap_prepare
  mm: update hugetlbfs to use VMA flags on mmap_prepare
  mm: add basic VMA flag operation helper functions
  tools: bitmap: add missing bitmap_[subset(), andnot()]
  mm: add mk_vma_flags() bitmap flag macro helper
  ...
2026-02-18 20:50:32 -08:00
Linus Torvalds 23b0f90ba8 Merge tag 'sysctl-7.00-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl
Pull sysctl updates from Joel Granados:

 - Remove macros from proc handler converters

   Replace the proc converter macros with "regular" functions. Though it
   is more verbose than the macro version, it helps when debugging and
   better aligns with coding-style.rst.

 - General cleanup

   Remove superfluous ctl_table forward declarations. Const qualify the
   memory_allocation_profiling_sysctl and loadpin_sysctl_table arrays.
   Add missing kernel doc to proc_dointvec_conv.

 - Testing

   This series was run through sysctl selftests/kunit test suite in
   x86_64. And went into linux-next after rc4, giving it a good 3 weeks
   of testing

* tag 'sysctl-7.00-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl:
  sysctl: replace SYSCTL_INT_CONV_CUSTOM macro with functions
  sysctl: Replace unidirectional INT converter macros with functions
  sysctl: Add kernel doc to proc_douintvec_conv
  sysctl: Replace UINT converter macros with functions
  sysctl: Add CONFIG_PROC_SYSCTL guards for converter macros
  sysctl: clarify proc_douintvec_minmax doc
  sysctl: Return -ENOSYS from proc_douintvec_conv when CONFIG_PROC_SYSCTL=n
  sysctl: Remove unused ctl_table forward declarations
  loadpin: Implement custom proc_handler for enforce
  alloc_tag: move memory_allocation_profiling_sysctls into .rodata
  sysctl: Add missing kernel-doc for proc_dointvec_conv
2026-02-18 10:45:36 -08:00