Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3869288pxb; Tue, 17 Nov 2020 05:50:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJx008FjWhB4+DH23X58uXq3NNuZt8ed7vORzDeuzIsMmlO1YQMvumLryRX4ux+89Ho+/Qoa X-Received: by 2002:a17:906:4748:: with SMTP id j8mr18716675ejs.22.1605621004456; Tue, 17 Nov 2020 05:50:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621004; cv=none; d=google.com; s=arc-20160816; b=jZ6b5mipSaZf/irhcspiO8el3vSLWsD6MFGplqh9GBDphfzR6cmIl6dd9mbS7hzsle Go6xraBckY/qa92gEVpvDTR02/JbWdgbLxH9KI2G1Rk941Ktj2wAuyFXv4B/fLlJj1A+ VmLCmtMH1iKbwaT+qPYfp3AXf3pyMJOgr3CxJ4geFpFKHdG6VrhQWM43bWiULfCGyu7e SRnEiMK2iBLi7pZFn4FPh5XCYUIM9drqiWyqLFxRLQZkzcNQZTG/jgKFXfh/6ajjdwhH irDAhibyaupuoCWxAR8Z6f1JTGq6KilBsCbPIRBMEYf7H9AvDNXGdsDoXr0U5r5Xh8DQ x6wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gyk5HN6rMfnI8lN2Ze/6aOegPN+wd68rzQ8bEfleGes=; b=TH6VHWoV398wA/CdkiNB9pmYXBq+81vFdOcxsa91h/MEluBirFeguheay1B4N4x42L ePg+K276VWvuZWTF+dVMTggRsFAatOCvnMObSHsPKzZucHNDNuY5UO8ZUM9aSuzgua6a JFs3PSAHlBnqMzDfgeHPfSFFQKYzV0OThhUcmg1Kiq6grYuTYqISGwi+nE2rl73+NXWu Nd5s8F3CNXGYF26eqRD07J8J2QKH4I8SBd9XUnBnbtfyXjkwgE6q77DWHHU9k+iyJNsi Kc7B+ixwiNBbgGzgBZyPcTL7Wgkd6xFtifgUiEObXahtxSPfrWoq2sbP2lT0PClos5Rc U/KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d4FyxoE4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a42si3579700edf.129.2020.11.17.05.49.41; Tue, 17 Nov 2020 05:50:04 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=d4FyxoE4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387766AbgKQNsD (ORCPT + 99 others); Tue, 17 Nov 2020 08:48:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:48154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731486AbgKQNhB (ORCPT ); Tue, 17 Nov 2020 08:37:01 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 9D99C20780; Tue, 17 Nov 2020 13:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620221; bh=4xuzPg0kOjxj2nNV9bckmdhedAE/3CqJSwUrZfjd9fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d4FyxoE4DZq0DozJGGvB/vT/LHxz3OYH30KnLkfIUGBK4sW+KJJtQE73KFFgQ6lLr oA8Uqr2diGaQQLUILAu989vLGNXjzCaO796VjAemTeE1XQXXR8Y4OP5WokO9NBuSBR zgEMzw7IOARYTjqizXJBW0SBXq3BsT7NljDt/Ec4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Benc , Lorenz Bauer , Alexei Starovoitov , Song Liu , Sasha Levin Subject: [PATCH 5.9 146/255] tools/bpftool: Fix attaching flow dissector Date: Tue, 17 Nov 2020 14:04:46 +0100 Message-Id: <20201117122146.068682284@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenz Bauer [ Upstream commit f9b7ff0d7f7a466a920424246e7ddc2b84c87e52 ] My earlier patch to reject non-zero arguments to flow dissector attach broke attaching via bpftool. Instead of 0 it uses -1 for target_fd. Fix this by passing a zero argument when attaching the flow dissector. Fixes: 1b514239e859 ("bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH") Reported-by: Jiri Benc Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20201105115230.296657-1-lmb@cloudflare.com Signed-off-by: Sasha Levin --- tools/bpf/bpftool/prog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index d393eb8263a60..994506540e564 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -741,7 +741,7 @@ static int parse_attach_detach_args(int argc, char **argv, int *progfd, } if (*attach_type == BPF_FLOW_DISSECTOR) { - *mapfd = -1; + *mapfd = 0; return 0; } -- 2.27.0