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=-6.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 7B51AC433E3 for ; Tue, 18 Aug 2020 19:34:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4AFAB206B5 for ; Tue, 18 Aug 2020 19:34:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="l2ujWwd6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbgHRTeZ (ORCPT ); Tue, 18 Aug 2020 15:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbgHRTeX (ORCPT ); Tue, 18 Aug 2020 15:34:23 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1692C061342 for ; Tue, 18 Aug 2020 12:34:23 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id c6so8781pje.1 for ; Tue, 18 Aug 2020 12:34:23 -0700 (PDT) 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=Tc2Y/7wRUGR7GO4HI5D5o1JOg/02jGLqqiMyiLuhQfs=; b=l2ujWwd6BMG71uJ+lE/u8hWi1z2UCA7KAWMpdnE1WzCwTe07wkyg50hoJQMVi/k5vS 10b1jlIwnAAB1jWtkPfeKBvqJMoyZBbScKD9sht7QrmX7W7SSdxi+jcaauUGkGBX0fzB CHA2p5bBmBuY5K3LiVDClVPuHglS30NtSusnM= 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=Tc2Y/7wRUGR7GO4HI5D5o1JOg/02jGLqqiMyiLuhQfs=; b=OViu+BxJGRaEeXOavhK15swwYtoia6DfE2LnNF8/zHvKUQC+5gH+NRjIPoXiTr5ny4 pMyM4R2fW4a3AKzdTq3BFuIsRKCKxhtIsLlFEx7FqkV/csCtXoeO+62RUFWEtDXaKEId Utut6EPd97rY5e+YrtFBMrLxfIWxlOYLfcUTSyB5wFhOnUa632Ifss2iO26pdNzgn6RA wcz3FKjriN7uLWIsOLB9dEwT8o6R03mtLXFwF0PHkIQCCycz8tvQOMo4GS1n3MLN4dMU kGWwLS+khBESju9CYWXU1vVnRwT7e8gxogpl4JFffenKpavXS61pd9ryvRYAnTaJvsUl zyuA== X-Gm-Message-State: AOAM530Po4NkhbMEM6dwsJDcJj6xSYPgbKXDa8PdS/e7/BnNUgNpDLzX BzrxpODwSPRYO/vXxW9OZvHbbA== X-Google-Smtp-Source: ABdhPJyRtGUPEH8hQB3PYbEreefecpWhQ0b3Q4RWm7821VkslhtwepOtRIsUHn68CV2l8iU1xIwP+A== X-Received: by 2002:a17:902:9f8a:: with SMTP id g10mr16598513plq.158.1597779263268; Tue, 18 Aug 2020 12:34:23 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k21sm22549273pgl.0.2020.08.18.12.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 12:34:22 -0700 (PDT) Date: Tue, 18 Aug 2020 12:34:21 -0700 From: Kees Cook To: Christoph Hellwig Cc: Al Viro , Michael Ellerman , x86@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 02/11] fs: don't allow kernel reads and writes without iter ops Message-ID: <202008181234.B1D9572C@keescook> References: <20200817073212.830069-1-hch@lst.de> <20200817073212.830069-3-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200817073212.830069-3-hch@lst.de> Sender: linux-arch-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Mon, Aug 17, 2020 at 09:32:03AM +0200, Christoph Hellwig wrote: > Don't allow calling ->read or ->write with set_fs as a preparation for > killing off set_fs. All the instances that we use kernel_read/write on > are using the iter ops already. > > If a file has both the regular ->read/->write methods and the iter > variants those could have different semantics for messed up enough > drivers. Also fails the kernel access to them in that case. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook 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=-6.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 1E5A7C433E1 for ; Tue, 18 Aug 2020 19:38:39 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC990206B5 for ; Tue, 18 Aug 2020 19:38:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="l2ujWwd6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC990206B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BWLn872yczDqpL for ; Wed, 19 Aug 2020 05:38:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::1043; helo=mail-pj1-x1043.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=l2ujWwd6; dkim-atps=neutral Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BWLhK30KpzDqYd for ; Wed, 19 Aug 2020 05:34:25 +1000 (AEST) Received: by mail-pj1-x1043.google.com with SMTP id e4so10717pjd.0 for ; Tue, 18 Aug 2020 12:34:24 -0700 (PDT) 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=Tc2Y/7wRUGR7GO4HI5D5o1JOg/02jGLqqiMyiLuhQfs=; b=l2ujWwd6BMG71uJ+lE/u8hWi1z2UCA7KAWMpdnE1WzCwTe07wkyg50hoJQMVi/k5vS 10b1jlIwnAAB1jWtkPfeKBvqJMoyZBbScKD9sht7QrmX7W7SSdxi+jcaauUGkGBX0fzB CHA2p5bBmBuY5K3LiVDClVPuHglS30NtSusnM= 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=Tc2Y/7wRUGR7GO4HI5D5o1JOg/02jGLqqiMyiLuhQfs=; b=hsDaXPl1+UYjUPSHZuwbBNDftrlrzS/+B3mRyYkoMF3LmCh5VwrfJIcfS8SlycJq6h gPFNDSUiISwxhgkp/yvgpWtNi6fZkuqTvwEU7lrswWCPKqooVuWkD/qcZeMlAnY3RatL AIf0gyuVkDk6C8lo6JmUVK/BdcBQLFVvWu1w7tUAya+O7BTe7fRP9avvTrBVOC531NaH cx73P+1PgSEOPZ51d2nuZzviU5Gu0AGEg5LlElCuwMD8LSTPkMaLEsw85oK2E+OKYO51 at00CO/IipA6aDWaU4yAgtHQ2ZnWvnCuBUMxh02TsJz9JY+GxwBVwL3dyfzXErpp++Oo gLbg== X-Gm-Message-State: AOAM530SG/y0mfDsOXoUl3vUnYzupisSVPf168sBLeaaAiY98u5h8BLI 7OOnSPzMKxYyz9KVtLTTV1U6NQ== X-Google-Smtp-Source: ABdhPJyRtGUPEH8hQB3PYbEreefecpWhQ0b3Q4RWm7821VkslhtwepOtRIsUHn68CV2l8iU1xIwP+A== X-Received: by 2002:a17:902:9f8a:: with SMTP id g10mr16598513plq.158.1597779263268; Tue, 18 Aug 2020 12:34:23 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k21sm22549273pgl.0.2020.08.18.12.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 12:34:22 -0700 (PDT) Date: Tue, 18 Aug 2020 12:34:21 -0700 From: Kees Cook To: Christoph Hellwig Subject: Re: [PATCH 02/11] fs: don't allow kernel reads and writes without iter ops Message-ID: <202008181234.B1D9572C@keescook> References: <20200817073212.830069-1-hch@lst.de> <20200817073212.830069-3-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200817073212.830069-3-hch@lst.de> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Al Viro , linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Aug 17, 2020 at 09:32:03AM +0200, Christoph Hellwig wrote: > Don't allow calling ->read or ->write with set_fs as a preparation for > killing off set_fs. All the instances that we use kernel_read/write on > are using the iter ops already. > > If a file has both the regular ->read/->write methods and the iter > variants those could have different semantics for messed up enough > drivers. Also fails the kernel access to them in that case. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook