From patchwork Thu Oct 27 15:05:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11828 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286671wru; Thu, 27 Oct 2022 08:11:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5tfTG9HYXUpQ7BwCQXfLcQlo/jsJ9PAGglWcaPepb6MByKrZ5Nd91P+dlmO8kmP+jKHGRY X-Received: by 2002:a17:907:3207:b0:741:3a59:738d with SMTP id xg7-20020a170907320700b007413a59738dmr42323674ejb.110.1666883468043; Thu, 27 Oct 2022 08:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883468; cv=none; d=google.com; s=arc-20160816; b=G7vTsJBG9/PUtoDTdmHRcarz81bCfhdvETWovUUN4YgBpCRAkgofPfwYHR3b3IZNuO QKtvC/acKfGbDN/gM6OVWEwOAE7ueA79AqrK+bJioVYxfnmuDrlol2KkO863XLZCtba7 upIxgtPhdz0CnmDUE/KzWoazA0I5AfOBO9XJDM87RXGuXR4fvyZ+zDnFhhq4efSDD7ac xP/NUKDrkprtlonQ3V9PgSbbj+9eA3B+3YIQG+Gygh/x8Hivk96Aa5XxM7ONu+ZSB1Hz PbW206buinrdmhfYNT1s1VQhD0rEusOimr+xHufXyR50chLrE7SqcrzYxzErHWeqYzGi w5lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=ofddB1JS3YaGH9OvPMa+th+TWwFmMgygM4cd3gm0eCk=; b=lhfOm6YOKLuSH5uuM0yk+mS0L5CRROXFQVz9UlWmraMcI3Z6/DfjgfRTrNdT7R7yhM v1D9Simeo3D1wfmML0c2MHwFHxGcVh8ZlWbuQjwleyTga79jZy2ahNlqHuV4ZH3nOZrR 0noaXbN8iB1jJMux9fl/vGz6fH3J3BFpAZQldpobCtmgay4hAkHeMs0c2JWt2nB3XNmH PAA3AaOToRhrYI7Ug6ijl4Eq/0fZYhwTupe1/pIUyqrvqQ90+8zG0M8oAFu75HVvtlJc A9zaXfA3dkbB+MBrkuov3u2CMTiLTiQJxtkxONahrZgU46UOMTbYXlwDfCVwbFLEe3hk tc8g== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o20-20020a170906975400b00782161b3422si1803179ejy.914.2022.10.27.08.10.43; Thu, 27 Oct 2022 08:11:08 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236362AbiJ0PKF (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236246AbiJ0PJO (ORCPT ); Thu, 27 Oct 2022 11:09:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 368FD18F0F0 for ; Thu, 27 Oct 2022 08:09:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6A4DF6239C for ; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43AB3C433D7; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vb-00BvXh-17; Thu, 27 Oct 2022 11:09:27 -0400 Message-ID: <20221027150927.162027754@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:36 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , "Theodore Tso" , "Jason A. Donenfeld" Subject: [RFC][PATCH v2 11/31] timers: random: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747853999306540367?= X-GMAIL-MSGID: =?utf-8?q?1747853999306540367?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Theodore Ts'o" Cc: "Jason A. Donenfeld" Signed-off-by: Steven Rostedt (Google) --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 2fe28eeb2f38..b774fdefc840 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1233,7 +1233,7 @@ static void __cold try_to_generate_entropy(void) stack.entropy = random_get_entropy(); } - del_timer_sync(&stack.timer); + del_timer_shutdown(&stack.timer); destroy_timer_on_stack(&stack.timer); mix_pool_bytes(&stack.entropy, sizeof(stack.entropy)); }