Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1214112ybk; Thu, 14 May 2020 03:26:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTUwVe8kELAFTjV906hxMqlUs20L3DrC68Erk5ZLuTRDFebvlSnb0uaFQ3Un1c7aSea8Aq X-Received: by 2002:a17:906:7282:: with SMTP id b2mr3252010ejl.161.1589452005477; Thu, 14 May 2020 03:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589452005; cv=none; d=google.com; s=arc-20160816; b=djqQIN7hI1+xsHZosEUM7d58X3dcTeM4DWHh1osh8pcKKQXSLO7eNaMJHEhGIUnYIm 4Px2x74GklumL1KbAeAIGIcOXHde8mK52CSyr6m/2qwy1N0num5UIesauTgxfgxlyuTD WoWSdXUgfS8g9OAbr4PyAhpfUbEJBTGdxeY0Agba8bEb8kTP0PPK7vQVPfI4bladXcRY MLSA3nHTLk5xx6HvL5MTgJtFQChXFLiHX0WGoElnxW/4yOXgMA0lHEIRMrzj3dvAg2QU ksyEJR6yWXpPeitdpoQawr1NCJP1yCVKIxFoqnuoIGxLwSjPNIalDZGQCosfctAo+Zv9 PyeQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=VGoQlvc06S2bzBt4bp6o8c5RPwZXSDOtjzJ2iVTsziI=; b=bOPYKMtdVUp0Z5QYQUYHDWwDbt0/TQbhdeyJzVmC+xUYLlfGUm2+ZMO199x29PkMwP QZqfSUq4EPi4hAgk5NWehAOr5dKZ8tKxd6E4bTtJC2zwwgE+NVtd43glfMnuyHOrPx3h BmFGRCFO0BuQ7RPrTYd6rSPdLf34I7DL672byWHLx7jOiRfp+4RCBd8hmfYn++iA/QCC 8Ib1Jm2yGvVaHE9fCl6xpOQLQb1IcMcWleW1eNFApv6m/F4pR2cvSMJTZdcNnVBIAiZr Q6G4sI381QeHhqhNvbJf2xJCgTrVZbcuiYfa39cmtvceUpCsWKGevz0XgMQoBkPE4iAJ N+sQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c15si1541157ejr.343.2020.05.14.03.26.22; Thu, 14 May 2020 03:26:45 -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; 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 S1726471AbgENKWg (ORCPT + 99 others); Thu, 14 May 2020 06:22:36 -0400 Received: from www62.your-server.de ([213.133.104.62]:32966 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbgENKWI (ORCPT ); Thu, 14 May 2020 06:22:08 -0400 Received: from sslproxy02.your-server.de ([78.47.166.47]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1jZAzy-0007F0-Dx; Thu, 14 May 2020 12:21:54 +0200 Received: from [178.196.57.75] (helo=pc-9.home) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZAzx-000RXX-Tr; Thu, 14 May 2020 12:21:53 +0200 Subject: Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe To: David Laight , Al Viro Cc: Christoph Hellwig , Linus Torvalds , the arch/x86 maintainers , Alexei Starovoitov , Masami Hiramatsu , Andrew Morton , "linux-parisc@vger.kernel.org" , linux-um , Netdev , "bpf@vger.kernel.org" , Linux-MM , Linux Kernel Mailing List , "bgregg@netflix.com" References: <20200513160038.2482415-1-hch@lst.de> <20200513160038.2482415-12-hch@lst.de> <20200513192804.GA30751@lst.de> <0c1a7066-b269-9695-b94a-bb5f4f20ebd8@iogearbox.net> <20200513232816.GZ23230@ZenIV.linux.org.uk> <866cbe54-a027-04eb-65db-c6423d16b924@iogearbox.net> <6ca8d8499bf644aba0b242d194df5a60@AcuMS.aculab.com> From: Daniel Borkmann Message-ID: <2cc83197-3ecc-b8c2-742d-e953c1f7bf8c@iogearbox.net> Date: Thu, 14 May 2020 12:21:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <6ca8d8499bf644aba0b242d194df5a60@AcuMS.aculab.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.2/25811/Wed May 13 14:11:53 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/14/20 12:01 PM, David Laight wrote: [...] > If it's not a stupid question why is a BPF program allowed to get > into a situation where it might have an invalid kernel address. > > It all stinks of a hole that allows all of kernel memory to be read > and copied to userspace. > > Now you might want to something special so that BPF programs just > abort on OOPS instead of possibly paniking the kernel. > But that is different from a copy that expects to be passed garbage. I suggest you read up on probe_kernel_read() and its uses in tracing in general, looks like you haven't done that.