mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text
@ 2025-06-17  8:11 syzbot
  2025-06-19  4:31 ` [syzbot] #syz test syzbot
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: syzbot @ 2025-06-17  8:11 UTC (permalink / raw)
  To: kent.overstreet, linux-bcachefs, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    e04c78d86a96 Linux 6.16-rc2
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16fdc90c580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=db26f33438d76de9
dashboard link: https://syzkaller.appspot.com/bug?extid=8eb51728519f6659ef7b
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11fdc90c580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=132995d4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c0f064a5f302/disk-e04c78d8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b71205c143e3/vmlinux-e04c78d8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2abdee22b79e/bzImage-e04c78d8.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/3838d178b843/mount_2.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8eb51728519f6659ef7b@syzkaller.appspotmail.com

    cached_sectors       0
    stripe               0
    stripe_redundancy    0
    io_time[READ]        1
    io_time[WRITE]       1024
    fragmentation     0
    bp_start          7
  
  incorrectly set at freespace:0:37:0 (free 0, genbits 0 should be 0), fixing
=====================================================
BUG: KMSAN: uninit-value in __bch2_alloc_v4_to_text+0x7a4/0xdf0 fs/bcachefs/alloc_background.c:355
 __bch2_alloc_v4_to_text+0x7a4/0xdf0 fs/bcachefs/alloc_background.c:355
 bch2_alloc_v4_to_text+0x181/0x1f0 fs/bcachefs/alloc_background.c:380
 bch2_val_to_text fs/bcachefs/bkey_methods.c:321 [inline]
 bch2_bkey_val_to_text+0x1e8/0x280 fs/bcachefs/bkey_methods.c:331
 bch2_check_discard_freespace_key+0xe35/0x1a30 fs/bcachefs/alloc_background.c:1436
 try_alloc_bucket fs/bcachefs/alloc_foreground.c:272 [inline]
 bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:420 [inline]
 bch2_bucket_alloc_trans+0x225d/0x3a40 fs/bcachefs/alloc_foreground.c:544
 bch2_bucket_alloc_set_trans+0xebb/0x1c10 fs/bcachefs/alloc_foreground.c:728
 __open_bucket_add_buckets+0x21f8/0x37b0 fs/bcachefs/alloc_foreground.c:925
 open_bucket_add_buckets+0x347/0x580 fs/bcachefs/alloc_foreground.c:957
 bch2_alloc_sectors_start_trans+0x1de1/0x3560 fs/bcachefs/alloc_foreground.c:-1
 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:320 [inline]
 bch2_btree_reserve_get+0x9fd/0x2120 fs/bcachefs/btree_update_interior.c:534
 bch2_btree_update_start+0x2cf3/0x3620 fs/bcachefs/btree_update_interior.c:1289
 bch2_btree_node_rewrite+0x1cd/0x1b50 fs/bcachefs/btree_update_interior.c:2245
 bch2_btree_node_rewrite_key fs/bcachefs/btree_update_interior.c:2311 [inline]
 async_btree_node_rewrite_work+0x6e8/0x10d0 fs/bcachefs/btree_update_interior.c:2368
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3321
 worker_thread+0xedf/0x1590 kernel/workqueue.c:3402
 kthread+0xd5c/0xf00 kernel/kthread.c:464
 ret_from_fork+0x1e0/0x310 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Uninit was created at:
 slab_post_alloc_hook mm/slub.c:4154 [inline]
 slab_alloc_node mm/slub.c:4197 [inline]
 __do_kmalloc_node mm/slub.c:4327 [inline]
 __kmalloc_noprof+0x95f/0x1310 mm/slub.c:4340
 kmalloc_noprof include/linux/slab.h:909 [inline]
 __bkey_cached_alloc fs/bcachefs/btree_key_cache.c:139 [inline]
 bkey_cached_alloc fs/bcachefs/btree_key_cache.c:162 [inline]
 btree_key_cache_create fs/bcachefs/btree_key_cache.c:231 [inline]
 btree_key_cache_fill+0x784/0x4780 fs/bcachefs/btree_key_cache.c:344
 bch2_btree_path_traverse_cached+0x10d7/0x1870 fs/bcachefs/btree_key_cache.c:399
 bch2_btree_path_traverse_one+0x6db/0x4060 fs/bcachefs/btree_iter.c:1179
 bch2_btree_path_traverse fs/bcachefs/btree_iter.h:250 [inline]
 bch2_btree_iter_peek_slot+0xd74/0x3910 fs/bcachefs/btree_iter.c:2781
 __bch2_bkey_get_iter fs/bcachefs/btree_iter.h:632 [inline]
 bch2_bkey_get_iter fs/bcachefs/btree_iter.h:646 [inline]
 bch2_check_discard_freespace_key+0x321/0x1a30 fs/bcachefs/alloc_background.c:1414
 try_alloc_bucket fs/bcachefs/alloc_foreground.c:272 [inline]
 bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:420 [inline]
 bch2_bucket_alloc_trans+0x225d/0x3a40 fs/bcachefs/alloc_foreground.c:544
 bch2_bucket_alloc_set_trans+0xebb/0x1c10 fs/bcachefs/alloc_foreground.c:728
 __open_bucket_add_buckets+0x21f8/0x37b0 fs/bcachefs/alloc_foreground.c:925
 open_bucket_add_buckets+0x347/0x580 fs/bcachefs/alloc_foreground.c:957
 bch2_alloc_sectors_start_trans+0x1de1/0x3560 fs/bcachefs/alloc_foreground.c:-1
 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:320 [inline]
 bch2_btree_reserve_get+0x9fd/0x2120 fs/bcachefs/btree_update_interior.c:534
 bch2_btree_update_start+0x2cf3/0x3620 fs/bcachefs/btree_update_interior.c:1289
 bch2_btree_node_rewrite+0x1cd/0x1b50 fs/bcachefs/btree_update_interior.c:2245
 bch2_btree_node_rewrite_key fs/bcachefs/btree_update_interior.c:2311 [inline]
 async_btree_node_rewrite_work+0x6e8/0x10d0 fs/bcachefs/btree_update_interior.c:2368
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3321
 worker_thread+0xedf/0x1590 kernel/workqueue.c:3402
 kthread+0xd5c/0xf00 kernel/kthread.c:464
 ret_from_fork+0x1e0/0x310 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

CPU: 1 UID: 0 PID: 4181 Comm: kworker/u8:21 Not tainted 6.16.0-rc2-syzkaller #0 PREEMPT(undef) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: btree_node_rewrite async_btree_node_rewrite_work
=====================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
@ 2025-06-19  4:31 ` syzbot
  2025-06-19  7:23 ` syzbot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-19  4:31 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
  2025-06-19  4:31 ` [syzbot] #syz test syzbot
@ 2025-06-19  7:23 ` syzbot
  2025-06-19 11:46 ` syzbot
  2025-07-19 18:35 ` [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text Kent Overstreet
  3 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-19  7:23 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
  2025-06-19  4:31 ` [syzbot] #syz test syzbot
  2025-06-19  7:23 ` syzbot
@ 2025-06-19 11:46 ` syzbot
  2025-07-19 18:35 ` [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text Kent Overstreet
  3 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-19 11:46 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text
  2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
                   ` (2 preceding siblings ...)
  2025-06-19 11:46 ` syzbot
@ 2025-07-19 18:35 ` Kent Overstreet
  3 siblings, 0 replies; 17+ messages in thread
From: Kent Overstreet @ 2025-07-19 18:35 UTC (permalink / raw)
  To: syzbot; +Cc: linux-bcachefs, linux-kernel, syzkaller-bugs

#syz fix: bcachefs: Fix refs to undefined fields in __bch2_alloc_v4_to_text()

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-26 10:41 [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Read in bch2_sb_members_v2_to_text syzbot
                   ` (2 preceding siblings ...)
  2025-06-05 17:18 ` syzbot
@ 2025-06-09 15:31 ` syzbot
  3 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-09 15:31 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-26 10:41 [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Read in bch2_sb_members_v2_to_text syzbot
  2025-06-04 11:31 ` [syzbot] #syz test syzbot
  2025-06-05 15:56 ` syzbot
@ 2025-06-05 17:18 ` syzbot
  2025-06-09 15:31 ` syzbot
  3 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-05 17:18 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-26 10:41 [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Read in bch2_sb_members_v2_to_text syzbot
  2025-06-04 11:31 ` [syzbot] #syz test syzbot
@ 2025-06-05 15:56 ` syzbot
  2025-06-05 17:18 ` syzbot
  2025-06-09 15:31 ` syzbot
  3 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-05 15:56 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-26 10:41 [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Read in bch2_sb_members_v2_to_text syzbot
@ 2025-06-04 11:31 ` syzbot
  2025-06-05 15:56 ` syzbot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-04 11:31 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-05  7:16 [syzbot] [i2c?] KMSAN: uninit-value in __i2c_smbus_xfer syzbot
                   ` (3 preceding siblings ...)
  2025-05-29 11:17 ` syzbot
@ 2025-06-04 11:21 ` syzbot
  4 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-06-04 11:21 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-05  7:16 [syzbot] [i2c?] KMSAN: uninit-value in __i2c_smbus_xfer syzbot
                   ` (2 preceding siblings ...)
  2025-05-29  8:38 ` syzbot
@ 2025-05-29 11:17 ` syzbot
  2025-06-04 11:21 ` syzbot
  4 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-05-29 11:17 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-05  7:16 [syzbot] [i2c?] KMSAN: uninit-value in __i2c_smbus_xfer syzbot
  2025-05-28 10:42 ` [syzbot] #syz test syzbot
  2025-05-28 15:42 ` syzbot
@ 2025-05-29  8:38 ` syzbot
  2025-05-29 11:17 ` syzbot
  2025-06-04 11:21 ` syzbot
  4 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-05-29  8:38 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-05  7:16 [syzbot] [i2c?] KMSAN: uninit-value in __i2c_smbus_xfer syzbot
  2025-05-28 10:42 ` [syzbot] #syz test syzbot
@ 2025-05-28 15:42 ` syzbot
  2025-05-29  8:38 ` syzbot
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-05-28 15:42 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-05-05  7:16 [syzbot] [i2c?] KMSAN: uninit-value in __i2c_smbus_xfer syzbot
@ 2025-05-28 10:42 ` syzbot
  2025-05-28 15:42 ` syzbot
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-05-28 10:42 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: abhinav.ogl@gmail.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-04-08 11:53 [syzbot] [bcachefs?] WARNING in bch2_dev_free syzbot
@ 2025-04-12 18:04 ` syzbot
  0 siblings, 0 replies; 17+ messages in thread
From: syzbot @ 2025-04-12 18:04 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: gshahrouzi@gmail.com

Try to remove device but fails
Reinitialize reference counting for write operations for device
Shut down the filesystem
Make the filesystem read only
	Read-write bit is not set so it skips trying to make the filesystem read-only, implying that the filesystem is already in read-only mode.
Encounter error because write operations are still assigned to a device
When the filesystem is starting up, it tries setting it to set the filesystem to read-only but it’s already set.
When failing to remove a device, it tries giving back write permissions to a device when the filesystem is read-only (not sure if this is nonsensical or not).
Since a device has write permissions, it tries to remove them but fails because the filesystem is in read-only mode.
So the fix here is to prevent it from giving the device write permissions if the filesystem is in read-only mode.

Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
---
 fs/bcachefs/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index b79e80a435e09..788e870bfef6a 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -1757,7 +1757,8 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
 	up_write(&c->state_lock);
 	return 0;
 err:
-	if (ca->mi.state == BCH_MEMBER_STATE_rw &&
+	if (test_bit(BCH_FS_rw, &c->flags) &&
+	    ca->mi.state == BCH_MEMBER_STATE_rw &&
 	    !percpu_ref_is_zero(&ca->io_ref[READ]))
 		__bch2_dev_read_write(c, ca);
 	up_write(&c->state_lock);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-04-04  7:02 [syzbot] [perf?] WARNING in __free_event syzbot
  2025-04-05 17:12 ` [syzbot] #syz test syzbot
@ 2025-04-05 19:32 ` syzbot
  1 sibling, 0 replies; 17+ messages in thread
From: syzbot @ 2025-04-05 19:32 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: gshahrouzi@gmail.com

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0bb21659e252..153ba622cfa0 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -14016,6 +14016,9 @@ inherit_event(struct perf_event *parent_event,
 	if (IS_ERR(child_event))
 		return child_event;
 
+	get_ctx(child_ctx);
+	child_event->ctx = child_ctx;
+
 	pmu_ctx = find_get_pmu_context(child_event->pmu, child_ctx, child_event);
 	if (IS_ERR(pmu_ctx)) {
 		free_event(child_event);
@@ -14037,8 +14040,6 @@ inherit_event(struct perf_event *parent_event,
 		return NULL;
 	}
 
-	get_ctx(child_ctx);
-
 	/*
 	 * Make the child state follow the state of the parent event,
 	 * not its attr.disabled bit.  We hold the parent's mutex,
@@ -14059,7 +14060,6 @@ inherit_event(struct perf_event *parent_event,
 		local64_set(&hwc->period_left, sample_period);
 	}
 
-	child_event->ctx = child_ctx;
 	child_event->overflow_handler = parent_event->overflow_handler;
 	child_event->overflow_handler_context
 		= parent_event->overflow_handler_context;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [syzbot] #syz test
  2025-04-04  7:02 [syzbot] [perf?] WARNING in __free_event syzbot
@ 2025-04-05 17:12 ` syzbot
  2025-04-05 19:32 ` syzbot
  1 sibling, 0 replies; 17+ messages in thread
From: syzbot @ 2025-04-05 17:12 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: #syz test
Author: gshahrouzi@gmail.com

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0bb21659e252..153ba622cfa0 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -14016,6 +14016,9 @@ inherit_event(struct perf_event *parent_event,
        if (IS_ERR(child_event))
                return child_event;

+       get_ctx(child_ctx);
+       child_event->ctx = child_ctx;
+
        pmu_ctx = find_get_pmu_context(child_event->pmu, child_ctx,
child_event);
        if (IS_ERR(pmu_ctx)) {
                free_event(child_event);
@@ -14037,8 +14040,6 @@ inherit_event(struct perf_event *parent_event,
                return NULL;
        }

-       get_ctx(child_ctx);
-
        /*
         * Make the child state follow the state of the parent event,
         * not its attr.disabled bit.  We hold the parent's mutex,
@@ -14059,7 +14060,6 @@ inherit_event(struct perf_event *parent_event,
                local64_set(&hwc->period_left, sample_period);
        }

-       child_event->ctx = child_ctx;
        child_event->overflow_handler = parent_event->overflow_handler;
        child_event->overflow_handler_context
                = parent_event->overflow_handler_context;
-- 
2.43.0

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-07-19 18:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-17  8:11 [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text syzbot
2025-06-19  4:31 ` [syzbot] #syz test syzbot
2025-06-19  7:23 ` syzbot
2025-06-19 11:46 ` syzbot
2025-07-19 18:35 ` [syzbot] [bcachefs?] KMSAN: uninit-value in __bch2_alloc_v4_to_text Kent Overstreet
  -- strict thread matches above, loose matches on Subject: below --
2025-05-26 10:41 [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Read in bch2_sb_members_v2_to_text syzbot
2025-06-04 11:31 ` [syzbot] #syz test syzbot
2025-06-05 15:56 ` syzbot
2025-06-05 17:18 ` syzbot
2025-06-09 15:31 ` syzbot
2025-05-05  7:16 [syzbot] [i2c?] KMSAN: uninit-value in __i2c_smbus_xfer syzbot
2025-05-28 10:42 ` [syzbot] #syz test syzbot
2025-05-28 15:42 ` syzbot
2025-05-29  8:38 ` syzbot
2025-05-29 11:17 ` syzbot
2025-06-04 11:21 ` syzbot
2025-04-08 11:53 [syzbot] [bcachefs?] WARNING in bch2_dev_free syzbot
2025-04-12 18:04 ` [syzbot] #syz test syzbot
2025-04-04  7:02 [syzbot] [perf?] WARNING in __free_event syzbot
2025-04-05 17:12 ` [syzbot] #syz test syzbot
2025-04-05 19:32 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome