Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1599910rdb; Tue, 20 Feb 2024 00:47:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUTWiM+FeNcNaNI8gNsZFPCT0YMvoKyxmoWAm+dRKZTSlDW16Eh7B0Cw5ikMg12PFifpn9MrPgPY53itJHnTPlJI58RR2AlUoZWvf8G6w== X-Google-Smtp-Source: AGHT+IH1a7JpJT7RjzaiEAS2sUgDb+9lAvMRhZ8f79jbRezrpURAIZ/rLYhkGMmg9Bg7HF2S00Uu X-Received: by 2002:a05:622a:c4:b0:42d:bfaa:dbb5 with SMTP id p4-20020a05622a00c400b0042dbfaadbb5mr19983593qtw.49.1708418840881; Tue, 20 Feb 2024 00:47:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708418840; cv=pass; d=google.com; s=arc-20160816; b=lD3G/LdKtZ6H48a/GHx3WciG31J51s6vGo9FW9Zs1/BnkHupBGKC69loWXJAxBaHtH lLiBF4Z5tfLQHUf2iuV8wKzDCsafT/QPSyGJgF7V1QdYr1iGdHLS4h77ULHLWQxvyfur EO64M7txMCC3p8c/F0auWbXQknEku6JxND5sWMQwIjS3WPEGpvbMFTUF3R2F1Uysbn2T A0ysuarLmsOzxyKJ1k7jo+buql4H+OePQODJGrwJV3lKLlTwJ+e6QbuSyoizFz1V2ahE uULDmaRmjoSLelQvjbemMAMhzG2ZNzJApqFaggIAyNvRVJ1erX0hsdLSWJlr2xMFJ2Xv Y9CQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JVkNCfnWT84KKDQ5spmKz8wc7S8wpzzHV7fK5fOs1XI=; fh=VbOJGf2d80QPWV7JMw+26i3NC0Ymd45tgbQV6wOkRNo=; b=k8Mnp+qZlNU5LfrrfY4vMZAmGHtPrDHDaMWRdU+3A3lgDuUg2QoPKMfRnzCZixAELp QBa+dyv/OUnOheoDIEtI8Ujuok8t59hR7hUIibN3hKedLEqZ4PN7yVxVWI4BXQonkqwV S72ngpmISfY4QAI014RFG24y28VFU6r6nqZp4/iWSK6d+XGIgtz9+uCQbAuR9Yaxu3Ca kbNp/R1UCuLxg+9G4rDvrhVle4G8558ifEhjaMU/WKWv5w2psBEwe8Nen2QL/u47biPT GVES9Kl4wzVSFMpdOADlTxNBSx0h2RxeGZXbdFkhIdvj7cUU/nq2b3D7AKBVeP8iDVcb WSDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XcBcYY5I; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72596-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72596-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t22-20020ac87616000000b0042dce6d4a7csi7784623qtq.20.2024.02.20.00.47.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:47:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72596-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XcBcYY5I; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72596-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72596-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A6B91C2119A for ; Tue, 20 Feb 2024 08:47:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C47635F492; Tue, 20 Feb 2024 08:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XcBcYY5I" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1C7C2E3E5; Tue, 20 Feb 2024 08:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708418821; cv=none; b=m7zbDyGuUUOK8VlgG4v6tDyq1A8Ebdrzu4fUjVK6bSDdWHJk/FtYZelBMfBTwSIeFjBA1mbR0uLuJsgunD0ut7u32cRyCbvYQk4CWeoCcMT9y7TyJ3Q5kaFQAxSeTFDY054vWCJU8+hF3izpbAPi8YweU8MVQFqJjaozVUntQYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708418821; c=relaxed/simple; bh=GZ+HcFFNIzj0fwynEx3VW22XthB/JF29Bnq/DjlKiCM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DJcZs4n7sIGvTrDyB3knPo4CkM9XIMqkLEDTcRQr7VYa9mTd9a94SjyqaWxutSE2ePo5gRcLOPQTIggTOKnuf9W26htBKL/MXYYINFomYtZYqx9DxMdush3YPQW7zAROOxFgP9knHrq+h5DMgf+4+maghA5NaiVeeMOfuTuj8k8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XcBcYY5I; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2086BC433C7; Tue, 20 Feb 2024 08:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708418820; bh=GZ+HcFFNIzj0fwynEx3VW22XthB/JF29Bnq/DjlKiCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XcBcYY5IgpVk3q4imoW0XKzb7mrMtt9TcenPFnl0dHvFc+JSDIGyIshkMRYvW9ryP HSbgN7UYyJbzpRFj0hytz83QXfN3DWERvWR9B1/I0LHn8VxD+lcr/HrF1B0GdnV9GJ dUEwe2bWRpegbYDqjrLCRls6A/p/VWNE65OoGtc49j1/WJAad3PaVW0ACAeyUTSckJ lwsO4+cU7Ggp6ht3N37JN/OzXvqJEjEu67RVrgofo+6yrDvYI35tW19+uI6GRyhqt/ aJWUTjVcmqB20VE9u6o6VV9KbjS6WEyeNaO37cLjkRFkaU88HrDxSkVvltc1vYRR9L MawQCvi5G96cA== From: Christian Brauner To: netfs@lists.linux.dev, Baokun Li , dhowells@redhat.com Cc: Christian Brauner , jlayton@kernel.org, linux-cachefs@redhat.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH RESEND] cachefiles: fix memory leak in cachefiles_add_cache() Date: Tue, 20 Feb 2024 09:46:28 +0100 Message-ID: <20240220-lasst-hemden-8ab6d7d2e9ee@brauner> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240217081431.796809-1-libaokun1@huawei.com> References: <20240217081431.796809-1-libaokun1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1939; i=brauner@kernel.org; h=from:subject:message-id; bh=GZ+HcFFNIzj0fwynEx3VW22XthB/JF29Bnq/DjlKiCM=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaReSftzfxlfFb/gguUSEwRX+NxMdpaN2+MmY367w4WDf xKfl+n9jlIWBjEuBlkxRRaHdpNwueU8FZuNMjVg5rAygQxh4OIUgIko7GRkuOhnJjtRN+W609ft Z2amV0QXZfxvVEst8RZ8G/f6lmCbOiPDs00/RMO7///JEuPMfFB8t/4Kn3zquytd/AGxd/RfKP7 hBgA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Content-Transfer-Encoding: 8bit On Sat, 17 Feb 2024 16:14:31 +0800, Baokun Li wrote: > The following memory leak was reported after unbinding /dev/cachefiles: > > ================================================================== > unreferenced object 0xffff9b674176e3c0 (size 192): > comm "cachefilesd2", pid 680, jiffies 4294881224 > hex dump (first 32 bytes): > 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace (crc ea38a44b): > [] kmem_cache_alloc+0x2d5/0x370 > [] prepare_creds+0x26/0x2e0 > [] cachefiles_determine_cache_security+0x1f/0x120 > [] cachefiles_add_cache+0x13c/0x3a0 > [] cachefiles_daemon_write+0x146/0x1c0 > [] vfs_write+0xcb/0x520 > [] ksys_write+0x69/0xf0 > [] do_syscall_64+0x72/0x140 > [] entry_SYSCALL_64_after_hwframe+0x6e/0x76 > ================================================================== > > [...] Sorry for the delay, David. --- Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.fixes [1/1] cachefiles: fix memory leak in cachefiles_add_cache() https://git.kernel.org/vfs/vfs/c/e21a2f17566c