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 3C100A00C2 for ; Tue, 1 Mar 2022 11:46:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30F10407FF; Tue, 1 Mar 2022 11:46:23 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id CFC8E407FF for ; Tue, 1 Mar 2022 11:46:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131581; 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=mx5i1Dc02IvLHYgwNXW2QyRO4CLGUo59C2Iom/mlSrs=; b=V+jm96wITntzCsYAG/oyHHkDW06Iaxpt/gJ0XEeeTCNkDtKn/kd9vg0QDRqNh1kMK0HweW YKq5bEriGXRQ2G1VtDrl3jKWbVjUcNoQkEdcEfcrZcwCWlPCi2zJtHZO5QQboos9EDGdvd 0/dZvvUDP3oLL+3k7UX3stfNxmijJkY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-sue-H8KVO3qnK94HM6EclA-1; Tue, 01 Mar 2022 05:46:18 -0500 X-MC-Unique: sue-H8KVO3qnK94HM6EclA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE2B8814600; Tue, 1 Mar 2022 10:46:16 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF00C721DF; Tue, 1 Mar 2022 10:46:15 +0000 (UTC) From: Kevin Traynor To: Steve Yang Cc: Ferruh Yigit , dpdk stable Subject: patch 'eal/linux: fix illegal memory access in uevent handler' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:42:57 +0000 Message-Id: <20220301104300.334382-101-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/06/22. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/411a43ea5d58e27534b5a7615448b70eaddd93a7 Thanks. Kevin --- >From 411a43ea5d58e27534b5a7615448b70eaddd93a7 Mon Sep 17 00:00:00 2001 From: Steve Yang Date: Wed, 23 Feb 2022 08:49:50 +0000 Subject: [PATCH] eal/linux: fix illegal memory access in uevent handler [ upstream commit 1a287fc9c95bd6245c119b20f07382cf4b8fefa4 ] 'recv()' fills the 'buf', later 'strlcpy()' used to copy from this buffer. But as coverity warns 'recv()' doesn't guarantee that 'buf' is null-terminated, but 'strlcpy()' requires it. Enlarge 'buf' size to 'EAL_UEV_MSG_LEN + 1' and ensure the last one can be set to 0 when received buffer size is EAL_UEV_MSG_LEN. CID 375864: Memory - illegal accesses (STRING_NULL) Passing unterminated string "buf" to "dev_uev_parse", which expects a null-terminated string. Coverity issue: 375864 Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process") Signed-off-by: Steve Yang Acked-by: Ferruh Yigit --- lib/eal/linux/eal_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index bde55a3d92..851789e85c 100644 --- a/lib/eal/linux/eal_dev.c +++ b/lib/eal/linux/eal_dev.c @@ -232,5 +232,5 @@ dev_uev_handler(__rte_unused void *param) struct rte_dev_event uevent; int ret; - char buf[EAL_UEV_MSG_LEN]; + char buf[EAL_UEV_MSG_LEN + 1]; struct rte_bus *bus; struct rte_device *dev; @@ -238,5 +238,5 @@ dev_uev_handler(__rte_unused void *param) memset(&uevent, 0, sizeof(struct rte_dev_event)); - memset(buf, 0, EAL_UEV_MSG_LEN); + memset(buf, 0, EAL_UEV_MSG_LEN + 1); if (rte_intr_fd_get(intr_handle) < 0) -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-01 10:41:04.118987672 +0000 +++ 0101-eal-linux-fix-illegal-memory-access-in-uevent-handle.patch 2022-03-01 10:41:01.484244135 +0000 @@ -1 +1 @@ -From 1a287fc9c95bd6245c119b20f07382cf4b8fefa4 Mon Sep 17 00:00:00 2001 +From 411a43ea5d58e27534b5a7615448b70eaddd93a7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1a287fc9c95bd6245c119b20f07382cf4b8fefa4 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +29 @@ -index f6e5861221..e6f509bcff 100644 +index bde55a3d92..851789e85c 100644 @@ -31 +32 @@ -@@ -228,5 +228,5 @@ dev_uev_handler(__rte_unused void *param) +@@ -232,5 +232,5 @@ dev_uev_handler(__rte_unused void *param) @@ -38 +39 @@ -@@ -234,5 +234,5 @@ dev_uev_handler(__rte_unused void *param) +@@ -238,5 +238,5 @@ dev_uev_handler(__rte_unused void *param)