From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Qun-Wei Lin <qun-wei.lin@mediatek.com>,
Andrew Yang <andrew.yang@mediatek.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Casper Li <casper.li@mediatek.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Chinwen Chang <chinwen.chang@mediatek.com>,
Kent Overstreet <kent.overstreet@linux.dev>,
Matthias Brugger <matthias.bgg@gmail.com>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Shakeel Butt <shakeel.butt@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Alva Lan <alvalan9@foxmail.com>
Subject: [PATCH 6.1 03/92] sched/task_stack: fix object_is_on_stack() for KASAN tagged pointers
Date: Wed, 15 Jan 2025 11:36:21 +0100 [thread overview]
Message-ID: <20250115103547.664923193@linuxfoundation.org> (raw)
In-Reply-To: <20250115103547.522503305@linuxfoundation.org>
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qun-Wei Lin <qun-wei.lin@mediatek.com>
commit fd7b4f9f46d46acbc7af3a439bb0d869efdc5c58 upstream.
When CONFIG_KASAN_SW_TAGS and CONFIG_KASAN_STACK are enabled, the
object_is_on_stack() function may produce incorrect results due to the
presence of tags in the obj pointer, while the stack pointer does not have
tags. This discrepancy can lead to incorrect stack object detection and
subsequently trigger warnings if CONFIG_DEBUG_OBJECTS is also enabled.
Example of the warning:
ODEBUG: object 3eff800082ea7bb0 is NOT on stack ffff800082ea0000, but annotated.
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at lib/debugobjects.c:557 __debug_object_init+0x330/0x364
Modules linked in:
CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0-rc5 #4
Hardware name: linux,dummy-virt (DT)
pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __debug_object_init+0x330/0x364
lr : __debug_object_init+0x330/0x364
sp : ffff800082ea7b40
x29: ffff800082ea7b40 x28: 98ff0000c0164518 x27: 98ff0000c0164534
x26: ffff800082d93ec8 x25: 0000000000000001 x24: 1cff0000c00172a0
x23: 0000000000000000 x22: ffff800082d93ed0 x21: ffff800081a24418
x20: 3eff800082ea7bb0 x19: efff800000000000 x18: 0000000000000000
x17: 00000000000000ff x16: 0000000000000047 x15: 206b63617473206e
x14: 0000000000000018 x13: ffff800082ea7780 x12: 0ffff800082ea78e
x11: 0ffff800082ea790 x10: 0ffff800082ea79d x9 : 34d77febe173e800
x8 : 34d77febe173e800 x7 : 0000000000000001 x6 : 0000000000000001
x5 : feff800082ea74b8 x4 : ffff800082870a90 x3 : ffff80008018d3c4
x2 : 0000000000000001 x1 : ffff800082858810 x0 : 0000000000000050
Call trace:
__debug_object_init+0x330/0x364
debug_object_init_on_stack+0x30/0x3c
schedule_hrtimeout_range_clock+0xac/0x26c
schedule_hrtimeout+0x1c/0x30
wait_task_inactive+0x1d4/0x25c
kthread_bind_mask+0x28/0x98
init_rescuer+0x1e8/0x280
workqueue_init+0x1a0/0x3cc
kernel_init_freeable+0x118/0x200
kernel_init+0x28/0x1f0
ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---
ODEBUG: object 3eff800082ea7bb0 is NOT on stack ffff800082ea0000, but annotated.
------------[ cut here ]------------
Link: https://lkml.kernel.org/r/20241113042544.19095-1-qun-wei.lin@mediatek.com
Signed-off-by: Qun-Wei Lin <qun-wei.lin@mediatek.com>
Cc: Andrew Yang <andrew.yang@mediatek.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Casper Li <casper.li@mediatek.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alva Lan <alvalan9@foxmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/sched/task_stack.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/linux/sched/task_stack.h
+++ b/include/linux/sched/task_stack.h
@@ -8,6 +8,7 @@
#include <linux/sched.h>
#include <linux/magic.h>
+#include <linux/kasan.h>
#ifdef CONFIG_THREAD_INFO_IN_TASK
@@ -88,6 +89,7 @@ static inline int object_is_on_stack(con
{
void *stack = task_stack_page(current);
+ obj = kasan_reset_tag(obj);
return (obj >= stack) && (obj < (stack + THREAD_SIZE));
}
next prev parent reply other threads:[~2025-01-15 10:39 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 10:36 [PATCH 6.1 00/92] 6.1.125-rc1 review Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 01/92] ceph: give up on paths longer than PATH_MAX Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 02/92] bpf, sockmap: Fix race between element replace and close() Greg Kroah-Hartman
2025-01-15 10:36 ` Greg Kroah-Hartman [this message]
2025-01-15 10:36 ` [PATCH 6.1 04/92] jbd2: increase IO priority for writing revoke records Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 05/92] jbd2: flush filesystem device before updating tail sequence Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 06/92] dm array: fix releasing a faulty array block twice in dm_array_cursor_end Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 07/92] dm array: fix unreleased btree blocks on closing a faulty array cursor Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 08/92] dm array: fix cursor index when skipping across block boundaries Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 09/92] exfat: fix the infinite loop in exfat_readdir() Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 10/92] exfat: fix the infinite loop in __exfat_free_cluster() Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 11/92] scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 12/92] ASoC: mediatek: disable buffer pre-allocation Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 13/92] ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe() Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 14/92] net: 802: LLC+SNAP OID:PID lookup on start of skb data Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 15/92] tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 16/92] tcp/dccp: allow a connection when sk_max_ack_backlog is zero Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 17/92] net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 18/92] bnxt_en: Fix possible memory leak when hwrm_req_replace fails Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 19/92] cxgb4: Avoid removal of uninserted tid Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 20/92] ice: fix incorrect PHY settings for 100 GB/s Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 21/92] tls: Fix tls_sw_sendmsg error handling Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 22/92] Bluetooth: hci_sync: Fix not setting Random Address when required Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 23/92] tcp: Annotate data-race around sk->sk_mark in tcp_v4_send_reset Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 24/92] netfilter: nf_tables: imbalance in flowtable binding Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 25/92] netfilter: conntrack: clamp maximum hashtable size to INT_MAX Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 26/92] sched: sch_cake: add bounds checks to host bulk flow fairness counts Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 27/92] net/mlx5: Fix variable not being completed when function returns Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 28/92] drm/mediatek: stop selecting foreign drivers Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 29/92] drm/mediatek: Fix YCbCr422 color format issue for DP Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 30/92] drm/mediatek: Fix mode valid issue for dp Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 31/92] drm/mediatek: Add return value check when reading DPCD Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 32/92] ksmbd: fix a missing return value check bug Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 33/92] afs: Fix the maximum cell name length Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 34/92] ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 35/92] cpuidle: riscv-sbi: fix device node release in early exit of for_each_possible_cpu Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 36/92] dm thin: make get_first_thin use rcu-safe list first function Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 37/92] dm-ebs: dont set the flag DM_TARGET_PASSES_INTEGRITY Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 38/92] sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 39/92] sctp: sysctl: rto_min/max: " Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 40/92] sctp: sysctl: auth_enable: " Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 41/92] sctp: sysctl: udp_port: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 42/92] sctp: sysctl: plpmtud_probe_interval: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 43/92] drm/amd/display: Add check for granularity in dml ceil/floor helpers Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 44/92] thermal: of: fix OF node leak in of_thermal_zone_find() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 45/92] riscv: Fix sleeping in invalid context in die() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 46/92] ACPI: resource: Add TongFang GM5HG0A to irq1_edge_low_force_override[] Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 47/92] ACPI: resource: Add Asus Vivobook X1504VAP to irq1_level_low_skip_override[] Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 48/92] drm/amd/display: increase MAX_SURFACES to the value supported by hw Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 49/92] dm-verity FEC: Fix RS FEC repair for roots unaligned to block size (take 2) Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 50/92] bpf: Add MEM_WRITE attribute Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 51/92] bpf: Fix overloading of MEM_UNINITs meaning Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 52/92] USB: serial: option: add MeiG Smart SRM815 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 53/92] USB: serial: option: add Neoway N723-EA support Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 54/92] staging: iio: ad9834: Correct phase range check Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 55/92] staging: iio: ad9832: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 56/92] usb-storage: Add max sectors quirk for Nokia 208 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 57/92] USB: serial: cp210x: add Phoenix Contact UPS Device Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 58/92] usb: dwc3: gadget: fix writing NYET threshold Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 59/92] topology: Keep the cpumask unchanged when printing cpumap Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 60/92] misc: microchip: pci1xxxx: Resolve kernel panic during GPIO IRQ handling Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 61/92] misc: microchip: pci1xxxx: Resolve return code mismatch during GPIO set config Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 62/92] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 63/92] usb: dwc3-am62: Disable autosuspend during remove Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 64/92] USB: usblp: return error when setting unsupported protocol Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 65/92] USB: core: Disable LPM only for non-suspended ports Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 66/92] usb: fix reference leak in usb_new_device() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 67/92] usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 68/92] usb: gadget: f_fs: Remove WARN_ON in functionfs_bind Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 69/92] iio: pressure: zpa2326: fix information leak in triggered buffer Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 70/92] iio: dummy: iio_simply_dummy_buffer: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 71/92] iio: light: vcnl4035: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 72/92] iio: imu: kmx61: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 73/92] iio: adc: ti-ads8688: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 74/92] iio: gyro: fxas21002c: Fix missing data update in trigger handler Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 75/92] iio: adc: ti-ads124s08: Use gpiod_set_value_cansleep() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 76/92] iio: adc: at91: call input_free_device() on allocated iio_dev Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 77/92] iio: inkern: call iio_device_put() only on mapped devices Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 78/92] iio: adc: ad7124: Disable all channels at probe time Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 79/92] io_uring/eventfd: ensure io_eventfd_signal() defers another RCU period Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 80/92] ARM: dts: imxrt1050: Fix clocks for mmc Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 81/92] block, bfq: fix waker_bfqq UAF after bfq_split_bfqq() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 82/92] arm64: dts: rockchip: add hevc power domain clock to rk3328 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 83/92] of: unittest: Add bus address range parsing tests Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 84/92] of/address: Add support for 3 address cell bus Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 85/92] of: address: Fix address translation when address-size is greater than 2 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 86/92] of: address: Remove duplicated functions Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 87/92] of: address: Store number of bus flag cells rather than bool Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 88/92] of: address: Preserve the flags portion on 1:1 dma-ranges mapping Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 89/92] ocfs2: correct return value of ocfs2_local_free_info() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 90/92] ocfs2: fix slab-use-after-free due to dangling pointer dqi_priv Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 91/92] drm: bridge: adv7511: use dev_err_probe in probe function Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 92/92] drm: adv7511: Fix use-after-free in adv7533_attach_dsi() Greg Kroah-Hartman
2025-01-15 12:50 ` [PATCH 6.1 00/92] 6.1.125-rc1 review Pavel Machek
2025-01-15 13:57 ` Pavel Machek
[not found] ` <2025011725-underdog-heftiness-49df@gregkh>
2025-01-17 21:16 ` 6.1.125 build fail was -- " Pavel Machek
2025-01-18 6:37 ` Ron Economos
2025-01-18 7:20 ` Greg Kroah-Hartman
2025-01-18 12:27 ` Ron Economos
2025-01-15 14:09 ` Ron Economos
2025-01-15 15:07 ` Greg Kroah-Hartman
2025-01-15 13:15 ` Mark Brown
2025-01-15 14:13 ` Jon Hunter
2025-01-15 22:14 ` Florian Fainelli
2025-01-15 22:32 ` Shuah Khan
2025-01-16 10:48 ` Naresh Kamboju
2025-01-16 13:59 ` Peter Schneider
2025-01-17 2:25 ` [PATCH 6.1] " Hardik Garg
2025-01-18 15:05 ` [PATCH 6.1 00/92] " Guenter Roeck
2025-01-18 15:34 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250115103547.664923193@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=alvalan9@foxmail.com \
--cc=andrew.yang@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=casper.li@mediatek.com \
--cc=catalin.marinas@arm.com \
--cc=chinwen.chang@mediatek.com \
--cc=kent.overstreet@linux.dev \
--cc=matthias.bgg@gmail.com \
--cc=pasha.tatashin@soleen.com \
--cc=patches@lists.linux.dev \
--cc=qun-wei.lin@mediatek.com \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox