From patchwork Fri Nov 4 05:41:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp197122wru; Thu, 3 Nov 2022 23:08:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5yxwDfiVVuVeQsIE+J0ka8EkdHKoxIh7+d01GeOo7oQS0xUb1k8R6LUgTEGYGdKK01oTUn X-Received: by 2002:a17:907:983:b0:77b:6e40:8435 with SMTP id bf3-20020a170907098300b0077b6e408435mr30953606ejc.570.1667542106400; Thu, 03 Nov 2022 23:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667542106; cv=none; d=google.com; s=arc-20160816; b=bF/iZ/ZimbfEtuYRAc+JwJJurMM5Skx3r1RkQ9Qhp3wuya3MzGIY0eXtfwf1SNGNRG bJ/Sd4FnFUEv2lqYqFFi76qM+XPlGkO2hsOUs3HpL4mGGafEYxjiTgGtmwXnizG81caR NA5hLBNO0Hx13L5/76Z8FItYDMr0OQjDkpGZAFUSCfi7faQHNVAamc5EXmvoFN0xd7+C qCEAXM6QAqdnZB4AlkljlydtLjk5rUkd0OP2f3bxIV2Z6EnfkFY0F3y6IveIPYM82Pqt L1GHG2bA4x8Gt5ki4GPfUUNmqDh7mNUgQe+qYpcMEc2Lx/7wG05qU5X7QF2wBKGAYxIt zB5Q== 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=HmeeiItu2rHGDdMEePJIFms0P6sJvSuYpbtIRN0gSMQ=; b=xIng3oSDPmv8FuvCcb55yPnMTOJOn2o6vQCTr/59Man3qwsDWXqHPRRBwut7TsSuJg ANcD1MEx64U/TefjwzfglrJRkXftSdVeJdWdnw7Jb2fULTB1Ul+ofc0+LA2CUYfs7st8 +OEA0rPbzJQhWOQ+F0Aekae5QlYARvDRy4DoMDnjNBYgx3KGETqDgPRCBJ6kCE8Xzg5F xa8yR7/d5IHaK5jscbXcjB3WAYgbMZGzryehQs98yPWRMD2hXSKfrhYHPf+lvDA0Nqt8 CaPwfocyh5bAwv2DIxz7Dy5vZSz/4CWX9NR/NevV5cCkKY72BGh2Gor4iMrjP363jf21 x2kQ== 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 d21-20020a056402517500b00461ea502defsi3105549ede.350.2022.11.03.23.07.56; Thu, 03 Nov 2022 23:08:26 -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 S231803AbiKDFvG (ORCPT + 99 others); Fri, 4 Nov 2022 01:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -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 BBEE827CFA for ; Thu, 3 Nov 2022 22:48:50 -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 AAE7A620B9 for ; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87AC7C43148; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZq-00713u-0D; Fri, 04 Nov 2022 01:49:14 -0400 Message-ID: <20221104054913.901228801@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:04 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Theodore Tso" , "Jason A. Donenfeld" Subject: [RFC][PATCH v3 11/33] random: use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@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?1748544631926682223?= X-GMAIL-MSGID: =?utf-8?q?1748544631926682223?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Theodore Ts'o" Acked-by: 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 69754155300e..943b4b2712a5 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); + timer_shutdown_sync(&stack.timer); destroy_timer_on_stack(&stack.timer); mix_pool_bytes(&stack.entropy, sizeof(stack.entropy)); }