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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45C3CC4363D for ; Tue, 22 Sep 2020 15:28:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A69FE214F1 for ; Tue, 22 Sep 2020 15:28:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dsVJEjKg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A69FE214F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 31DE290006A; Tue, 22 Sep 2020 11:28:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A5F690000F; Tue, 22 Sep 2020 11:28:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16E2190006A; Tue, 22 Sep 2020 11:28:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0172.hostedemail.com [216.40.44.172]) by kanga.kvack.org (Postfix) with ESMTP id EEA8990000F for ; Tue, 22 Sep 2020 11:28:43 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AFAA11F0A for ; Tue, 22 Sep 2020 15:28:43 +0000 (UTC) X-FDA: 77291079726.21.light99_5b001082714e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 84157180442C3 for ; Tue, 22 Sep 2020 15:28:43 +0000 (UTC) X-HE-Tag: light99_5b001082714e X-Filterd-Recvd-Size: 3801 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Sep 2020 15:28:43 +0000 (UTC) Received: by mail-qt1-f178.google.com with SMTP id b2so15837614qtp.8 for ; Tue, 22 Sep 2020 08:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=8NYRqLobOM6b+kBSxOYWfflUIqGeq3KC+5C8x4nakAk=; b=dsVJEjKgY9ssRPdWySITlgVvVNVdcH/lCAV6MliOIpCScQ/+fnR2F8LhEUjK/bCU4o e4PR2+/666nrrhCodPAAbRaq+ESkNP1uTrbfI5cbfhNBJZXmF/n1CYlt65e/Ai993uCJ dl3ay+ArhB65VVsEpdq2M9tZg1INUNLcK5z3NQdcEKnCHEg7ejgPXh92IIgIMmJxF2hM c/dWWa7U60bKrTg2ubpPDnBRUpHgUrWEnX6I77qmuwYXftmAwn2n6wiJBXwN6EY5nQZO v0kbrjDADP2uL/ch1Uv4v3PfKktsLmuBVYOiIZQLZVTZONN0+Ou5fgFjhFJnc5fuKWAu cQaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8NYRqLobOM6b+kBSxOYWfflUIqGeq3KC+5C8x4nakAk=; b=luc2ApA58Z85KX6ztFBy8E5BLVv/5EUBpEB+5wibAMoVUOWPl4Dx989U7vcjIuD5Jw Pzib0SmZb1/synV7c7fW816JaHisj2h8ey2In8yA3/r6ClxRb6DTWBrI7IzttKfLiG+G zhIU+i711uUG6EADSw/8z59hBbec2B48srPe6gBmz/xPhpFx8GPMiX47ROqQByWlakOq MfTnxdzdLKJ84deCrRuOSeXEeR+igZjC4g4+EYg7Z5FXHRHqpL/OxX7/LjdyBPVksZO8 6zDIn1Irrj9rEkQE1sE+xfdOab6wFcG5vYwnOkL9gtzi0ZJwdbIoAYbHL5zPWyakUVNx h0AA== X-Gm-Message-State: AOAM533ta5AQ0Ea3FN9W6TXnaPKRIgzrKG90TCPSvHiZ/RDCPl7Aq6af oHRE/uMireVgeWxuxoe0YlpJQC6/Yvn0XSwqCtOK4V2Gg1Yh6g== X-Google-Smtp-Source: ABdhPJxya3UeZNMuS01wB2/86gFkdbwD64Cn7pf9yjtztJwkKj2aOKmJ2YOJ6dptFSbVEj4gR2PM6Eg+C77V3uQ/vx8= X-Received: by 2002:ac8:3704:: with SMTP id o4mr4791334qtb.330.1600788521770; Tue, 22 Sep 2020 08:28:41 -0700 (PDT) MIME-Version: 1.0 From: Derrick McKee Date: Tue, 22 Sep 2020 11:28:30 -0400 Message-ID: Subject: Mapping two KVAs to the same address To: Linux Memory Management List , Andrew Morton Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000051, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, I am trying to make a research prototype that compartmentalizes kernel modules. Part of my design involves embedding an ID number in a kernel address, which I extract when I need to check for proper pointer access. I've modified the module loader to place the module in an address that contains the ID. However, when the kernel invokes one of the kernel API functions the module implements (e.g., inet6_create), I'd also like any pointer input arguments to also have the ID embedded. Instead of doing a deep copy of objects to an address that I allocate, my thought is that I find a page aligned address that contains my ID, and have that address map to the same page as the input pointer uses. I then can use the new address as input to the API function. Is this possible, and if so, how? I have tried using __get_vm_area_caller() to get a free address in a location I want, and then map_kernel_range() to tie the input pointer page to the new address. This results in a segfault in mte_sync_tags() (called by vmap_pte_range()). I also tried __vmalloc_node_range() along with map_kernel_range(), but this triggers the warning on mm/vmalloc.c:211. Any insight is appreciated, thanks! I sent this email last week, and I apologize for the spam, but I didn't receive any feedback, and I fear it may have been lost in the flood of patches. -- Derrick McKee Phone: (703) 957-9362 Email: derrick.mckee@gmail.com