LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Juri Lelli <juri.lelli@redhat.com>
To: peterz@infradead.org, mingo@redhat.com
Cc: vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, dwagner@suse.de,
	linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it,
	bristot@redhat.com, Juri Lelli <juri.lelli@redhat.com>,
	syzbot+5ac8bac25f95e8b221e7@syzkaller.appspotmail.com
Subject: [PATCH] sched/deadline: Initialize dl_boosted
Date: Wed, 17 Jun 2020 09:29:19 +0200
Message-ID: <20200617072919.818409-1-juri.lelli@redhat.com> (raw)

syzbot reported the following warning:

  WARNING: CPU: 0 PID: 6973 at kernel/sched/deadline.c:593 setup_new_dl_entity /kernel/sched/deadline.c:594 [inline]
  WARNING: CPU: 0 PID: 6973 at kernel/sched/deadline.c:593 enqueue_dl_entity /kernel/sched/deadline.c:1370 [inline]
  WARNING: CPU: 0 PID: 6973 at kernel/sched/deadline.c:593 enqueue_task_dl+0x1c17/0x2ba0 /kernel/sched/deadline.c:1441
  Kernel panic - not syncing: panic_on_warn set ...

  CPU: 0 PID: 6973 Comm: syz-executor366 Not tainted 4.14.133 #28
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
  Call Trace:
   __dump_stack /lib/dump_stack.c:17 [inline]
   dump_stack+0x138/0x19c /lib/dump_stack.c:53
   panic+0x1f2/0x426 /kernel/panic.c:182
   __warn.cold+0x2f/0x36 /kernel/panic.c:546
   report_bug+0x216/0x254 /lib/bug.c:186
   fixup_bug /arch/x86/kernel/traps.c:177 [inline]
   fixup_bug /arch/x86/kernel/traps.c:172 [inline]
   do_error_trap+0x1bb/0x310 /arch/x86/kernel/traps.c:295
   do_invalid_op+0x1b/0x20 /arch/x86/kernel/traps.c:314
   invalid_op+0x1b/0x40 /arch/x86/entry/entry_64.S:960
  RIP: 0010:setup_new_dl_entity /kernel/sched/deadline.c:593 [inline]
  RIP: 0010:enqueue_dl_entity /kernel/sched/deadline.c:1370 [inline]
  RIP: 0010:enqueue_task_dl+0x1c17/0x2ba0 /kernel/sched/deadline.c:1441
  RSP: 0018:ffff888098a3fcd8 EFLAGS: 00010002
  RAX: 0000000000000000 RBX: ffffffff87ab2780 RCX: 1ffff1101041413a
  RDX: 0000000ad48fb497 RSI: ffff8880aee2c518 RDI: ffff8880820a09d0
  RBP: ffff888098a3fd48 R08: ffff8880820a09cc R09: ffff8880820a09c0
  R10: ffff8880820a073c R11: 0000000000000001 R12: ffff8880820a0700
  R13: ffff8880aee2c500 R14: ffff8880820a0978 R15: ffff8880aee2c500
   enqueue_task /kernel/sched/core.c:762 [inline]
   __sched_setscheduler+0xd17/0x2510 /kernel/sched/core.c:4227
   sched_setattr /kernel/sched/core.c:4285 [inline]
   SYSC_sched_setattr /kernel/sched/core.c:4456 [inline]
   SyS_sched_setattr+0x1f8/0x300 /kernel/sched/core.c:4435
   do_syscall_64+0x1e8/0x640 /arch/x86/entry/common.c:292
   entry_SYSCALL_64_after_hwframe+0x42/0xb7
  RIP: 0033:0x446749
  RSP: 002b:00007ff022092db8 EFLAGS: 00000246 ORIG_RAX: 000000000000013a
  RAX: ffffffffffffffda RBX: 00000000006dbc38 RCX: 0000000000446749
  RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000000
  RBP: 00000000006dbc30 R08: 00007ff022093700 R09: 0000000000000000
  R10: 00007ff022093700 R11: 0000000000000246 R12: 00000000006dbc3c
  R13: 00007ffdbf86bf7f R14: 00007ff0220939c0 R15: 0000000000000000

This happens because dl_boosted flag is currently not initialized by
__dl_clear_params() (unlike the other flags) and setup_new_dl_entity()
finds complains about it.

Initialize dl_boosted to 0.

Reported-by: syzbot+5ac8bac25f95e8b221e7@syzkaller.appspotmail.com
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Tested-by: Daniel Wagner <dwagner@suse.de>
---
 kernel/sched/deadline.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 504d2f51b0d6..f63f337c7147 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -2692,6 +2692,7 @@ void __dl_clear_params(struct task_struct *p)
 	dl_se->dl_bw			= 0;
 	dl_se->dl_density		= 0;
 
+	dl_se->dl_boosted		= 0;
 	dl_se->dl_throttled		= 0;
 	dl_se->dl_yielded		= 0;
 	dl_se->dl_non_contending	= 0;
-- 
2.26.2


             reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  7:29 Juri Lelli [this message]
2020-06-17 20:49 ` Daniel Wagner
2020-06-22  7:07   ` Juri Lelli
2020-06-23  7:19 ` [tip: sched/urgent] " tip-bot2 for Juri Lelli
2020-06-23  8:48 ` [tip: sched/urgent] sched/deadline: Initialize ->dl_boosted tip-bot2 for Juri Lelli

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=20200617072919.818409-1-juri.lelli@redhat.com \
    --to=juri.lelli@redhat.com \
    --cc=bristot@redhat.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dwagner@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@santannapisa.it \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=syzbot+5ac8bac25f95e8b221e7@syzkaller.appspotmail.com \
    --cc=vincent.guittot@linaro.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git