Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5905234ybl; Tue, 10 Dec 2019 13:30:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxGnMHvEGFiyPNrnFp4EykZ3/PvgneGL1JzGJ4X4w/EqSoNd3mKf5UqcPEtNCXZyJonjZp1 X-Received: by 2002:aca:ed46:: with SMTP id l67mr69162oih.53.1576013438932; Tue, 10 Dec 2019 13:30:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576013438; cv=none; d=google.com; s=arc-20160816; b=sUpY98AHvuByBd94LO0MSYA4RoAbR5YL8niMbI7/56H2b1f5XfrVB1sDezVT5GjRYX DP3NOkeaaaz6EVDsZbqJcFVHDizqR2QRgV0GUD+LdS45zXkkGMWUWGGLUGJWmxxCCcj8 uWT5EyE96q1nsD8mWn6MbFXQpS0PbzqyKnUyMXhbViZeGRsqysqEAnLf3cKdbTUGTk54 4N+ihz28CvYJSlkt/QS8HuMs83o6Y3WAXLPuNJe+TjMtOOzHkMkMjq5WGNzpPqS54yJ5 9HDCDE3aaxD5gnz/HjXGMLMt2HqbUM8FunHkQVVcah/ad48MqQe968Li1HUFApVe9OyJ 8FXw== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=6Dn0X1y8qWY4L6jupdvIYtGjXctpKGwYZyUlMuuX+gk=; b=Tly9X8J92HvKTFg/TqY+hYcEaVzyfIF4df7cbIZnkTl/D8IzqD8yC/23tFgoZjOPqR GHylFaZdIEq5vX6WMHxzObgnWRxLy5jdFL7UvBasCjbyDsjxIe0tCpnET5Sp768kimTN zcatRsNRb7YIWTXsmKt+a87kiwpsR/RensOdziiMp9beUzIQTZwDGRvJjXhpwDWy36YP rOboU0bNW6jJs/GvpPsvxAzxSb64VKrNw9zgaaqi+5yMG41xOB0zWupm6ma/ts8AiJ2G D/vQ0lkIteml8ecnxqvlp7esoORpTkNPXCab0OClExXFWo3fhfhBeuPhh3NBdicmLzcg Xlcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QoR6Yr/J"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a93si2733931otc.24.2019.12.10.13.30.27; Tue, 10 Dec 2019 13:30:38 -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=@redhat.com header.s=mimecast20190719 header.b="QoR6Yr/J"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728340AbfLJVaC (ORCPT + 99 others); Tue, 10 Dec 2019 16:30:02 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:23660 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728338AbfLJVKB (ORCPT ); Tue, 10 Dec 2019 16:10:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576012200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6Dn0X1y8qWY4L6jupdvIYtGjXctpKGwYZyUlMuuX+gk=; b=QoR6Yr/J4bbjg/p1mvjp7aha9lOWnKDi9ZOSF9vhAgamPAx0hMo1FaX41vIJkJE+j2Lh2K ISZwzpZ2cts5uzgcrjzSZoPLxVlaazc7O+KU167PfBAEoT4Re2QMxxZODBx+13nljlG4+s XZwH0VLWZ0q7q7gg9ZpkjHENCtlY+f4= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-bIhh8MvmPpScaMffIORNmg-1; Tue, 10 Dec 2019 16:09:59 -0500 Received: by mail-lj1-f197.google.com with SMTP id f1so4060362ljp.5 for ; Tue, 10 Dec 2019 13:09:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=6Dn0X1y8qWY4L6jupdvIYtGjXctpKGwYZyUlMuuX+gk=; b=LoJOxX9z4ETSRGDYXH7AaIYd0BqPbKJdizLQLCcDPE8I+BXi7Is0P5MwcJM8saLtHp fj5P3SAHlXtJrNwxTWYOc2RFxYIDAulqMOTSqzv8fs1XkLNVtzdqRTuYMGoSn4Checbv X+oHH8b0ffQgdLB2w1hC2L6xqithVheKOpKPh5jbRVtfju9J590RRru/UWWFC0xkpJP+ +AHJ505KSSVskHZhY03TlWPG5MdSOVNMoW62fFsSyxoXF7+qs7FXoyC80i2mBRZhDQ4T 9oQErcvYuPUurMrNlea+Y4a8XbQwiWTLUlCPiqUcXOkhF7FE4rho2OQ4Ki2gRKJPl9WU 9wiA== X-Gm-Message-State: APjAAAUFTLP8vFknDvvtdtRxOkFzvx6Mefj6I/O6IWMZpNRX1TOK24uz 1+2C2XAX8XaSxX+3n0xhRCQff8WLg8WM+WdZ+y2CpF5a0euJPSwy3kSTQgn6dBw4uRdvD7H9mx0 QvbV4+okdDF1++BD43vNozKKR X-Received: by 2002:a2e:a408:: with SMTP id p8mr3996819ljn.145.1576012197677; Tue, 10 Dec 2019 13:09:57 -0800 (PST) X-Received: by 2002:a2e:a408:: with SMTP id p8mr3996800ljn.145.1576012197452; Tue, 10 Dec 2019 13:09:57 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id f8sm2469467ljj.1.2019.12.10.13.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 13:09:56 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id E6C981803C1; Tue, 10 Dec 2019 22:09:55 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Jakub Kicinski Cc: Daniel Borkmann , Alexei Starovoitov , lkml , netdev@vger.kernel.org, bpf@vger.kernel.org, Martin Lau Subject: Re: [PATCH bpf v2] bpftool: Don't crash on missing jited insns or ksyms In-Reply-To: <20191210125457.13f7821a@cakuba.netronome.com> References: <20191210181412.151226-1-toke@redhat.com> <20191210125457.13f7821a@cakuba.netronome.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 10 Dec 2019 22:09:55 +0100 Message-ID: <87eexbhopo.fsf@toke.dk> MIME-Version: 1.0 X-MC-Unique: bIhh8MvmPpScaMffIORNmg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jakub Kicinski writes: > On Tue, 10 Dec 2019 19:14:12 +0100, Toke H=C3=B8iland-J=C3=B8rgensen wrot= e: >> When the kptr_restrict sysctl is set, the kernel can fail to return >> jited_ksyms or jited_prog_insns, but still have positive values in >> nr_jited_ksyms and jited_prog_len. This causes bpftool to crash when try= ing >> to dump the program because it only checks the len fields not the actual >> pointers to the instructions and ksyms. >>=20 >> Fix this by adding the missing checks. >>=20 >> Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen > > Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool") > > and > > Fixes: f84192ee00b7 ("tools: bpftool: resolve calls without using imm fie= ld") > > ? Yeah, guess so? Although I must admit it's not quite clear to me whether bpftool gets stable backports, or if it follows the "only moving forward" credo of libbpf? Anyhow, I don't suppose it'll hurt to have the Fixes: tag(s) in there; does Patchwork pick these up (or can you guys do that when you apply this?), or should I resend? -Toke