From patchwork Fri Dec 6 19:33:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Xu X-Patchwork-Id: 13897634 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 419B0E77173 for ; Fri, 6 Dec 2024 19:33:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8759F6B029E; Fri, 6 Dec 2024 14:33:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 825998D000B; Fri, 6 Dec 2024 14:33:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67A8B6B029E; Fri, 6 Dec 2024 14:33:15 -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 44D256B02D0 for ; Fri, 6 Dec 2024 14:33:15 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BA2D41A06DC for ; Fri, 6 Dec 2024 19:33:14 +0000 (UTC) X-FDA: 82865531910.19.C8B2DBA Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by imf15.hostedemail.com (Postfix) with ESMTP id 10BB9A0022 for ; Fri, 6 Dec 2024 19:32:54 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=LBJubWPJ; spf=pass (imf15.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.215.170 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733513584; 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:in-reply-to:references:references:dkim-signature; bh=HltmlFi5Mtjm1w1ygcJnz7XyQYUTr+uzffhTeU486Yg=; b=Yg2pppTqdoWzMONLbCXaEa/B129zhE31H1WgJTJtcFBe+F2M3Qqbbi8T+ufZJqA4OdzFtj jirBIva2Yigi/J0KK5N/ZlCze+lh0qZPCHwLUrwez2TCs4o5otiZxKHEqQY6ix5FxHWryC jYCxlPsPyuZQOPx2u6PLFUW9/cbfHJU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733513584; a=rsa-sha256; cv=none; b=ej4M9IpCRlp0jjaci7bohV0MMgQsG0JtEk+VoedKUO/XkAkRB+RiLhJpuIUkzccd2V5Kaq 6y7aAlMsj8qDAXjEnqQ5Kgt787EY45o2rt+IQ/gyOilbDsV5XvFCf0KOZpMCkG87wmLCBW MTvU1fUNu/aKtl5IVd9ctFyWXajlwg4= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=LBJubWPJ; spf=pass (imf15.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.215.170 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7ee36621734so212100a12.3 for ; Fri, 06 Dec 2024 11:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733513591; x=1734118391; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HltmlFi5Mtjm1w1ygcJnz7XyQYUTr+uzffhTeU486Yg=; b=LBJubWPJITA1JxxKyZiFGF8gDrKOfF6XHWvEwASoKS4Crl5LpM53D8r1eufKlQB1PP R2laoYVsXGJzXbXLbRR24H06j+ffzBSvQ9oF+WKb6epLqddvUMp282TWcY3kOwJoZx5O E5weHb4aUnZf+lxvffdMQi04GuXbShwNoSkkE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733513591; x=1734118391; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HltmlFi5Mtjm1w1ygcJnz7XyQYUTr+uzffhTeU486Yg=; b=ppYFrHEwSTd5VVAp27geUTc8e+E1C+plbUZ4Aq0+dZ8jqTelHkRVC01+cZ1LeGLzka 1Jm3s740fz88pVslIniyXo2hUbcTYQJiUpsiQJqdl8Fu6Oe8HX5ZMzp5adjDyxougI6B w+UiyGZOxmuAPCA9rua1RuVh84arLymICJg5wEEBn7BY4R5Umoz8w5xgGgzw2u0D6aEu 6vmJ1/b6cud3aT952FKpr8QrKjvsnQleuAyaGULVTSJ1jtMiLRlio7vOyD9SRzatLch3 ApPt21NhLeGx7m80Lc+50mNMKxp9PtCeRRPbZPQUOTVofG2djx97Ha9apQOgcyoJDaRO R+Iw== X-Forwarded-Encrypted: i=1; AJvYcCVbJ8ZdcaNDif2SfdOWkigFBoXHq5/6enlyM9CHpDpQWba5eZskPXncgZsjI4r+liQTDeL/1udoJw==@kvack.org X-Gm-Message-State: AOJu0Ywqwzrh4K4E/8QziJ+wZZJpRsPoOwcoJRzUWfvkMF0pegzQw9bF FRXDr4dSE4JzN0kXBJGjCNdefWmr4w6NV9Oivohfi4svN8fhKslpqrKwhzWL6g== X-Gm-Gg: ASbGncvQuf4iTSAHQqvdEHGKGOXZI1acOWl0Qiag3rk/HN3u+AxEU+hD1BAE7jDrwWn 3B2Tvy7z/Z1RUg3kxLL/tvKVialMZaIZ1QugLboPLkVc4LtSMhvdlbATeGNHeSnVUnV8bQJywFn KDTbpA4iLqjwvpZfEGb2jl+Gd2oW1KwJeDPx0K5Zs7+YhgO8Elxrno4Ojhj3XsBcVRdNfCGUieg WOo3Asfv+LNG/Pt0Tvrekuis8NBva9Wo9eOd6/Wl+Kke2+LwZUuHLR7Vj4s587zSKk6ZGJn3xbU 1RmjM+xfng0= X-Google-Smtp-Source: AGHT+IFyvwmM7rvSPgBh5Lg1uIbAIveZitsJmrI0lGdli31hAiDag50aHX/3xBKsUCxKFfbxFCRvHA== X-Received: by 2002:a05:6a20:918d:b0:1d8:a203:95a4 with SMTP id adf61e73a8af0-1e1870b9329mr2877161637.5.1733513591343; Fri, 06 Dec 2024 11:33:11 -0800 (PST) Received: from localhost (238.76.127.34.bc.googleusercontent.com. [34.127.76.238]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-7fd156b7964sm2997645a12.18.2024.12.06.11.33.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Dec 2024 11:33:10 -0800 (PST) From: jeffxu@chromium.org To: akpm@linux-foundation.org, vbabka@suse.cz, lorenzo.stoakes@oracle.com, Liam.Howlett@Oracle.com Cc: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, jorgelo@chromium.org, keescook@chromium.org, pedro.falcato@gmail.com, rdunlap@infradead.org, Jeff Xu Subject: [PATCH] mseal: remove can_do_mseal Date: Fri, 6 Dec 2024 19:33:09 +0000 Message-ID: <20241206193309.3026213-1-jeffxu@google.com> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 10BB9A0022 X-Stat-Signature: 4rdmzmwcqorpuqgnza6mcqdeqi7rp44i X-Rspam-User: X-HE-Tag: 1733513574-989712 X-HE-Meta: U2FsdGVkX18G1ISJ2h4yQ45xv29eeHpx29dM3GDuQW9TjOuPjZSvIJdujovKrNH1foVpjoi8cSehRzLQipLLZrGV93ntdxHg7oBJDtJTSDj0RadIlAoutimb713E8V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+Rn3H0yzELWPB9tlxTahTFzyOx4gHo2jyPlUGm7igaCkXPvoWQGdJEC0eLsCqIPnF2Q5GhpE3o5GVwIy4X1RI59YYZFAjHksxpbc8mTkb9MMfvIoLRXKGYLEQW4ZMqqFUJa35EPZT+5ES5G4TWRmSYbBt2nO92w2QhE8JP+3/UeUutu4DGs6m X-Bogosity: Ham, tests=bogofilter, spamicity=0.001649, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Jeff Xu Hi Andrew, Is that possible to squash this change on top of "mseal: move can_do_mseal to mseal.c" on the mm-unstable ? This is the first time I m doing this, because I saw dev did this before, and saying this is the prefered approach. I could also send v2 which is what I usually do. Thanks -Jeff Signed-off-by: Jeff Xu --- mm/mseal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/mseal.c b/mm/mseal.c index e167220a0bf0..08e6f328d9c7 100644 --- a/mm/mseal.c +++ b/mm/mseal.c @@ -225,9 +225,9 @@ int do_mseal(unsigned long start, size_t len_in, unsigned long flags) unsigned long end; struct mm_struct *mm = current->mm; - ret = can_do_mseal(flags); - if (ret) - return ret; + /* Verify flags not set. */ + if (flags) + return -EINVAL; start = untagged_addr(start); if (!PAGE_ALIGNED(start))