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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 59AB7C433E0 for ; Thu, 14 May 2020 02:43:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44BA8206DA for ; Thu, 14 May 2020 02:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589424226; bh=UwFK1JSh04uU+EKtoD0SWRBNbvLzPgcTZDGhixl8HcA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=PVjSxIX1APMbJarqEZS1A4HzV95rL2zfnhS9VdOXglQyVY/n0HK/dQlZUBYqiuMd2 EziAPoqNHafpQ5cT1fLRNdnUrLhCvMituA1g6IDXW3kKuYOJuTuT+EMBrV1ftbyABg 0Bn7Cdcw8mNNb+f3HSWUArsrMFGTJcGkxJIkwOU0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbgENCnq (ORCPT ); Wed, 13 May 2020 22:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725931AbgENCnp (ORCPT ); Wed, 13 May 2020 22:43:45 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26DBCC061A0E for ; Wed, 13 May 2020 19:43:45 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id a21so1757955ljj.11 for ; Wed, 13 May 2020 19:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L3In83ZNtvhCqrpK0vVjzsKNvprMyvL+zJ9ohua4z10=; b=RJxI7nc5/+qicT+av7MVnCPyCWQNYqEmo+1I8aEDjYrcgsKm1JO+ximEumc2BGCHG6 IRKjgEiRjwQuoza3oL4WOrhIpbRc8zh7pT5r3iUQzrEjc7+dcHsaKetaMFqukCgIbr+Y 1swtCFlefWtGVUfsLBR/jTXuJr1SgZ0x45QhE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L3In83ZNtvhCqrpK0vVjzsKNvprMyvL+zJ9ohua4z10=; b=HuAA2xU2vaupr28g0c0JCdYzJg4UbyboDWI2a+uMWYDD70QiAsLx6fBbuL5Nqy/So7 jIf1mzZ5CS4StnCc4gkW28ZE7U5DK9n3jKsc/+cvQRNfhtikzAYfC0w56s9IHVM80vvM IVTvB15462JvktG//dpPvdD7x0PUTDEY2ASmn/OHJDDd96FqsF7HqrTzys6MLeOIu7jL oOqYHP7ViQgkY3G4gYlsparihSzRJKc4A5JZZYzOCTxKWAyDIyx6ltexkar3jBPVusaO TUl1I8X0sVSzLx5tnIcCwqHOXanoxv0SXeSQ5j3jLKrGouM/jaIz05V5M12dTPmAXNqa ahKw== X-Gm-Message-State: AOAM532045S0qN99dy5Fc871Ar313M/ERm4bd9gJvet2d7Ahj3awKW1j B2g2wwaDawtp91sr0O6zlDeHKBKWTvo= X-Google-Smtp-Source: ABdhPJzQRZjwDn1NZ4vU5MFXJK2g23gRQ69zLKbZj6kbfcZwdFLHJAV29tO1Xh4oqn+RZvlrrtbHqg== X-Received: by 2002:a2e:9e43:: with SMTP id g3mr1286169ljk.4.1589424221952; Wed, 13 May 2020 19:43:41 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id q16sm626013ljj.23.2020.05.13.19.43.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 May 2020 19:43:40 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id a4so1234004lfh.12 for ; Wed, 13 May 2020 19:43:40 -0700 (PDT) X-Received: by 2002:a19:6e4e:: with SMTP id q14mr1567307lfk.192.1589424220085; Wed, 13 May 2020 19:43:40 -0700 (PDT) MIME-Version: 1.0 References: <20200513160038.2482415-1-hch@lst.de> <20200513160038.2482415-12-hch@lst.de> <20200513192804.GA30751@lst.de> <0c1a7066-b269-9695-b94a-bb5f4f20ebd8@iogearbox.net> <20200514082054.f817721ce196f134e6820644@kernel.org> <20200514100009.a8e6aa001f0ace5553c7904f@kernel.org> In-Reply-To: <20200514100009.a8e6aa001f0ace5553c7904f@kernel.org> From: Linus Torvalds Date: Wed, 13 May 2020 19:43:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe To: Masami Hiramatsu Cc: Daniel Borkmann , Christoph Hellwig , "the arch/x86 maintainers" , Alexei Starovoitov , Andrew Morton , linux-parisc@vger.kernel.org, linux-um , Netdev , bpf@vger.kernel.org, Linux-MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Wed, May 13, 2020 at 6:00 PM Masami Hiramatsu wrote: > > > But we should likely at least disallow it entirely on platforms where > > we really can't - or pick one hardcoded choice. On sparc, you really > > _have_ to specify one or the other. > > OK. BTW, is there any way to detect the kernel/user space overlap on > memory layout statically? If there, I can do it. (I don't like > "if (CONFIG_X86)" thing....) > Or, maybe we need CONFIG_ARCH_OVERLAP_ADDRESS_SPACE? I think it would be better to have a CONFIG variable that architectures can just 'select' to show that they are ok with separate kernel and user addresses. Because I don't think we have any way to say that right now as-is. You can probably come up with hacky ways to approximate it, ie something like if (TASK_SIZE_MAX > PAGE_OFFSET) .... they overlap .. which would almost work, but.. Linus 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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 29D2EC433DF for ; Thu, 14 May 2020 02:43:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DB79820693 for ; Thu, 14 May 2020 02:43:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="RJxI7nc5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB79820693 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7F7C18004A; Wed, 13 May 2020 22:43:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A9088003E; Wed, 13 May 2020 22:43:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 696A68004A; Wed, 13 May 2020 22:43:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id 4D4A38003E for ; Wed, 13 May 2020 22:43:45 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0A49A180AD80F for ; Thu, 14 May 2020 02:43:45 +0000 (UTC) X-FDA: 76813779210.19.thumb67_20b0f98ae194c X-HE-Tag: thumb67_20b0f98ae194c X-Filterd-Recvd-Size: 4753 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Thu, 14 May 2020 02:43:44 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id g1so1779823ljk.7 for ; Wed, 13 May 2020 19:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L3In83ZNtvhCqrpK0vVjzsKNvprMyvL+zJ9ohua4z10=; b=RJxI7nc5/+qicT+av7MVnCPyCWQNYqEmo+1I8aEDjYrcgsKm1JO+ximEumc2BGCHG6 IRKjgEiRjwQuoza3oL4WOrhIpbRc8zh7pT5r3iUQzrEjc7+dcHsaKetaMFqukCgIbr+Y 1swtCFlefWtGVUfsLBR/jTXuJr1SgZ0x45QhE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L3In83ZNtvhCqrpK0vVjzsKNvprMyvL+zJ9ohua4z10=; b=tmeHT6XOGBBOpZ8g7b07WyrmalgliLhOBM/d2o/uUkIJqYKrRPuMBQfmzSxmraQwfA WwnjeAPaK7vsXVBCXQf5Od+04Or1D9Tdogyhyr4rNSyjaYyf6BI6v4CrVYo9Ap+2wVgv pZNljj6W+R05JUhsDSuhXmZ3j2jyC1zHXkt/ZwWxjvaRimzGmD7XlZECBw4ku8sOmzQe M1KdMJn40mzoRFiOfs4c9uI70cmtCXBnRkdqOykAOkmZa/o5BtOWd3LzgNbwVnZeRBD1 wHd7muVDCSW/nPmFP4oS9cmPZhtJyvYoQ8lZbf6l7x2w0WxOs3h2xiOOxshCe264Rx7I Yufw== X-Gm-Message-State: AOAM530rrrzWillogYtmtJybPTGe+D+TWn2cwvGOo9rYeUgIobObb7pb 45Ai3csFGIdJ+8weazCc5aAIfZR4lrY= X-Google-Smtp-Source: ABdhPJwZRcIMcCnbBqNoRrfqDrljJwAQgOtXi5vQbEfIHzDR+yrG7vjqiMdecfxmRKGFA792fq3h4A== X-Received: by 2002:a2e:9842:: with SMTP id e2mr1172598ljj.273.1589424222096; Wed, 13 May 2020 19:43:42 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id q13sm797226lfh.73.2020.05.13.19.43.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 May 2020 19:43:40 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id a9so1261270lfb.8 for ; Wed, 13 May 2020 19:43:40 -0700 (PDT) X-Received: by 2002:a19:6e4e:: with SMTP id q14mr1567307lfk.192.1589424220085; Wed, 13 May 2020 19:43:40 -0700 (PDT) MIME-Version: 1.0 References: <20200513160038.2482415-1-hch@lst.de> <20200513160038.2482415-12-hch@lst.de> <20200513192804.GA30751@lst.de> <0c1a7066-b269-9695-b94a-bb5f4f20ebd8@iogearbox.net> <20200514082054.f817721ce196f134e6820644@kernel.org> <20200514100009.a8e6aa001f0ace5553c7904f@kernel.org> In-Reply-To: <20200514100009.a8e6aa001f0ace5553c7904f@kernel.org> From: Linus Torvalds Date: Wed, 13 May 2020 19:43:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe To: Masami Hiramatsu Cc: Daniel Borkmann , Christoph Hellwig , "the arch/x86 maintainers" , Alexei Starovoitov , Andrew Morton , linux-parisc@vger.kernel.org, linux-um , Netdev , bpf@vger.kernel.org, Linux-MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 13, 2020 at 6:00 PM Masami Hiramatsu wrote: > > > But we should likely at least disallow it entirely on platforms where > > we really can't - or pick one hardcoded choice. On sparc, you really > > _have_ to specify one or the other. > > OK. BTW, is there any way to detect the kernel/user space overlap on > memory layout statically? If there, I can do it. (I don't like > "if (CONFIG_X86)" thing....) > Or, maybe we need CONFIG_ARCH_OVERLAP_ADDRESS_SPACE? I think it would be better to have a CONFIG variable that architectures can just 'select' to show that they are ok with separate kernel and user addresses. Because I don't think we have any way to say that right now as-is. You can probably come up with hacky ways to approximate it, ie something like if (TASK_SIZE_MAX > PAGE_OFFSET) .... they overlap .. which would almost work, but.. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZ3qd-0006Aa-RY for linux-um@lists.infradead.org; Thu, 14 May 2020 02:43:50 +0000 Received: by mail-lf1-x143.google.com with SMTP id s9so1297780lfp.1 for ; Wed, 13 May 2020 19:43:44 -0700 (PDT) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id a11sm620225lji.62.2020.05.13.19.43.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 May 2020 19:43:40 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id r17so1257797lff.9 for ; Wed, 13 May 2020 19:43:40 -0700 (PDT) MIME-Version: 1.0 References: <20200513160038.2482415-1-hch@lst.de> <20200513160038.2482415-12-hch@lst.de> <20200513192804.GA30751@lst.de> <0c1a7066-b269-9695-b94a-bb5f4f20ebd8@iogearbox.net> <20200514082054.f817721ce196f134e6820644@kernel.org> <20200514100009.a8e6aa001f0ace5553c7904f@kernel.org> In-Reply-To: <20200514100009.a8e6aa001f0ace5553c7904f@kernel.org> From: Linus Torvalds Date: Wed, 13 May 2020 19:43:24 -0700 Message-ID: Subject: Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Masami Hiramatsu Cc: Daniel Borkmann , linux-parisc@vger.kernel.org, Netdev , the arch/x86 maintainers , linux-um , Alexei Starovoitov , Linux Kernel Mailing List , Linux-MM , bpf@vger.kernel.org, Andrew Morton , Christoph Hellwig On Wed, May 13, 2020 at 6:00 PM Masami Hiramatsu wrote: > > > But we should likely at least disallow it entirely on platforms where > > we really can't - or pick one hardcoded choice. On sparc, you really > > _have_ to specify one or the other. > > OK. BTW, is there any way to detect the kernel/user space overlap on > memory layout statically? If there, I can do it. (I don't like > "if (CONFIG_X86)" thing....) > Or, maybe we need CONFIG_ARCH_OVERLAP_ADDRESS_SPACE? I think it would be better to have a CONFIG variable that architectures can just 'select' to show that they are ok with separate kernel and user addresses. Because I don't think we have any way to say that right now as-is. You can probably come up with hacky ways to approximate it, ie something like if (TASK_SIZE_MAX > PAGE_OFFSET) .... they overlap .. which would almost work, but.. Linus _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um