From patchwork Mon Oct 31 18:25:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13026262 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 B4B43FA3741 for ; Mon, 31 Oct 2022 18:26:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 621496B0072; Mon, 31 Oct 2022 14:26:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D0FB80007; Mon, 31 Oct 2022 14:26:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BFF66B0075; Mon, 31 Oct 2022 14:26:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3DBE26B0073 for ; Mon, 31 Oct 2022 14:26:08 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D5BB480550 for ; Mon, 31 Oct 2022 18:26:07 +0000 (UTC) X-FDA: 80082073974.29.8D1787E Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf30.hostedemail.com (Postfix) with ESMTP id 4AFDC80039 for ; Mon, 31 Oct 2022 18:26:07 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id 5C16CB819A9; Mon, 31 Oct 2022 18:26:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9C70C433C1; Mon, 31 Oct 2022 18:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667240763; bh=G91I60Ol4QydHlf0mecqvnzRJ7lAwY37ycd5EgIHiNA=; h=From:To:Cc:Subject:Date:From; b=mwkrMkEzxQ2aBJiRdepyeP5t5fLzY4CAtpKfH6JMCnHZ/VQ+dYxFX0iCcFO5gFDix 02rFZKQTxdKHR/Lv8Jlcv2w+ShC0DPpVcYM2H876SKCw/B5ufMRO9bzaAQsd7iIpzP gUJ5v/jTtpxcpsrk8tH598uGrOb2BpzHxGQZafU/J2/QqS3D8D97kVy+K0Lt9b7Nf2 +A3s1Gu6nonRmiA5N7F+dp5FdSau3BRTLg4JaXOLU3PiDRT7bfDa01vdEK+l8oDm5R C8do+DA6t2WbL0Lq3UMSEOopPedqr40+hIGrdo+LpmjTud6HHXLACzH8+00cNo7dMg h14pnuSkhu3rw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] Fix slab-out-of-bounds Write in dbgfs_rm_context_write Date: Mon, 31 Oct 2022 18:25:52 +0000 Message-Id: <20221031182554.7882-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667240767; 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=+WD6t0egEaCHolqiQb8XzLNlJ0ReVVc5A1dbzSzN3pc=; b=0lH+pgN/PeBBgMgBufdeg2Nw54h43yc3Lf3ZhflTieYyFtB2TxZqWqmSD0FZGUVspf4L0l uS+/P8UrIpdaRzWT8EJcDz7ASRqk5Adw9OzpXfc+kcXkUWQPq2jgglGW6qVbofoUGLd/fM Vngl73P8L7iPLbaq1M5N3k5PAurYQvY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mwkrMkEz; spf=pass (imf30.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=1667240767; a=rsa-sha256; cv=none; b=t4CUHyCdarbES6hLRjAOpAd9iW9oOmPItqP8nUuPLO4IuhZ1WZT2rsIcsPRwvAQM3Ppzq/ mzy4D2udXm51kvV4E8gZyObV5ha1Lmj0w1f3Jn0lyJWBTVuwRS/NC/fBuIugIENsihBRyf 8GUK9XduOdEsHADIB9qVQThNyngFuJU= X-Stat-Signature: ygfwaeuhe3txfhy1to7c9noddgt714sa X-Rspamd-Queue-Id: 4AFDC80039 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mwkrMkEz; spf=pass (imf30.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 X-Rspamd-Server: rspam04 X-HE-Tag: 1667240767-909255 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: This patchset is for fixing (patch 1) the syzbot-reported slab-out-of-bounds write in dbgfs_rm_context_write[1], and adding a selftest for the bug (patch 2). [1] https://lore.kernel.org/damon/000000000000ede3ac05ec4abf8e@google.com/ SeongJae Park (2): mm/damon/dbgfs: check if rm_contexts input is for a real context selftests/damon: test non-context inputs to rm_contexts file mm/damon/dbgfs.c | 7 +++++++ tools/testing/selftests/damon/Makefile | 1 + .../damon/debugfs_rm_non_contexts.sh | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100755 tools/testing/selftests/damon/debugfs_rm_non_contexts.sh