From patchwork Mon Nov 6 23:34:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13447593 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CE80C4167D for ; Mon, 6 Nov 2023 23:34:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE9FB6B0253; Mon, 6 Nov 2023 18:34:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C992E6B0255; Mon, 6 Nov 2023 18:34:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B60E26B0256; Mon, 6 Nov 2023 18:34:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A40246B0253 for ; Mon, 6 Nov 2023 18:34:13 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 75C7C14054C for ; Mon, 6 Nov 2023 23:34:13 +0000 (UTC) X-FDA: 81429135186.09.258BC7D Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf06.hostedemail.com (Postfix) with ESMTP id D1647180009 for ; Mon, 6 Nov 2023 23:34:11 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Zf599/1W"; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699313652; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=hy62UH3tZAYGfKSbBwcceqFkcDXmAUKxt7vsyZbaKq0=; b=dXtZ4NifGUZfRzHgBh5k6botmzuFi13300Fwrct89eLmxNSX8Wkj5eaneFhCcYwGZfXe5x p9id1EAtCul7A4SZZq5m071fTBOo46QccHc8wKVMnVFc81hvbRdPhBQtwstDNHmWiJnWaW rrV4QYv6IF+GD70090Pb5UIX6Ygpe74= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Zf599/1W"; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699313652; a=rsa-sha256; cv=none; b=vG2lV1Mz73aJOP2wArjvMzyZEICliCtgqn1GlEslGCUsWQaJIUnzKmTlJGoJoGAh+WwLOx JZZCj3VjyhOeDfcp80JkDiRhXhsILUL3neQIsWup+Tvy4/UQpnq5OySBQfAqSY30uoTT8o Dp9I6dym77EaXysUH8cRCrKuXrM2iuU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 4EE0DB81232; Mon, 6 Nov 2023 23:34:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54337C433C7; Mon, 6 Nov 2023 23:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699313649; bh=PbpR9uAMS4z983F6X6mqfiz2aQZYHIrus56jewv3Dm0=; h=From:To:Cc:Subject:Date:From; b=Zf599/1WIA2jNOUN4kR6gOh3lwFhhyDXC4RuryzQnC5JBIIHZIzvtul8AWm0Cj3AP DRTXjtzUf05LqPIg2tLtbNDn5BzCTLwS7WGB8flQ2zX2OBsp6ZNSAIqULowMqed27J CAoHT1Pzg6ONtcJLuS2YPea+Eq/vqqIeh6VIyxxja8Feu0ezVbgdOzCMrXQND5LZAi 0wIqTG5GMQP7N68wqCP3uZlmKxSYyxbWw6k2Ly4LDD7L7AwhLXWDSvSefmSw23Efa7 E8YRMS7WI+nFrqyD4iqio5wDm049e6aoKFO99iOvGpYK1QCT45QIqL0W0i026aHu9C qQ/b2gV0R/fhA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] mm/damon/sysfs: fix unhandled return values Date: Mon, 6 Nov 2023 23:34:05 +0000 Message-Id: <20231106233408.51159-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: D1647180009 X-Rspam-User: X-Stat-Signature: y57e1cyw8itgqjqk1az693h9gyii73ub X-Rspamd-Server: rspam01 X-HE-Tag: 1699313651-752618 X-HE-Meta: U2FsdGVkX19iDKBMyrbR5zjB8K6Go+3yaoyF6KoR8r7iKZGb4gi4bLIGDKo0u2l7ULDTlwd5d+afP/81ajR0J7BD6gxmdq6Ze4w3orEko0Waq0T91aCz+HlfWkxMzCMP85R7wnxiiJyJvdgbwboPf9dS2MZd20PM1JiP4M+ajCxifn3tOZEECUqBsAUEgEbIQwKiRAaC9V9yFzMT/l4LBdcnXX/3ce/WyH6vvqlVx0mxEEYmZFYpzAL/2azhO/L9NpT/lubgnfsFOXO9l0wC17T/X6Mm1VJev45VKMVNe9ohL3Bw2U8uAC2hexsqe9fNN8glZ2AI18iLACAKdXLEuFs6EqpxLidHIpbhpsqyJfFcaFPYsgww9ryVU7spay2md/4In5LimTZHZMyW5J0Skl3hlO4+3ou3W3Cy0cjEU8/yUzIDE0acbRcRbq3xGCg6ioybn0iRsfgRD6Y+MsBTcTfg+Rmu5uAFyWu/j/A4v37m85HUUTdoIVC2WvXFKjoFbCGyRRriHeiqFbPW6GgD4yby+Gz42ZDSPQ83abbPRX5n2bE63MroByU6ZbE3FsR+FEES6IDdNPsjRpaYkQChk5OcPeGLJJZA+6ljWt+Kl6KCdH94mw9P388pgmwBx2/e/oPepQEePemwliR4WqCkFa+fpNwEUbxbsJkjnYh+NtxHTl4CW0ga5gitLfep0sHhRLs+qbaoNx/GgYIrqtKBGS1cTTj+Lx0RAm6MiXudoNuSTsG72IheJAOxrWDP236VKOwcfmIl4M18iJ7zy8Ov44WJyVPC0OxI/r2rmI0riJ30EZCrJh8ENO0NON1Gexl86b6ujCyEM4su2Pp4PjImVqqV3EJY5pwWbxbnrCW3JrlVRge+GSCEd8KijNKBVH+lcKbZJSfHnGmzqx9U9JmrmF3SflsoCi9SAQGBcrS/2hkUbwxaTWhzew51XWqWlF4Rz8Hd0zRCStjTR2NDL6y nHyoUDtp 9qr0jeNKYC15tYbQRi9/xCrSjahbgXEOrch+MjF1Uj1jGOSUoaIg0Uc4jx3xiX+FtUeGRX+PpfqF66mnU2dTL8mGw0/etaaSmZW7PkKmHmGISKxAGFjTNYAmc8inf943x6QMB5BotitfMT3+6J24/86uHASXr0YpBFMcRmpdhg9j7A8a1mgXcExdQVetpSc923UEb X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Some of DAMON sysfs interface code is not handling return values from some functions. As a result, confusing user input handling or NULL-dereference is possible. Check those properly. Please note that these patches are not cleanly applicable on mm-unstable since mm-unstable has dropped the mainline-merged patches and rebased on v6.6, while some DAMON patches that these patches are depend on are merged in the mainline after v6.6. I confirmed these patches can cleanly applied on latest mainline, or mm-stable-2023-11-01-14-33. SeongJae Park (3): mm/damon/sysfs: check error from damon_sysfs_update_target() mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation failure mm/damon/sysfs-schemes: handle tried region directory allocation failure mm/damon/sysfs-schemes.c | 5 +++++ mm/damon/sysfs.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) base-commit: 3496e8e0a1eeabb738105c09e575495fa78914bb