Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4782682pxy; Tue, 27 Apr 2021 12:29:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9Ke0+8lDqe7IvoZHDOTNQjIty9ac4fUEqa5HBBfrUrQ+++5BZudYm/QmHYSRGKdNrMuiy X-Received: by 2002:a05:6402:350e:: with SMTP id b14mr6663022edd.307.1619551793222; Tue, 27 Apr 2021 12:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619551793; cv=none; d=google.com; s=arc-20160816; b=LycQVp6WL3PfNjDy5TGf5yD2RDPBjmBpGF8iuO3fEJBMzubCWyK6debLSPJJ4fz5QT uCU8HVDzcXKAEGNmTMXPUpFiGpJqFiiVO+NoTa+y0ZocIzUWTje17ae4Kdw8z3U9nejc l6DP14fvfLuq8qqVhn9/qpNUR+/plnKXc6GSbX8gi89plK8aXjcMvTxQwnnxkrQa7/Vk XQ6D9QpOl0hVqqHPQhIW36LRT4k6AZ6KKPyKhVI78wAcKwtiLxnuZFrv7/CmWZUtdoDt UvRw8RP7ZUfsaGIWKbf0wnYjmmpXvQUMF9uXaFWA1UrGFt9C2p9/4L179mlrGPi3dZ3k zWnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=hFjdRYFYn/jxyc+GprL7Qq1jhusixjMiBP43KwZNRjk=; b=K6GoPI1tb8O3JfJrq7hi7sQk4mXcVFjXcUDe2qiUXkDOYZxLzdnAkPIPJw+Ntor3Cr JLWnI6f4v3PDhEYZXluPMnyhfDogqNxBozcPZ3uApJDuGAqwoFThf5fEfj1w/o7ib8J2 5MnMZQFSne/5y+ZqlnaobpAJecQjOWAGflEfEyDtpiXyl4Nn65+C78jt6hNlD1/iMkL/ 8MTH6yaCQ6J2I57pyscdSbIWbPTmjzHCqnjDTDSj87DpL0PrxOBGgEi+/zjB0hU+KfLH jUJOJ8lVsZkHOfyMzn6vbCh8wFM4TmS6Wr7RVn6gt9LCe5N0HDduVxZVTemSloeQx/oW 8T6g== 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 v7si3973689edd.352.2021.04.27.12.29.29; Tue, 27 Apr 2021 12:29:53 -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 S236932AbhD0T3S (ORCPT + 99 others); Tue, 27 Apr 2021 15:29:18 -0400 Received: from www62.your-server.de ([213.133.104.62]:42478 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235563AbhD0T3R (ORCPT ); Tue, 27 Apr 2021 15:29:17 -0400 Received: from sslproxy01.your-server.de ([78.46.139.224]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lbTNo-0002Ha-5A; Tue, 27 Apr 2021 21:28:32 +0200 Received: from [85.7.101.30] (helo=linux.home) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbTNo-0000l2-0p; Tue, 27 Apr 2021 21:28:32 +0200 Subject: Re: [PATCH 066/190] Revert "bpf: Remove unnecessary assertion on fp_old" To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Aditya Pakki References: <20210421130105.1226686-1-gregkh@linuxfoundation.org> <20210421130105.1226686-67-gregkh@linuxfoundation.org> From: Daniel Borkmann Message-ID: <56b8a42d-261e-1fc0-f572-8c3c1a98701d@iogearbox.net> Date: Tue, 27 Apr 2021 21:28:31 +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: 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.103.2/26153/Tue Apr 27 13:09:27 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/27/21 7:58 PM, Greg Kroah-Hartman wrote: > On Wed, Apr 21, 2021 at 02:59:01PM +0200, Greg Kroah-Hartman wrote: [...] >> kernel/bpf/core.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c >> index 75244ecb2389..da29211ea5d8 100644 >> --- a/kernel/bpf/core.c >> +++ b/kernel/bpf/core.c >> @@ -230,6 +230,8 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, >> struct bpf_prog *fp; >> u32 pages; >> >> + BUG_ON(fp_old == NULL); >> + >> size = round_up(size, PAGE_SIZE); >> pages = size / PAGE_SIZE; >> if (pages <= fp_old->pages) > > The original commit here is correct, I'll drop this revert. Ok, sounds good to me, thanks! (If there would ever be an incorrect fp_old with NULL, then at latest we crash in fp_old->pages anyway, so the BUG_ON() was not needed.) > thanks, > > greg k-h >