Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp619741ybl; Wed, 11 Dec 2019 05:02:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxPrcOVieVjZ0nqOumoaLHaYfNMPe1LnLB9vTyZGtKogoQQ8MDk9HQhQ/4bAWu09a7aBsfB X-Received: by 2002:aca:4a08:: with SMTP id x8mr2712451oia.39.1576069379389; Wed, 11 Dec 2019 05:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576069379; cv=none; d=google.com; s=arc-20160816; b=OfNhB3befSMGfFD9ruKAQagWXabGVKb+h7GWWcVso0UV8E5Mhw2KzOgdk4e0OBV97B CShLUMhY5nLaoSFIq+yKAtV/oqdDN7v+j82I/DfStrsIONRZpkTwFhG4b3okXjnSoxEF 3p8DpFOeEzEfHLENoFe8w/miFyC2ai/4Ihzc2So/ZlNAecddrKoxcNFulaQb51G2MhZU iXYCeS1UUmmyimDeKxyx3bj5ylfZQRGKgim1VXeX1gKetXn9TzaXglwy1oohQz33OsW/ kBsOphi3qkHFk2bhCbTRXyiCEHz832otTjVSJ+veib7AURXdctS3qDib2Ec9CPTV2CSf ZN4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=QCsu4Dbq48Wjp8EwKNXYVnpva2oT1ufF3xaGbrvslJk=; b=tFB6YWMK3GYQkd9a37niu/i5d0IkwX1rWV6XzOEoPaI5nLST4r2ipaA7yH9IK8VQN8 mb3Ox2i6uo2iu7Uh7E09GML0/bBzZLKNdZ6snMb7TC7d8yM1Z4nrHpOmu5DCe+I/tUIW 6cwUf8WBfWxXMlVd2c9dsmiRKLwyWgP0EHi2aIlufpuHdvMoWarV+xeM7Ea4Wr4mVvUC Smc/M17kLQXgmjwRLW4349y6TZOeDP+NcVO2yEj3z7ovBLr74DsQPO1l9f0grJaJd3s1 qG6owiBqvdXrf0up+ivxopE/c61P+EEXoD8LNTqW/VfhsMGIM8cjJ51C1qMqaZVSkPwe CJcQ== 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 n26si1027439otf.312.2019.12.11.05.02.45; Wed, 11 Dec 2019 05:02:59 -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 S1729337AbfLKNBu (ORCPT + 99 others); Wed, 11 Dec 2019 08:01:50 -0500 Received: from www62.your-server.de ([213.133.104.62]:53916 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727402AbfLKNBu (ORCPT ); Wed, 11 Dec 2019 08:01:50 -0500 Received: from [2001:1620:665:0:5795:5b0a:e5d5:5944] (helo=localhost) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1if1ch-0002OU-Os; Wed, 11 Dec 2019 14:01:47 +0100 Date: Wed, 11 Dec 2019 14:01:47 +0100 From: Daniel Borkmann To: Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: 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 Message-ID: <20191211130147.GA23383@linux.fritz.box> References: <20191210181412.151226-1-toke@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191210181412.151226-1-toke@redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.101.4/25660/Wed Dec 11 10:47:07 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 10, 2019 at 07:14:12PM +0100, Toke H?iland-J?rgensen wrote: > 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 trying > to dump the program because it only checks the len fields not the actual > pointers to the instructions and ksyms. > > Fix this by adding the missing checks. > > Signed-off-by: Toke H?iland-J?rgensen Applied, thanks!