Message ID | 166868211308.4906.2733783319911974339.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp330996wrr; Thu, 17 Nov 2022 02:54:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ctxexGMWc44Pt4MOtC8EpGeIjKudPz0tcldQcB+r6tUlVyOSRzDmwEWAf25DY1jEJNQS6 X-Received: by 2002:a17:902:bf06:b0:17b:d6ad:94c8 with SMTP id bi6-20020a170902bf0600b0017bd6ad94c8mr2148232plb.110.1668682448385; Thu, 17 Nov 2022 02:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668682448; cv=none; d=google.com; s=arc-20160816; b=cG1wNCMff0dgFY34dq8XEe6lUkXCDmcYvx7IMJsBDNex25PrEWXah8TmrArBU/lhQh L1gTMcvZSWDPaNdFv2COjW/OBTL6Rc0phyCXmZeV54gOIKhIhlq/Qyv7RnslRYcWwkKl 0SsQahJlLL9tw0+ygR4b+Z1olhaN/YPLGFYDFO66agzrUE62Jd8dM97KivZOc7ynPJl2 ZOrzLehNZSmj1ayqAts06yXDgLpazh1OqreiP54YNmPPacOIExwnjw9NakRN6ADTQk97 +FzqcaggvlCLFsxCVmWvOpp3vtrocg4vnRiK4cNSj7JUVRCdpO08H74i+qWhwcivuUzc jMow== 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:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=A4IFvxSet/7PW9ySTqnRUqNtH6uQwRwx3Vdr6bt1r3Y=; b=E5hkMyIr327SxGj2644Fk1mf/eW2VBHnbM+Fz++8ty9x3Tc9eDFwZPcZ4BomeOdKU9 uW2x3ZQYtmuidFtKbgoq2GIzwx+VHF4W+Kar2tiGmoly5nqUYyRgJjZZ6iycUt51qiZT Vj9u/QUjoqPIY8aOBZKTwY7uQ6GjHVorBLrB6EqCAwKx8SIPdaUGtTCJPQ4HHjXPm0vh WY27GAJsXODrA6JalEHARkWYxJQxFGxb7mEa1Bm+Q/o6B1+nK4Juwg+ewUuCDG2qhaVF x5ePwOqDIYScYC2HejAS3pCF/o+E0cjwbiU8Xud09QhpPllekSDaLm6PAUeLZtze2H48 xW1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="SxwCtBv/"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a63520d000000b00476898c6c27si667286pgb.524.2022.11.17.02.53.55; Thu, 17 Nov 2022 02:54:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="SxwCtBv/"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234646AbiKQKsp (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Thu, 17 Nov 2022 05:48:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238882AbiKQKsi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 05:48:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 472556451; Thu, 17 Nov 2022 02:48:35 -0800 (PST) Date: Thu, 17 Nov 2022 10:48:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668682114; 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: in-reply-to:in-reply-to:references:references; bh=A4IFvxSet/7PW9ySTqnRUqNtH6uQwRwx3Vdr6bt1r3Y=; b=SxwCtBv/ekx6NQB4zVKghpecvlg27/GyeII9aDCqUQxCG36KKBUFes3vPodD+m8N0hy5b9 PZQGkm6/4qfoHEAz+UPhDAsQBiT9314ed7mt4GgexNpjmcW20URTm5DXNb4yD17rB7d2wS 3HzEyxoc98IxklznjPDypE4JgUZjHyS2BKdLR0QPQglLoF/cz76FfR/UrBPLVzf0//7Bl4 uHHaV8Mr048+JDBG6qC8e86dF61IsJLZiNgynst3IrUkuudKQmnNUj82SV8L6hDcixADbE MyKSHV4J8Xg99k6PhEmHLr3veB48gyaGnFPwrYQnMExKW1qHcluDuULTzlKVrw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668682114; 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: in-reply-to:in-reply-to:references:references; bh=A4IFvxSet/7PW9ySTqnRUqNtH6uQwRwx3Vdr6bt1r3Y=; b=Uc3WIGXZIN+9FKyGH09zopYS0lg2imKGg0GDx1lM9Xu/7NXVZ/m+PjkC2oXyrLPORCdbBq pIfsKk2Lz8jPdGAA== From: tip-bot2 for =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] timerqueue: Use rb_entry_safe() in timerqueue_getnext() Cc: pobrn@protonmail.com, Thomas Gleixner <tglx@linutronix.de>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221114195421.342929-1-pobrn@protonmail.com> References: <20221114195421.342929-1-pobrn@protonmail.com> MIME-Version: 1.0 Message-ID: <166868211308.4906.2733783319911974339.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749740366621759497?= X-GMAIL-MSGID: =?utf-8?q?1749740366621759497?= |
Series |
[tip:,timers/core] timerqueue: Use rb_entry_safe() in timerqueue_getnext()
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Nov. 17, 2022, 10:48 a.m. UTC
The following commit has been merged into the timers/core branch of tip: Commit-ID: 2f117484329b233455ee278f2d9b0a4356835060 Gitweb: https://git.kernel.org/tip/2f117484329b233455ee278f2d9b0a4356835060 Author: Barnabás Pőcze <pobrn@protonmail.com> AuthorDate: Mon, 14 Nov 2022 19:54:23 Committer: Thomas Gleixner <tglx@linutronix.de> CommitterDate: Thu, 17 Nov 2022 11:26:20 +01:00 timerqueue: Use rb_entry_safe() in timerqueue_getnext() When `timerqueue_getnext()` is called on an empty timer queue, it will use `rb_entry()` on a NULL pointer, which is invalid. Fix that by using `rb_entry_safe()` which handles NULL pointers. This has not caused any issues so far because the offset of the `rb_node` member in `timerqueue_node` is 0, so `rb_entry()` is essentially a no-op. Fixes: 511885d7061e ("lib/timerqueue: Rely on rbtree semantics for next timer") Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20221114195421.342929-1-pobrn@protonmail.com --- include/linux/timerqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/timerqueue.h b/include/linux/timerqueue.h index 9388408..adc80e2 100644 --- a/include/linux/timerqueue.h +++ b/include/linux/timerqueue.h @@ -35,7 +35,7 @@ struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head) { struct rb_node *leftmost = rb_first_cached(&head->rb_root); - return rb_entry(leftmost, struct timerqueue_node, node); + return rb_entry_safe(leftmost, struct timerqueue_node, node); } static inline void timerqueue_init(struct timerqueue_node *node)