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 38ABCC38147 for ; Wed, 18 Jan 2023 13:10:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 99C786B0071; Wed, 18 Jan 2023 08:10:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 94D096B0072; Wed, 18 Jan 2023 08:10:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EE706B0074; Wed, 18 Jan 2023 08:10:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6BDBC6B0071 for ; Wed, 18 Jan 2023 08:10:15 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 42BF5C01A4 for ; Wed, 18 Jan 2023 13:10:15 +0000 (UTC) X-FDA: 80367953190.17.F1EF927 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by imf13.hostedemail.com (Postfix) with ESMTP id 1B7332000E for ; Wed, 18 Jan 2023 13:10:04 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=aculab.com; spf=pass (imf13.hostedemail.com: domain of david.laight@aculab.com designates 185.58.85.151 as permitted sender) smtp.mailfrom=david.laight@aculab.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674047408; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2fYL+5oKn/BLY9TzQF1qgfJNaafvXUomh5A1eSZyWY8=; b=BYpLjCCCTMltm/2AIl9EcWSME0JLJrKsjEWiXHCFa24l/uinXmCvU4EdCl3bYVGidcuWXm 2e8BQXAft9l8mr7t6qtST3vRYcoVgPT9KI030G39YSBG9qmkRz3mtzslqYRUOLaYYm+otE ZyEaMvLr4Nn3AMlVw0h1ApNk7VP4MCg= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=aculab.com; spf=pass (imf13.hostedemail.com: domain of david.laight@aculab.com designates 185.58.85.151 as permitted sender) smtp.mailfrom=david.laight@aculab.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674047408; a=rsa-sha256; cv=none; b=DdfWgk0MS0JxMHEDwYRjcI4xbP6tJ+PzRunMll60l0nQMwjV3xJJaFaUrdIYLoAELsotlW R6bCZ44Fh4qdre5XIxAYVJDvlWoyi4yQ2TtfrBBZ/2sKdd+70ai2yCZ6l7VKBrQ0EwC191 NaYnU+ieBs9Q46fy5JkiAaNGWK/xebE= Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-196-D91O4sklP1ukofntLRLNnQ-1; Wed, 18 Jan 2023 13:09:43 +0000 X-MC-Unique: D91O4sklP1ukofntLRLNnQ-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 18 Jan 2023 13:09:39 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.044; Wed, 18 Jan 2023 13:09:39 +0000 From: David Laight To: 'Michal Hocko' , Jann Horn CC: "michel@lespinasse.org" , "joelaf@google.com" , "songliubraving@fb.com" , "leewalsh@google.com" , "david@redhat.com" , "peterz@infradead.org" , "bigeasy@linutronix.de" , "peterx@redhat.com" , "dhowells@redhat.com" , "linux-mm@kvack.org" , "edumazet@google.com" , "jglisse@google.com" , "punit.agrawal@bytedance.com" , Will Deacon , "arjunroy@google.com" , "dave@stgolabs.net" , "minchan@google.com" , "x86@kernel.org" , "hughd@google.com" , "willy@infradead.org" , "gurua@google.com" , "laurent.dufour@fr.ibm.com" , Ingo Molnar , "linux-arm-kernel@lists.infradead.org" , "rientjes@google.com" , "axelrasmussen@google.com" , "kernel-team@android.com" , "soheil@google.com" , "paulmck@kernel.org" , "liam.howlett@oracle.com" , "shakeelb@google.com" , "luto@kernel.org" , "gthelen@google.com" , "ldufour@linux.ibm.com" , Suren Baghdasaryan , "vbabka@suse.cz" , "posk@google.com" , "lstoakes@gmail.com" , "peterjung1337@gmail.com" , "linuxppc-dev@lists.ozlabs.org" , "kent.overstreet@linux.dev" , "hughlynch@google.com" , "linux-kernel@vger.kernel.org" , "hannes@cm pxchg.org" , "akpm@linux-foundation.org" , "tatashin@google.com" , "mgorman@techsingularity.net" Subject: RE: [PATCH 12/41] mm: add per-VMA lock and helper functions to control it Thread-Topic: [PATCH 12/41] mm: add per-VMA lock and helper functions to control it Thread-Index: AQHZKzh830K0jWE0Ukmpq6Ok7Uauu66kJWqQ Date: Wed, 18 Jan 2023 13:09:39 +0000 Message-ID: <45d1809ae1cf4fb1a4bcaf30590a46f2@AcuMS.aculab.com> References: <20230109205336.3665937-1-surenb@google.com> <20230109205336.3665937-13-surenb@google.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1B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Zmlnsl+7ezwXOHodFpdMnW/8zy4unnkdfkZDMH1BOdGI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000231, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ... > > One thing that might be gnarly here is that I think you might not be > > allowed to use up_read() to fully release ownership of an object - > > from what I remember, I think that up_read() (unlike something like > > spin_unlock()) can access the lock object after it's already been > > acquired by someone else. >=20 > Yes, I think you are right. From a look into the code it seems that > the UAF is quite unlikely as there is a ton of work to be done between > vma_write_lock used to prepare vma for removal and actual removal. > That doesn't make it less of a problem though. All it takes is a hardware interrupt.... Especially if the softint code can also run. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)