Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6255127rwb; Mon, 5 Dec 2022 09:44:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6T7mhkzcXHr57plS1KZfpjzheKLbOySaHo02r/FIAz8m1/skjESg+v5rRsz0BzXoWidvbI X-Received: by 2002:a05:6402:290:b0:46b:81d2:e3d0 with SMTP id l16-20020a056402029000b0046b81d2e3d0mr25332746edv.314.1670262298515; Mon, 05 Dec 2022 09:44:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670262298; cv=none; d=google.com; s=arc-20160816; b=mcIN4xNNCaBG1fp9rtzunHvPUovSFiyCmAQDeMvQqRDd7Qy5RMUGdzSoCPlJj2eEz4 c6nJ7fFKVWQlXrerS20+qFW3KQEmfPWLWyYhD4YA3FYvKeRrP+0JdbUpwZiHupDDnVYb YJWbcSSY3r2Qv0ozH71yDjGIQ2poqg8Lh9Rr9+1MYR7J1g0S5YxesKU4lQq9kwpWB2Gm trkdbHwVxVa81ifGIEpOOGDOMMbSALmKL67FSXvv5ArxphtEejx3FUkmfn9lR8jbkSUs +gqHksQfh2g0HalDKuDYZRg2Ay5i26nzUi3CWppmNdgp+ZQgLE94BUsGu2sXMhYKDKLq AYQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4ElxRnkIjBHzAgajGGzltaINjdTXoXoQxedqqUtDsyc=; b=K+wxUzQn9TYrt4fVvYSzBVDLdlxwQKWPwq27M36Aj493ybWI12m2AM5Fr36X/8r0KY 7+WMzS257JIKqceP7Imo7XmfsrC0rLJR66/ihVx65m6q1QZPusb25Zfq/uuqhAlakG8E QM+VT873mN7UGMRJ5r5y1xWdscZbuOuQn4wle5MeOxqq9UCTAZbMssfTSHhdOxjWCwWO xKcnqev6cKuXBvdEdB0+TjospmqVPAsbkr5bwWKuVKlGjorj7qb4vIlQxlHgLY3Cud5N eHZLzoZwGPjZFtpKadLNui3ocguKqcWoeRR2jlBv/YS8g0gEV7erXSK0UsewX9ZdZW36 /+9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=b4iFPk8e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba11-20020a0564021acb00b0046bcc982714si70296edb.481.2022.12.05.09.44.38; Mon, 05 Dec 2022 09:44:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=b4iFPk8e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231958AbiLERae (ORCPT + 81 others); Mon, 5 Dec 2022 12:30:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232240AbiLERaY (ORCPT ); Mon, 5 Dec 2022 12:30:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1762321E25 for ; Mon, 5 Dec 2022 09:30:24 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id A4A936125C for ; Mon, 5 Dec 2022 17:30:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4164FC433C1; Mon, 5 Dec 2022 17:30:22 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="b4iFPk8e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1670261419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4ElxRnkIjBHzAgajGGzltaINjdTXoXoQxedqqUtDsyc=; b=b4iFPk8etq9IanUvVfBSGkntQ1u628JEicMhdNYhLAXe4xoQX9QqOt+w8W+UPp9nMeggkY ik0sKiYjM+5vAAldQUgD65ea0IFl1koO5WOWbrMxOpw00C4D6zPFrfD1iD/Z/zoBDXazxy xc8VLIMrtPAZxy2wAEPQHsPSXs65nbI= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id b44d0242 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 5 Dec 2022 17:30:19 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" , Eric B Munson , "Kirill A . Shutemov" , Vlastimil Babka , Andrew Morton Subject: [PATCH] mm: do not show ?? for VM_LOCKONFAULT pages Date: Mon, 5 Dec 2022 18:30:07 +0100 Message-Id: <20221205173007.580210-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When VM_LOCKONFAULT was added, /proc/PID/smaps wasn't hooked up to it, so looking at /proc/PID/smaps, it shows '??' instead of something intelligable. This can be reached by userspace by simply calling `mlock2(..., MLOCK_ONFAULT);`. Fix this by adding "lf" to denote VM_LOCKONFAULT. Cc: Eric B Munson Cc: Kirill A. Shutemov Cc: Vlastimil Babka Cc: Andrew Morton Fixes: de60f5f10c58 ("mm: introduce VM_LOCKONFAULT") Signed-off-by: Jason A. Donenfeld --- fs/proc/task_mmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 8a74cdcc9af0..60851e96530b 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -667,6 +667,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_RAND_READ)] = "rr", [ilog2(VM_DONTCOPY)] = "dc", [ilog2(VM_DONTEXPAND)] = "de", + [ilog2(VM_LOCKONFAULT)] = "lf", [ilog2(VM_ACCOUNT)] = "ac", [ilog2(VM_NORESERVE)] = "nr", [ilog2(VM_HUGETLB)] = "ht", -- 2.38.1