Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp80243ybv; Wed, 12 Feb 2020 19:38:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwnz9Z7j9Fu73+lGqCo8S6D/zMgXd+DuA+srHc5+TkZOMSKCCrjWv/EoGocZOcDZZ5fmpww X-Received: by 2002:a9d:6289:: with SMTP id x9mr12154068otk.8.1581565127821; Wed, 12 Feb 2020 19:38:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581565127; cv=none; d=google.com; s=arc-20160816; b=mNsOvJnj1lzFn7HF5fp0WLUqeN0NHJWVTusRdsxiwIIGSQPwygfsUkdyxE3Q0KGlh0 gPLgsKwH9dotlLAwifdKr5enaRokVHLWT93CzbC5yAua5I1PrOnopkoEHe+Amqd5ouqm ylzq0Bk7A+Hv76LVS5s/TdWFfUeX2UwL/iCRWqdxhrbENXzGEJdtN363+WA8o6dB7a6K pgAxDlbMDwAAaX22b1zIC+GUrEfZxESjDyovlOB1QqBFkFlRLAt55+JsXi4kYI28kZyp p27bAOL3tMt512gQXfaTpb9pJO/YLb14rNGWY7MdOg0JSzdYfznvG2qovBj36G4v5eXh f9/g== 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=lyMAFKdJy9x3QlgdPMUwsmvjbzxudpee1yn4sWfQf40=; b=DaGp6IvHgaeArB1nXGAOlBDr8B976mYGoFZKx5Y9edsMI11xqkPZR/LoDbJuVxVAHY 49+3MO00Kwsf3hdUaJSHjaZmOZfUZGJNIjXpMIE21B9xzvPfE6hrmOuL3SgpvaVzBJMq TEWWwt/wF+dacr+otzWH+i/83p0YUCfHO43cKNQDSQoQv1agwSWBQ7eVJMnDH6IV8JIF Hwu+1wUTHJGfv5AEr0XeOW1woEDHRZTm/boch4iEuFo0P6EfwnEUWtKQwfIdXxGnj/0S EX6Ldq0IG/vcfTi+pNWWZFjJUlXaMc7OAgWFI3Mwu1aUhh2aQl72GEnrzCpxouh4d/ao wNBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bUU8vaht; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si534725oic.208.2020.02.12.19.38.35; Wed, 12 Feb 2020 19:38:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bUU8vaht; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729581AbgBMDib (ORCPT + 99 others); Wed, 12 Feb 2020 22:38:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:48036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729432AbgBMDib (ORCPT ); Wed, 12 Feb 2020 22:38:31 -0500 Received: from cakuba.hsd1.ca.comcast.net (c-73-93-4-247.hsd1.ca.comcast.net [73.93.4.247]) (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 6372D206D7; Thu, 13 Feb 2020 03:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581565110; bh=WOIdnLcjHE9OfEk1miKLqHPcmwIMxhbffGCIXBpXzQ4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bUU8vahtOPQAhRLhdvAKTmGHo+nPiobcMyXYzbaMkMXdObI5K68RJKY5zAV2BJm0u btNXUTuTX9+xRE8jvru7Dap0kWjWDYn4K4lURDwt94vESoogo4GXVBxt+idBcQKb/b UlmYYkyWuRlCsiXLQiX1TNXGyF3TEdvZToZ+6sfU= Date: Wed, 12 Feb 2020 19:38:29 -0800 From: Jakub Kicinski To: Johannes Krude Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , trivial@kernel.org Subject: Re: [PATCH] bpf_prog_offload_info_fill: replace bitwise AND by logical AND Message-ID: <20200212193829.00ddefc0@cakuba.hsd1.ca.comcast.net> In-Reply-To: <20200212193227.GA3769@phlox.h.transitiv.net> References: <20200212193227.GA3769@phlox.h.transitiv.net> 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, 12 Feb 2020 20:32:27 +0100, 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 Thank you for the fix, in the future please provide a Fixes tag and include the tree name in the PATCH tag, e.g. [PATCH bpf], or [PATCH net] etc. Fixes: fcfb126defda ("bpf: add new jited info fields in bpf_dev_offload and bpf_prog_info") Acked-by: Jakub Kicinski