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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 464BEC77B7A for ; Wed, 24 May 2023 20:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236321AbjEXUQM (ORCPT ); Wed, 24 May 2023 16:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbjEXUQG (ORCPT ); Wed, 24 May 2023 16:16:06 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9253110B for ; Wed, 24 May 2023 13:16:01 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-394c7ba4cb5so309155b6e.1 for ; Wed, 24 May 2023 13:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684959361; x=1687551361; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=esoimroWkrL9UG9uMCk43F+mfgKePk35ZCciJnQDAkc=; b=jR0U4eVs+HCQeyO0rmH9Zxj+N0VyaYsQvTzC7psBsfJbGQ6nS5u9eJT0i0j85cIHvk czRu1HV2uwA/KDRFg1j5fn/Dd4R9z5b6aw90ZBdWflA6NG0Z5ske/4njAKixpkB17Kox /Eugws1hC6JcHmeJ6WEozM+6Sl2LdLs6LJ2ns= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684959361; x=1687551361; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=esoimroWkrL9UG9uMCk43F+mfgKePk35ZCciJnQDAkc=; b=Yne4wiTu1vgEQVxkkw/18j0fDp5ynryP7nUhxsaYWs7am4xsqofgq0ijwR3NLldPqc +ZWqSjBNhakkiThMLSicL8PNPhOb9biMYSH1hrzx4XSJpAQ/51K8QQAh0LHnWdxYrQWO IHoVsy142O0Y39LsF4avoQUO2/6U3kCwzOJT+ajkGhbsk2qVRsronTEgQFv9GPWfAaaY b18rWMmCk097YePkEeiSQe7TO+x8hF/FtQOAisr78Igo7KU8TPSN8nr7rLhp13fGk4TE bTA7Yx23UBOI9a9CjvjRl1yNskaB0WwCOZwTRf7TM+Q8mjizMGMRIEmm1R87ozvoOlIS u1cA== X-Gm-Message-State: AC+VfDy9vfDCcGaKGsrQJzR4rmi5WXo6/OPuZM/JrCpI8RbSGynnsTaf QpnfDQe9LKNAFbdYUr5RSM4gEIvMDKRp6dP0BP2+Xw== X-Google-Smtp-Source: ACHHUZ4vEvWyW3CX9DBeFwy4Iuv22tTqCB/I2KaWZyvUNUxdCQPP/KLsw7NzO3Qpm9DIvGHyd/tz++Pg5pVjG53Rskk= X-Received: by 2002:a54:480b:0:b0:398:105b:530b with SMTP id j11-20020a54480b000000b00398105b530bmr5216910oij.33.1684959360986; Wed, 24 May 2023 13:16:00 -0700 (PDT) MIME-Version: 1.0 References: <20230515130553.2311248-1-jeffxu@chromium.org> <2bcffc9f-9244-0362-2da9-ece230055320@intel.com> <2b14036e-aed8-4212-bc0f-51ec4fe5a5c1@intel.com> <9d64c949-6d5f-06c0-47ef-caade67477e5@intel.com> In-Reply-To: <9d64c949-6d5f-06c0-47ef-caade67477e5@intel.com> From: Jeff Xu Date: Wed, 24 May 2023 13:15:50 -0700 Message-ID: Subject: Re: [PATCH 0/6] Memory Mapping (VMA) protection using PKU - set 1 To: Dave Hansen Cc: Jeff Xu , =?UTF-8?Q?Stephen_R=C3=B6ttger?= , luto@kernel.org, jorgelo@chromium.org, keescook@chromium.org, groeck@chromium.org, jannh@google.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for bringing this to my attention. Regarding io_uring: > > io_uring fundamentally doesn't have the same checks. The kernel side > work can be done from an asynchronous kernel thread. That kernel thread > doesn't have a meaningful PKRU value. The register has a value, but > it's not really related to the userspace threads that are sending it > requests. > I asked the question to the io_uring list [1]. io_uring thread will respect PKRU of the user thread, async or not, the behavior is the same as regular syscall. There will be no issue for io_uring, i.e if it decides to add more memory mapping syscalls to supported cmd in future. [1] https://lore.kernel.org/io-uring/CABi2SkUp45HEt7eQ6a47Z7b3LzW=4m3xAakG35os7puCO2dkng@mail.gmail.com/ Thanks. -Jeff