From mboxrd@z Thu Jan 1 00:00:00 1970 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 675F3C433F5 for ; Thu, 13 Jan 2022 03:32:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8D606B0072; Wed, 12 Jan 2022 22:32:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B3C306B0073; Wed, 12 Jan 2022 22:32:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A02956B0074; Wed, 12 Jan 2022 22:32:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay040.a.hostedemail.com [64.99.140.40]) by kanga.kvack.org (Postfix) with ESMTP id 8EBA56B0072 for ; Wed, 12 Jan 2022 22:32:44 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 3A6DA605D6 for ; Thu, 13 Jan 2022 03:32:44 +0000 (UTC) X-FDA: 79023841848.02.2D3FC23 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 4A6E380002 for ; Thu, 13 Jan 2022 03:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YG1ESH6nM4PsW5sYKq0SmThrpwQbKs/L9zhiBvIqtao=; b=XazdFwUSjbLDBGsMkbIMs5fDI+ 3qbf1KYN1ukUyB44y5mPBO/0sAKm0WP5jcUzSZf/5OFfluqfg4Z/YGLSv3Dg3jaPPLRQT78GOJPQH baIuthK1t/nK9yZWkNzi2tI22/xZaH71V5m9hXQF5pzAgY6GDx6y88tQEfkVSAiB2LqHrxzMqFoaH xPORFdSy6zhj+FHSuhZbn3KGpyU2NOcQG5ESo/RIUnecPKfgC4HkmvPPpCwXKr9F+9mFq9998gBYF Vokx+Ac/y9QUJOh//2UKix6YoDsi3KviwL4J6rc3y3gudnUnCxOo5hE2jiDwaet3ACM5BjUVVQ72K UAiAfM9g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7qqs-004c8V-Jt; Thu, 13 Jan 2022 03:32:38 +0000 Date: Thu, 13 Jan 2022 03:32:38 +0000 From: Matthew Wilcox To: Peter Collingbourne Cc: Andrey Konovalov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] mm: use compare-exchange operation to set KASAN page tag Message-ID: References: <20220113031434.464992-1-pcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220113031434.464992-1-pcc@google.com> X-Rspamd-Queue-Id: 4A6E380002 X-Stat-Signature: nf7pn3dqtkyfi77s4ctmfmh3echq1xyr Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=XazdFwUS; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam08 X-HE-Tag: 1642044763-19668 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: On Wed, Jan 12, 2022 at 07:14:34PM -0800, Peter Collingbourne wrote: > It has been reported that the tag setting operation on newly-allocated > pages can cause the page flags to be corrupted when performed > concurrently with other flag updates as a result of the use of > non-atomic operations. Fix the problem by using a compare-exchange > loop to update the tag. I really dislike it that kasan has taken some page flags for its use. I would much prefer it if kasan used some page_ext_flags. It's somewhat slower to access them, and they take up a bit of extra space (unless you already have CONFIG_PAGE_EXTENSION enabled). But page flags are a really scarce resource and kasan has taken 9.