Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1622C61DA4 for ; Sat, 11 Feb 2023 20:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229588AbjBKUAT (ORCPT ); Sat, 11 Feb 2023 15:00:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjBKUAQ (ORCPT ); Sat, 11 Feb 2023 15:00:16 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7196016327; Sat, 11 Feb 2023 12:00:14 -0800 (PST) Received: from fpc.. (unknown [46.242.14.200]) by mail.ispras.ru (Postfix) with ESMTPSA id F329840737BC; Sat, 11 Feb 2023 20:00:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru F329840737BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1676145607; bh=9zZWgSw2dv+vNDtDe9Rvl8F7Fv/omJW33B6s3CwSepw=; h=From:To:Cc:Subject:Date:From; b=UV8cC8i/VJR6dOw5qrWQVjrvZobF4sAHOKO77Dx2Olqw71vl+31G7UsLhS1nkWpfW 58CMu34LCak4dnoqrykA+37uVW1/2/CCWuw5liMg7ovorVKf7PD1Qt4rqtzhfgDTa+ TthFD0JyphXqEbDSU4MvCRhHQmYy9m44AKjWDDzw= From: Fedor Pchelkin To: Ian Kent Cc: Fedor Pchelkin , Matthew Wilcox , Andrei Vagin , Takeshi Misawa , autofs@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: [PATCH 0/1] autofs: fix memory leak of waitqueues in autofs_catatonic_mode Date: Sat, 11 Feb 2023 22:59:49 +0300 Message-Id: <20230211195950.452364-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Syzkaller reports the leak [1]. It is reproducible. The following patch fixes the leak. It was proposed by Takeshi Misawa and tested by Syzbot. In other places of the code the waitqueue is freed when its wait_ctr becomes zero (see autofs_wait_release). So I think it is not actually supposed that inside autofs_catatonic_mode wait_ctr cannot be decreased to zero. Please correct me if I'm wrong. Also, looking at the discussion [2] of the '[PATCH] autofs4: use wake_up() instead of wake_up_interruptible', shouldn't wake_up_interruptible() inside autofs_catatonic_mode() be replaced with wake_up()? [1] https://syzkaller.appspot.com/bug?id=a9412f636e2d733130f8def7975897d0b57f6e37 [2] https://www.spinics.net/lists/autofs/msg01875.html