Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp992203ybk; Wed, 13 May 2020 19:46:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNTU4ZFeiOZFJWAvrdepyuNbjFofeAgaPMz6q08lj2NtqjPkc/3KtQhU3MUJfGMBm8st37 X-Received: by 2002:a17:906:84cf:: with SMTP id f15mr1919943ejy.185.1589424387460; Wed, 13 May 2020 19:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589424387; cv=none; d=google.com; s=arc-20160816; b=i9/LU0WFhGUg+I4aCgF941WF5IIDv4G4+PQdarvvBB6r06KVn0YqlOTX2JlzHvj9MJ b7syJPq3sNiBWirEY2kX3suY9Oz4vS1dND1b8nsQ4FgIp0gyAVizPbTmohsnNeM8meTE XE4xLmbVRXIU8VVuz8QgrX/WKH3ekB1cTGzv6qEj8YRUL/v8DB9sN9pwXB+4+PkndIi4 +T/WFk770CSBRJhqAK9DuupYvvQfN0prgDRZpT87YN3isNEnNoMgZqWEQg/Ah/+hGl2C 5HuEMwlz1u41kYrcOZoj69OEaXcLhONPuWbrLYUekRMod8+fuvtCVxSASRvJtk+2mWvt 9u7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=L3In83ZNtvhCqrpK0vVjzsKNvprMyvL+zJ9ohua4z10=; b=nejyS39jMn64G6lZym+CmxR5g66a4rh6/KIuyqo6dO7Y0ea3O9zG0ok/pCxRtgV5T8 MVkrekaiyCt1BT7PaGc5Xry+rw7HI9HcXEszaTb7i7KRh6kcmeCNqgt7S4bUl1zNDu0E KMLTICNvLVrj/p4Wob1ZD8UUWoa0u7bC6rqknwTSeYygnHe5PDJPyl2sa0et266X30D7 jfEAc51taumQgShwXJ/iL4/GanG+FqddNIo+uPxiK4oJSFOhb70Z7m6VFF8EWlI+oKXx 096/LQFP6ygkO4MegfNI2y8Aj9b5+LAYuNTQVzXS8nMvA5GvRmTyQjH5vdhEhUIahnmn OKDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RJxI7nc5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si754874eds.22.2020.05.13.19.46.05; Wed, 13 May 2020 19:46:27 -0700 (PDT) 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=@linux-foundation.org header.s=google header.b=RJxI7nc5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbgENCnq (ORCPT + 99 others); Wed, 13 May 2020 22:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725874AbgENCnp (ORCPT ); Wed, 13 May 2020 22:43:45 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10A2EC061A0C for ; Wed, 13 May 2020 19:43:45 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id b6so1843350ljj.1 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=WazOw1lSKPioK2lPoQAY4LVzSHNd+Dhg6+UAp4hbSXrpBjgqg/40eNfLXCLZ+KawnT JUwquuGhvvviuHPZcTCLWKrVMw3OXVlAc+J1j6PmxrNE7C8HHGa/xhhs06gdPOf6hzd0 V5Aa3NKwHDw+IWv+W6CivHom59Xy7rA9ljTSGAREQ3++pBHVTobK+aYg7TvWWnOlt89c b2xh8tJTeFgolUFL/gNSQOnX8E7fC3THWhyFNSIleG0wxIYU2qahsiVQFUxrB+kGc8qr KeQtBZllOcDkE1UMFXF9eKVcKg6kjwaBS9/frphl7b7do43sXiQLqTuZltT5f8lNzQv4 6jaw== X-Gm-Message-State: AOAM531P6xxqXEFm4d3UCiG3IiB6F9073nPg2GmqIVTQx1K3Uig7nDgL NsROlV4or+wHWCrGuvEN2U3ngQCtzpc= X-Received: by 2002:a2e:5847:: with SMTP id x7mr1201812ljd.61.1589424222614; Wed, 13 May 2020 19:43:42 -0700 (PDT) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id b25sm605236ljp.105.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-f41.google.com with SMTP id r17so1257801lff.9 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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