From patchwork Wed Oct 18 08:31:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 154754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4644030vqb; Wed, 18 Oct 2023 01:32:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHC0mMp9xlzgxcAPC4JHmUVIa9d5FghyMUbyiXT/q/95J6UELJPAlKdpPEZYrIhvgMmAXZi X-Received: by 2002:a17:90b:4b44:b0:27d:1593:2b08 with SMTP id mi4-20020a17090b4b4400b0027d15932b08mr4885460pjb.0.1697617934071; Wed, 18 Oct 2023 01:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697617934; cv=none; d=google.com; s=arc-20160816; b=NFYuCUKC57l6K91Sf5prAtdjC1Q8ZZfEsGFkJDMnQh1EM2L2qWGKkzD9tH0ne1/KaA 1erql9+AfkqIHYwJ5q1sXvxrqfbPDj6bHFMCakmq+H4CqP+t0XAHQLbnmqM5xTJX2nv3 yvtVse38116+WrC8cGDXLboLb4GeyUJ2QxijnV0JZY0vsp81jvm0JGsBCmFq4lfI6ZEy YpfJPgdlVxicKdbAaAFs97MScszWwPUoCZ71MC75vkwQwTJo4093Bpbijf6tJqrGzcxP 7D1m5bzy+wK1yWAx0+AO2XUcwWz3kj9AhaD6hj2VxNAJrzChDFVFrFfdzmrzzJYdXF6G Jyxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=p1eHh83Sg5uz33qMvHr/Qg2yAhdWF/K7xokZDEP7HJM=; fh=jEVUnp2AcUtu6MIwQXF8py/Jd7vR0PAfH5LK7+0RM4Y=; b=mvMVuNXpxi90pnDfy88syAOk9orRoUeWT37By9SwfkSlC9ttAeGDy6M1QgAROqugP8 N1IR1ZfSi+NOIjfJBVMibwArO+YcziNfwpDbV+zzadmDgKDIWh6H1TClD7BtXMQmi7/Z D/82NZCVmgyUj5HMlaCFPTGukPAggfHw3CWxtW4VD88bWxukUBngWPV9AnWPNxE9AxUD n+83+5M4RaM7fE+Rt7lZhSsTiFDWNpot5dmai9gP+McSqSx3A6jWFWG8JR8W8Nx7S4te e/Kn6+3VABb+jLpt73FzOFXh+BBk+Jtp2FWF7ecH5sfFetwTpqSduhzrOSevkmXjqF5e zO3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qHNxPEK8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i11-20020a17090a718b00b00271a453203esi995441pjk.130.2023.10.18.01.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 01:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qHNxPEK8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 720A680C6D1C; Wed, 18 Oct 2023 01:32:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344654AbjJRIb5 (ORCPT + 24 others); Wed, 18 Oct 2023 04:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344664AbjJRIbx (ORCPT ); Wed, 18 Oct 2023 04:31:53 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC9F7BA; Wed, 18 Oct 2023 01:31:51 -0700 (PDT) Date: Wed, 18 Oct 2023 08:31:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697617910; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1eHh83Sg5uz33qMvHr/Qg2yAhdWF/K7xokZDEP7HJM=; b=qHNxPEK8a8M+NaT/1mAM4eDzdD5BZJvbi9C+kk/yOZ7AsiRw/YWc6A08x75cTMOca8wd6G +SUCKqdkj4LnabgzZqPbLZL1enDiEHLpM+KUQ+kqvK+YLBGAi2/px3VD2pVP5wJph52OuQ mbeEnkNRsWVnQSXUYkTS5cSNmzjdwOgXRg7mvgoLmclx8dvmj/uClFpVEHmvIzXwyBZWqA qFKUZW/dMO7f2cqON6HCIGt+zo84OKs7BQxLqrF9pcyyy2qeDhuCOK8FbtGhLhF5V3uFUy hDHsI89cHmyrVJnl7yWiXQFXvw9V/GicwvLimwzF2Vk8rfnuo4QwPUjKjOAgGQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697617910; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1eHh83Sg5uz33qMvHr/Qg2yAhdWF/K7xokZDEP7HJM=; b=9r7v6E9ExhnkSmMK3sOvJSkBTewahkkGEu8jYR1JubHMLh1LbAj+fTF0WfXJzmh34kVrD7 p0hWgRmxAgp/hgBA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/eevdf: Fix heap corruption more Cc: 0599jiangyc@gmail.com, Dmitry Safonov <0x7f454c46@gmail.com>, "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169761790955.3135.2302450117444631157.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 18 Oct 2023 01:32:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780081422951731588 X-GMAIL-MSGID: 1780081422951731588 The following commit has been merged into the sched/urgent branch of tip: Commit-ID: d2929762cc3f85528b0ca12f6f63c2a714f24778 Gitweb: https://git.kernel.org/tip/d2929762cc3f85528b0ca12f6f63c2a714f24778 Author: Peter Zijlstra AuthorDate: Tue, 17 Oct 2023 16:59:47 +02:00 Committer: Peter Zijlstra CommitterDate: Wed, 18 Oct 2023 10:22:13 +02:00 sched/eevdf: Fix heap corruption more Because someone is a flaming idiot... and forgot we have current as se->on_rq but not actually in the tree itself, and walking rb_parent() on an entry not in the tree is 'funky' and KASAN complains. Fixes: 8dafa9d0eb1a ("sched/eevdf: Fix min_deadline heap integrity") Reported-by: 0599jiangyc@gmail.com Reported-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Peter Zijlstra (Intel) Tested-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=218020 Link: https://lkml.kernel.org/r/CAJwJo6ZGXO07%3DQvW4fgQfbsDzQPs9xj5sAQ1zp%3DmAyPMNbHYww%40mail.gmail.com --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 061a30a..df348aa 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3657,7 +3657,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, */ deadline = div_s64(deadline * old_weight, weight); se->deadline = se->vruntime + deadline; - min_deadline_cb_propagate(&se->run_node, NULL); + if (se != cfs_rq->curr) + min_deadline_cb_propagate(&se->run_node, NULL); } #ifdef CONFIG_SMP