Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1190119ybk; Thu, 14 May 2020 02:46:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJey4Z/Mpz0K2jpuWomGjGz8enhw1AbLMQi6fJ+qtMzt38AUPEWKrsm31EFaad0xxqOcjf X-Received: by 2002:a17:906:1292:: with SMTP id k18mr3009320ejb.132.1589449567481; Thu, 14 May 2020 02:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589449567; cv=none; d=google.com; s=arc-20160816; b=YOId+qktWUA8gntEjqFLkZIm+Rl1aP2lqWDM1AM9LAg0ehhmSXbHoE0Q1cF3VlqiAB RUqXYCztxFfvc/gk/UTJ0JgOSkiHdQxNsQbOJGGmDOQFW0gnYA4GY5qRIUpTomsM5vav BH1m94Zg5hOqlpcCloUfrKl00jzRRumvsyU43xs7RrC6/L9xI2whPfbuOymKkRhS7kGy sKBwQHqniuk6+yTASwUzzOpV0Zy12cqlzJaza3rxO5ol4jZsEhjTsLs0B9NHF5p8oOx8 rFyKzAL3AXjl9SL3Wb+sLq12Jh18gHLH9Hl384la+pybYXJe1Ir0dBs0bUa9MDiN+BKP MUOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=QZw0HxRZPstBtmS5+DIuur2lF00cOGZH+YaUXcGd470=; b=oCStt8A5sJYfqboy03kOk2Cy8Q/Ftl6JwoxFG1b/TYtgCGSqBJVux3a6qKPJP0o1hy vWIgYO/q1ZFBgN9ntfnRckTZC4SrNh6+PXKnPO05U3XOAqlQvgEBcIkcBY7UAOmnz+Dx eLF8yY+g35Ikx3AHXw/+xaPJUqIQb83LpkQToNrYIaAUgUBPzN0qhb+nWp6LO0O7YcZr 1YBsN1XdJX/AzVYQUnk6hcQPy4Nvnb+AhBdy4zWClJ9WGp88ahmts420Sdaw+6F6+AMQ DyyKGnbLYFwbSN/kwnEnMZV4PSm67hfVyAQiybqQtDfacPFIK6hbyUf1l8BRWXH2A5eS 9/RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jk6aTEoi; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr24si1407168ejb.383.2020.05.14.02.45.44; Thu, 14 May 2020 02:46:07 -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=@kernel.org header.s=default header.b=jk6aTEoi; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726056AbgENJo0 (ORCPT + 99 others); Thu, 14 May 2020 05:44:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:54536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbgENJoZ (ORCPT ); Thu, 14 May 2020 05:44:25 -0400 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D6A0D20671; Thu, 14 May 2020 09:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589449464; bh=F5xzM4P9ET4yKXEBz9PLWzDD7uANZxM9kOF6Hi0Phw0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jk6aTEoiSH2Mnk1a8lmx/pG+iP7t0ZtuYeeNlaBT8nrfRmPuNI0GvacMD/IuOomjY pOyeQAkAAiS0iTtbNPcuvt5G/Wr3M2YGy3VFqa+2II8TrrWHG3i20uAlz3jwxVHn2J wzQ54xIWj0eC9lQRZeFVyATuE2gt0dSEVAB8XocA= Date: Thu, 14 May 2020 18:44:19 +0900 From: Masami Hiramatsu To: Linus Torvalds 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 Subject: Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe Message-Id: <20200514184419.0fbf548ccf883c097d94573a@kernel.org> In-Reply-To: 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> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 May 2020 19:43:24 -0700 Linus Torvalds wrote: > 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.. It seems TASK_SIZE_MAX is defined only on x86 and s390, what about comparing STACK_TOP_MAX with PAGE_OFFSET ? Anyway, I agree that the best way is introducing a CONFIG. Thank you, -- Masami Hiramatsu