Message ID | 20181205093555.5386-13-sashal@kernel.org |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show
Return-Path: <netdev-owner@vger.kernel.org> X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="f+p18QLs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 438vhH4msmz9s3Z for <patchwork-incoming-netdev@ozlabs.org>; Wed, 5 Dec 2018 21:13:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbeLEJgo (ORCPT <rfc822;patchwork-incoming-netdev@ozlabs.org>); Wed, 5 Dec 2018 04:36:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:38822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbeLEJgk (ORCPT <rfc822;netdev@vger.kernel.org>); Wed, 5 Dec 2018 04:36:40 -0500 Received: from sasha-vm.mshome.net (unknown [213.57.143.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 734122084C; Wed, 5 Dec 2018 09:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544002600; bh=yjNlL2FoLQbG+m0P1sxh2bkCdfq1pIixvqTUi6yqTa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f+p18QLspmK2NDJBm3aNMpmgEt4NXZVI5PkjKuNp43O1yWbbvYOH9mbE5QNFKxqk+ REkmY2NpQW8h/X6WR7nIJKVqB0Pfg1F/6maicJX2H9f4m9PEMRGLcDRj6lNCiaT6+M FqNtS9qxJ+xASqZlrzSD9lhhYWLk8990faql1PPk= From: Sasha Levin <sashal@kernel.org> To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Quentin Monnet <quentin.monnet@netronome.com>, Daniel Borkmann <daniel@iogearbox.net>, Sasha Levin <sashal@kernel.org>, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 013/123] tools: bpftool: prevent infinite loop in get_fdinfo() Date: Wed, 5 Dec 2018 04:34:05 -0500 Message-Id: <20181205093555.5386-13-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181205093555.5386-1-sashal@kernel.org> References: <20181205093555.5386-1-sashal@kernel.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: <netdev.vger.kernel.org> X-Mailing-List: netdev@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c index b3a0709ea7ed..fcaf00621102 100644 --- a/tools/bpf/bpftool/common.c +++ b/tools/bpf/bpftool/common.c @@ -304,7 +304,7 @@ char *get_fdinfo(int fd, const char *key) return NULL; } - while ((n = getline(&line, &line_n, fdi))) { + while ((n = getline(&line, &line_n, fdi)) > 0) { char *value; int len;