Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2214750ybl; Thu, 19 Dec 2019 09:50:16 -0800 (PST) X-Google-Smtp-Source: APXvYqy7od6TO3i63ngDce0MJ4lqdT4b9xaUJUUj+OZCAtOF3ZNDIiDiKie4pl8s61i6lctGdamc X-Received: by 2002:a05:6830:1707:: with SMTP id 7mr10425286otk.185.1576777816520; Thu, 19 Dec 2019 09:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576777816; cv=none; d=google.com; s=arc-20160816; b=fSWUlbo9zUnDk010EraTntL8aC+kmVtBQwbJzuMORImw4qZuwKZu2TPKXoHKmlTtgc Ya82Cixleoeb1SKLCMnDpBIZnz4k3l96Qm59lw9I+AG2+36TCIEReU5AWqDNuqeujV6o nhlIR+WFD32v8SBG36QXA538bSl7IDP2Z8QAKnVNqPpfvujkY/ngjEVnOMeq+lw8aQay 8smwlPBPkPhgj7IWta8Z2BLLQYgopcutBaHQ6YobaB2JDgW6XXaez5XavZmfUaRX6ahq SWIZL9KjNqZgt++y7bNdUK59KHUCenh/UFjAHIlTY78p0VUZ7VL4jNNjaLEkLXTPFie0 ++8A== 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=wWVExoTIYblFL6GdIQPgxEIysQ3FW9dlhFOT0JDUH1g=; b=ghYNwGt7k9Exf2Nu5K9eglJhQc2n2UA6pbSYu5HLRORJJxPDb7mJ0OUPQJupsRo40o vbI4pQJLlpQI8VYFbrW1flvwvvb1y9bYhCZO0epLVBVYpyr32mE2J/+8I78nM6pWFSeM KXrO2gEVHE7R9UEXuoYr7k6tNOD20pug2dtSbDm47ioPMwZyMR5UBEjYr0SRtnaYfdjW aFag7zuWveAvOXeYUtb24tjDX3TiF3Xfmsc0ZTE0r4Reitw5LLun7OgyHMs5zRP1EEvj 2GjvFdnvqNV3yrLVTXgwc/Fw280cQPpFYh0GyrFdE66tgK6rq2A89tGnfLzxQARJ/g+E TKKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si2921113otj.24.2019.12.19.09.50.04; Thu, 19 Dec 2019 09:50:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726984AbfLSRsN (ORCPT + 99 others); Thu, 19 Dec 2019 12:48:13 -0500 Received: from www62.your-server.de ([213.133.104.62]:47084 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbfLSRsN (ORCPT ); Thu, 19 Dec 2019 12:48:13 -0500 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 1ihzuC-0004b3-RS; Thu, 19 Dec 2019 18:48:08 +0100 Received: from [2001:1620:665:0:5795:5b0a:e5d5:5944] (helo=linux-9.fritz.box) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ihzuC-000QZD-Ft; Thu, 19 Dec 2019 18:48:08 +0100 Subject: Re: [PATCH] bpf: Replace BUG_ON when fp_old is NULL To: Aditya Pakki , Yonghong Song Cc: "kjlu@umn.edu" , Alexei Starovoitov , Martin Lau , Song Liu , Andrii Nakryiko , "netdev@vger.kernel.org" , "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20191215154432.22399-1-pakki001@umn.edu> <98c13b9c-a73a-6203-4ea1-6b1180d87d97@fb.com> <566f206c-f133-6f68-c257-2c0b3ec462fa@iogearbox.net> <51dcca79-f819-8ebb-308e-210a0d76b1cc@umn.edu> From: Daniel Borkmann Message-ID: Date: Thu, 19 Dec 2019 18:48:07 +0100 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: <51dcca79-f819-8ebb-308e-210a0d76b1cc@umn.edu> 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.101.4/25668/Thu Dec 19 10:55:58 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/19/19 6:39 PM, Aditya Pakki wrote: > On 12/16/19 5:17 AM, Daniel Borkmann wrote: >> On 12/15/19 11:08 PM, Yonghong Song wrote: >>> On 12/15/19 7:44 AM, Aditya Pakki wrote: >>>> If fp_old is NULL in bpf_prog_realloc, the program does an assertion >>>> and crashes. However, we can continue execution by returning NULL to >>>> the upper callers. The patch fixes this issue. >>> >>> Could you share how to reproduce the assertion and crash? I would >>> like to understand the problem first before making changes in the code. >>> Thanks! >> >> Fully agree, Aditya, please elaborate if you have seen a crash! > > Thanks for your responses Alexei and Daniel. We identified this issue via static analysis > and have not seen a crash. However, by looking at the callers of bpf_prog_realloc, I do > agree that fp_old is never NULL. > > Would you recommend removing the BUG_ON assertion altogether ? If it would ever happen, we'd already crash in fp_old->pages there, so yes, lets remove the unneeded BUG_ON(). Thanks, Daniel