Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9934150ybi; Wed, 24 Jul 2019 12:36:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwQHAs2GH2lY+lUJTJY4AJxaKoAjjGRXrRLZOOpMUUnPBLLAwEBpMrRTmCrjxvWuZn82WN X-Received: by 2002:a17:902:8509:: with SMTP id bj9mr88156668plb.79.1563996960174; Wed, 24 Jul 2019 12:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996960; cv=none; d=google.com; s=arc-20160816; b=Pzeh2C2X1pHsQYevtwjgg4Esa6vDWoxNUb7nRIfc1Y7CuhioXa49FpTZgBrvUdrKGB rpZrt788ao6704c5tzr9lhq3+4VJdLYwMRYmAT3oh3z4eIFh9AU5EJl1I4CUZgQQr9rI J6PEW7mVBc5lxP2tCTmMUAheG9oqnx16R2W9gP8zDjV1bOidaOxdf6qtcDK1KvcVcB9n K1uYu1A/OLz72n4vucci9m+2ar7leTgvWOJoy2wHOImYiaqfnazgioo8+10i+PlKFdRI mKINK3aQG+g2Uk/dFYppaxjl4UBQ8ZZUh9LKBj0MuukXcTz5GgzihS/OwXRtIFWGpG8S cVig== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6J4CbS8+f8ZsJmuftyjl8p/heGLa6MiPf1DaJo44V3w=; b=eqOAKpwUXxkTCm3abuLHUormNIsQJlPT44Q2yMe/dnYNAMKtV0gzfd65uHeW0hnU39 lPnM+LeX/2OejLwN6pL796RpERfs0gtCyzlGIjtVVYjzxAxDicb+YITROyRWzTQGlBbi hyd0WfsZeBxF0OiNg2r124cqoHQ6i/TyHdTVe5L9b6tjMUKTXPmct5QfFCjdAKyJ0WUB RNElS1e8ZkUFR9SnAwruU/QpO9m9LT0doO4J7pLQ9zwx86wMEztv6QWZj8eEbI5zdjey KPK/X7SVNO0QwKyB8NSfsS5a0qto1i69y1+EvtZu7fPE6SVeiOFtYvbQevrjt/taFDbt EWMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FHL0ZTmM; 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 d12si14798227plo.68.2019.07.24.12.35.45; Wed, 24 Jul 2019 12:36:00 -0700 (PDT) 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=FHL0ZTmM; 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 S2389104AbfGXTen (ORCPT + 99 others); Wed, 24 Jul 2019 15:34:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:57292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389095AbfGXTem (ORCPT ); Wed, 24 Jul 2019 15:34:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 DB9F720659; Wed, 24 Jul 2019 19:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996881; bh=1Nh50vKEexZMWd+KixQL71kdPX+j490QmeNW7ODNh1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FHL0ZTmMvbx+Z3/v7xNDFeiEPzBAk8bOeFHmAADFxxAzMUOKRctkP2gFfJhU5GP6f aA/gXeRlqOVaI6Ed63A8CkikGGhNKVgQ7Ignv9qlM4Y9YAU6Qx1axoggrT/4ROujCr /VFZuGpclCY0nMm7lyQeaqCHN/f+dQnUKpZ3Ny7Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Magnus Karlsson , Andrii Nakryiko , Alexei Starovoitov , Sasha Levin Subject: [PATCH 5.2 247/413] libbpf: fix another GCC8 warning for strncpy Date: Wed, 24 Jul 2019 21:18:58 +0200 Message-Id: <20190724191753.239368712@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 763ff0e7d9c72e7094b31e7fb84a859be9325635 ] Similar issue was fixed in cdfc7f888c2a ("libbpf: fix GCC8 warning for strncpy") already. This one was missed. Fixing now. Cc: Magnus Karlsson Signed-off-by: Andrii Nakryiko Acked-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Signed-off-by: Sasha Levin --- tools/lib/bpf/xsk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 8a7a05bc657d..ca272c5b67f4 100644 --- a/tools/lib/bpf/xsk.c +++ b/tools/lib/bpf/xsk.c @@ -562,7 +562,8 @@ int xsk_socket__create(struct xsk_socket **xsk_ptr, const char *ifname, err = -errno; goto out_socket; } - strncpy(xsk->ifname, ifname, IFNAMSIZ); + strncpy(xsk->ifname, ifname, IFNAMSIZ - 1); + xsk->ifname[IFNAMSIZ - 1] = '\0'; err = xsk_set_xdp_socket_config(&xsk->config, usr_config); if (err) -- 2.20.1