Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4891689ybv; Mon, 17 Feb 2020 07:57:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzoK1/nm2hSMBDjWIWDGJ5hWrAx7NBqzqsRTu5kmzu9qxjbuEjLtlriY+AwcHv1F38YLkIN X-Received: by 2002:aca:4106:: with SMTP id o6mr10387752oia.173.1581955039227; Mon, 17 Feb 2020 07:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581955039; cv=none; d=google.com; s=arc-20160816; b=pzX3OyOSIea9TSPnZXQ9dNeP5q7InvufrMfQjXkhatgZfqZQCaISjpZs44NhHARSB0 G8FQIqAySnGl5uRAsCyPgE1q9yq+NMctilPo0RpVzDXoTqCd3isQhvRx/5otGDA11YX1 Z4rSLXMRm7i0OcC9Wr+FkROsOAyA7NnXL2n8vK+Ev5u7JG/qkpxuZr2Qmy9LoawqoZ+j 9Rl1m7gYGCll5W8MX5R7HcrPMb8EOZz/PE9fPGwxuDG37gJxlgdv5hZd7/TXUKN2t2Mc fieXOpn+B9cI7VA49BWAVxBJPWcJvmvwoCA3s4MbOFnHuECpBuxO7Yfdl31AkvFEYFgn QxlQ== 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=PPLhZi6FLIeFwRiaw/Gmgw5rM96n7R5eqLjVDis32T4=; b=gFBY+Fq1ofl8WHtJ610UAeyX47c1aKno9Wvb/OW0YECBEt6c0DKJzQ0I7GBvIc4k9U Ktcrqr/EojtzYdAV7qrcTB+BYoMpygqvZbIHRht0So7+zcAl70tR+9ZP01qisViaJnBz ikONgZ1Xwbic2zT6LQev4+D5gV7srTUYmtRq/lF/g+RDyZLjiCqWM3McdzeOiqHFb4IH sQrxEwFMStmnmoaf/RUgrpsCAL5QyJKd0AC7LbHFW0VJ4geCbD+rOCbEe5psBAd+mSuZ 5z0Ko1EjT6C12J1K/7VFn2lM9eEV0Ja+bWxfaQohH8W/R6alRKUm3C2yT2UUt7yOG7+G JyVg== 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 q9si334473otc.86.2020.02.17.07.57.07; Mon, 17 Feb 2020 07:57:19 -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 S1729509AbgBQP5A (ORCPT + 99 others); Mon, 17 Feb 2020 10:57:00 -0500 Received: from www62.your-server.de ([213.133.104.62]:34936 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729167AbgBQP5A (ORCPT ); Mon, 17 Feb 2020 10:57:00 -0500 Received: from sslproxy06.your-server.de ([78.46.172.3]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1j3ilW-0000Lh-28; Mon, 17 Feb 2020 16:56:58 +0100 Received: from [2001:1620:665:0:5795:5b0a:e5d5:5944] (helo=linux-3.fritz.box) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j3ilV-000JSw-PJ; Mon, 17 Feb 2020 16:56:57 +0100 Subject: Re: [PATCH] bpf_prog_offload_info_fill: replace bitwise AND by logical AND To: Johannes Krude , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , trivial@kernel.org References: <20200212193227.GA3769@phlox.h.transitiv.net> From: Daniel Borkmann Message-ID: <5456d0d1-487d-1019-3083-397803b23888@iogearbox.net> Date: Mon, 17 Feb 2020 16:56:57 +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: <20200212193227.GA3769@phlox.h.transitiv.net> 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.1/25726/Mon Feb 17 15:01:07 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/12/20 8:32 PM, Johannes Krude wrote: > This if guards whether user-space wants a copy of the offload-jited > bytecode and whether this bytecode exists. By erroneously doing a bitwise > AND instead of a logical AND on user- and kernel-space buffer-size can lead > to no data being copied to user-space especially when user-space size is a > power of two and bigger then the kernel-space buffer. > > Signed-off-by: Johannes Krude Applied, thanks!