Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1589356pxb; Thu, 4 Feb 2021 17:48:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJziE5utG+Ng2e2WGCeWSbvavTtNIcJqoGU3ke6TeuXlRrqCzk9gcMnmSMtdtbYV65qz0agO X-Received: by 2002:a50:bc14:: with SMTP id j20mr1313985edh.381.1612489739285; Thu, 04 Feb 2021 17:48:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612489739; cv=none; d=google.com; s=arc-20160816; b=AsfChEf8Kdf1ploSBDVCLvvJNcAGrjkyC3kqb8ldpnzQfmzp5zlJ8ewe9YJgDPOvm0 jV9EXVcIhqdviHXTYQ5kZnptrcl6eOOXhflaR3gaQ7u0dJIH/Kz6gpUfenNscdw0yr3b NodP8lD5EnQhw9tRH9pgxcjcjRsbD0wBKn0/OqHVhHXiYkuT7vNMG5k7Rz5LYFyNzJeg 592DRAvXy6hztiMYJjTYhOVwKHooWbGFIXifhFfHOxV9Thv5VMvxjftLcfrQCAvMovx/ WD9KE2XyYIB0zu/xeYGb4ZG7/5uuDHdawTYxsNd6TZXtrq1AtEBphwiFIDoVREbEZSWu Z67g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IZXHMkkF5la794RToqIjRZW5Sf0o5ADpzH8P/DUSqM8=; b=R3NyWUm3iD9qh7oZ1meygCECnDV0DjdewLxQhA3hIaAttl3OaWsOE9xNoyS9SFFpW6 YqnNUcgWqvITuT1opu+uaranQFYxs7aeZRjTkz9qPzB67dkkPo+QLEK5oTS9xJ0kWH8j eZNfOF2MhW2KqczXBZO0zZHg/GgNxNui65bETdBj7s7WFwXjEidIZoD1R0S601RSE8t1 pBjzav+YPyk9bwN47Im3yVGCc3JD9MucROOAaiHBpEmTbZ4IVN0mbv6v75i3CHQRyfkp SYsd2HSxaGp6lZ3eNVXHaTcsWC9HKUPsquDK2M+/OoDk3P63CGHcSA2gRt3EMclwJpFp JJOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WPv79kCi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si4456520ejf.66.2021.02.04.17.48.35; Thu, 04 Feb 2021 17:48:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WPv79kCi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240194AbhBDUbc (ORCPT + 99 others); Thu, 4 Feb 2021 15:31:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240052AbhBDU3E (ORCPT ); Thu, 4 Feb 2021 15:29:04 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FEC7C061793 for ; Thu, 4 Feb 2021 12:28:09 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id m12so2359350pjs.4 for ; Thu, 04 Feb 2021 12:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IZXHMkkF5la794RToqIjRZW5Sf0o5ADpzH8P/DUSqM8=; b=WPv79kCio4eGaa+1n6kJbUiCr+03EUTatrYglWJE03qfeFrKHQzZVbBtF49ld+k4ze 7lEEgOI28vEeRahv9M+5hNCWfrIKDpDdagm/LThs/rcnb6mqbDMlpyjeSuswWn5/cjQF 8HEg8Q2Ubdq/QtSINwilr9Xr1IyuglpkxjnlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IZXHMkkF5la794RToqIjRZW5Sf0o5ADpzH8P/DUSqM8=; b=Iksh5UCPHWX/vsQEdslv1cbUdvSp3XkR3xpopAysBASiHvslpu01L3Nuswp5rd5+iv DRT3TZzPOrqW8Nxw7sCf0v200xK4DuIG71vGx6t6aNsRrXZaBK+lHHcU3n7/0w4jT5wp FSngAumjOK4nZ61VRee9gTT5gnicsshlZZDAgOIXiRnOLcLmNkqZx463tHX9Mabcvy/R S3atODIiCiY1cyL7+sjtKZA0oA9c4mfZ8VkwmsIFmwQtRQTV/KjbuGHBl5rhUJLDSPSg RX4IlgaBbZzIyhaXyFQ3vkRuX4utSQnNPigCPw4UmlCpM1P2Btc/ZhZD0laUzDE5JJhM /32Q== X-Gm-Message-State: AOAM531larp2FPa+zYgcFAqGH0+JVtzJ0/fH+t/nbwxvgHpE1B/URtiU iQ74Ye7h6Z7EOEPuqBki7IuCaA== X-Received: by 2002:a17:90b:4d06:: with SMTP id mw6mr708971pjb.24.1612470488976; Thu, 04 Feb 2021 12:28:08 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b26sm6838438pfo.202.2021.02.04.12.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 12:28:08 -0800 (PST) Date: Thu, 4 Feb 2021 12:28:07 -0800 From: Kees Cook To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Peter Collingbourne , Andrew Morton Subject: Re: [PATCH v19 19/25] mm: Re-introduce vm_flags to do_mmap() Message-ID: <202102041228.E6FED55C@keescook> References: <20210203225547.32221-1-yu-cheng.yu@intel.com> <20210203225547.32221-20-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203225547.32221-20-yu-cheng.yu@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 02:55:41PM -0800, Yu-cheng Yu wrote: > There was no more caller passing vm_flags to do_mmap(), and vm_flags was > removed from the function's input by: > > commit 45e55300f114 ("mm: remove unnecessary wrapper function do_mmap_pgoff()"). > > There is a new user now. Shadow stack allocation passes VM_SHSTK to > do_mmap(). Re-introduce vm_flags to do_mmap(), but without the old wrapper > do_mmap_pgoff(). Instead, make all callers of the wrapper pass a zero > vm_flags to do_mmap(). > > Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook -- Kees Cook