From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2C58345BB6 for ; Wed, 23 Oct 2024 23:20:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26B9640261; Wed, 23 Oct 2024 23:20:04 +0200 (CEST) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mails.dpdk.org (Postfix) with ESMTP id D50B640261 for ; Wed, 23 Oct 2024 23:20:02 +0200 (CEST) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-43162cf1eaaso3004835e9.0 for ; Wed, 23 Oct 2024 14:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729718402; x=1730323202; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fTpPigm6BIGxSFhQ47RSwkmh/KS0W1mCJ9NUUS6LFzo=; b=Rbcb+9nqF1uKPdSACTBggCLgNCBICp6/u95uxOxCSr/9D9EYCfBGJtiov9qgjZw4TE zTy/nD2mE2WLwk/x7MvnW4J0EJ+N4eyuYih1hMwMyF7OkYETAYhCyEXoAE82PEHGw6p/ g7kWZxwUcF77uIsA/h8XmzpIcqrcM5nJceICtvGxfC4uNjQuFzekhN+1Ad8qOeTpVbLH imRE3iOMyg87T+Iq1IMHjRTxkCkqytqTfHLYyAGg6c6eJIwpBpvvKc0PsQfTYaEpJpMI GiVkGxgY33z8EFEAr/gxcUApREptVEDNmHnnzn4DvNCL5K6A//qVfe4XaIzMZDnOuYNl D3uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729718402; x=1730323202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fTpPigm6BIGxSFhQ47RSwkmh/KS0W1mCJ9NUUS6LFzo=; b=XbU0UoWVcKrNEWKhEvqX64a7krLcippT0CZSbVR/Yln+XM1bDAUV0+9HqCmbm0dmrD heWMFGPbgC9SXYbjksSF0A2UBEwc4/v9ijh6EaUUVuDVIu2kiGW7GB+SKVwCfSc/E07e 998rRWjUIRBQr37NYYiB+3QNND5RXf5cIXCZSk9wHz8JCIGGogR1qTlVTKllq/45t97G kBJY5/kEWvDyYhQK9nmi6JYN3o+RM7s+OaZ0ZO1dizsvZUfC+x71RaJLcFk/Y0I02XlZ eryRHcC+TAK0UNF6hTUJlFWbmWKaG9UGJxKtQJX5JB6u00FXXHF9M9u8BHZLNh6yCJ8v vtKQ== X-Forwarded-Encrypted: i=1; AJvYcCU1Da00rbgavdQHiVfAOD3byR9PCL+mzLxC8tkB7tZYW8DwyP3AoopIRcSeWdc1DM4BJsd921M=@dpdk.org X-Gm-Message-State: AOJu0YwkWgZql+wER6+BFuWIvoOiNCxzCllkaSwe7zI8J2tI7OA6T8R4 I5vWx2HO7SylGGeXcC7P80Edr4dGAf5DSX5diNF61K+Y7xbdSW8D X-Google-Smtp-Source: AGHT+IH7sGB5IHzte0w+NFRm7Voio11l2PUeEb+0rqOKAnFu6d3G7LkkTep4txuV6aadhPlJl8NuxQ== X-Received: by 2002:a05:600c:3b1f:b0:42c:bae0:f05f with SMTP id 5b1f17b1804b1-43184201fa1mr44121255e9.13.1729718402394; Wed, 23 Oct 2024 14:20:02 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43186bd1a36sm26756505e9.5.2024.10.23.14.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 14:20:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Ferruh Yigit , dpdk stable Subject: patch 'net/tap: avoid memcpy with null argument' has been queued to stable release 22.11.7 Date: Wed, 23 Oct 2024 22:16:28 +0100 Message-ID: <20241023211704.1216956-48-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241023211704.1216956-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/25/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/8b8b03abd8b14c9b3d42d2808a02a6161a36ef8b Thanks. Luca Boccassi --- >From 8b8b03abd8b14c9b3d42d2808a02a6161a36ef8b Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 13 Aug 2024 19:34:16 -0700 Subject: [PATCH] net/tap: avoid memcpy with null argument [ upstream commit 3975d85fb8606308ccdb6439b35f70e8733a78e8 ] Calling memcpy with a null pointer even if zero length is undefined, so check if data_length is zero. Problem reported by Gcc analyzer. Fixes: 7c25284e30c2 ("net/tap: add netlink back-end for flow API") Signed-off-by: Stephen Hemminger Acked-by: Ferruh Yigit --- drivers/net/tap/tap_netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c index d9c260127d..35c491ac37 100644 --- a/drivers/net/tap/tap_netlink.c +++ b/drivers/net/tap/tap_netlink.c @@ -302,7 +302,8 @@ tap_nlattr_add(struct nlmsghdr *nh, unsigned short type, rta = (struct rtattr *)NLMSG_TAIL(nh); rta->rta_len = RTA_LENGTH(data_len); rta->rta_type = type; - memcpy(RTA_DATA(rta), data, data_len); + if (data_len > 0) + memcpy(RTA_DATA(rta), data, data_len); nh->nlmsg_len = NLMSG_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len); } -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-10-23 22:16:42.331354752 +0100 +++ 0048-net-tap-avoid-memcpy-with-null-argument.patch 2024-10-23 22:16:40.499942740 +0100 @@ -1 +1 @@ -From 3975d85fb8606308ccdb6439b35f70e8733a78e8 Mon Sep 17 00:00:00 2001 +From 8b8b03abd8b14c9b3d42d2808a02a6161a36ef8b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3975d85fb8606308ccdb6439b35f70e8733a78e8 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org