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 DFA874705A for ; Tue, 16 Dec 2025 17:12:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D91C64026D; Tue, 16 Dec 2025 17:12:11 +0100 (CET) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by mails.dpdk.org (Postfix) with ESMTP id 42E01402EB for ; Tue, 16 Dec 2025 17:12:08 +0100 (CET) Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-8ba3ffd54dbso685395985a.1 for ; Tue, 16 Dec 2025 08:12:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytheb-org.20230601.gappssmtp.com; s=20230601; t=1765901527; x=1766506327; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=IOQddjoZSW76ZhsLzga4V4e11xd9UIIR0TJWyA+cNis=; b=XNvxyrHW6wfH6cNfuXz4UJjWIBYR5biqrzyv0OmjvDdFf9Nb41qbu0pZiX2TDQ6Gti ZoxVsmghDdon8eB6xezaQuJjzDOc/h2/9vWvbmBlTZ1NzxW42l0CK3+VBMhHhsFKp5qB oiZl0/l96FTC1O9YlkVi/INwGMbrWm8wRAfCwzRI35Y3nixE1MW7ZWOOTDebaSKnU6N1 EUV9oOkQ9ktm1llKt+1p4Wo3KGwLOvbJ5UEJkSqV7BVdE+EXiinl6sNNmtF0CqWLR98F d0OgLlGkg3rBocHJYHabe7EwNvBcb7rc38CTiipFtt1HffNNtfvLiQAhOavtGeUJ5Tiv y4Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765901527; x=1766506327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IOQddjoZSW76ZhsLzga4V4e11xd9UIIR0TJWyA+cNis=; b=SlEpVtF3JToXDNm/ckwXXjByQVgTg1VNm+vuGr3g9KOm4Sa1vfoVhWRF1YWAhjC8xp Buh+8Z80joG45ljRD9yR/8f0zmoMYN3o3eqzt0tFHUfRQ3IFAIFgX74X3C0z+O8Uj8xW fWz/neOJVYi2fAhxToPpik/QhwM9rEwUeGP5FverhNoYVF39UjIuIGSpEKo8It3XeRFp g34UYdb6WNHZr0zBH6ruAY4ag45bx67RR+6ThDzs+9b1RDmHEwYgCfp8iOIvkALd8U4t qpt75XFtO5F9rs2yoV5Ox4gyZjpjTWYyv/oLdRe/iqJsOC4En6EfZ0Lxmue3JA6ymcLp g8Qg== X-Gm-Message-State: AOJu0Yy/2+9Xxh8ahclLbAlC6hBGfvp/FD2bVRlbDPu1RFqye4ivkVWX 8vP859SbA6HOZLh35ZFPhlXVExWdm6ygfUn53aatQN57z/6DHxynAXcqWsKMAR3nbPs0mioCPNt fmShi X-Gm-Gg: AY/fxX5l7EJFxtwKxVw9NbtCL3uuEaK1LOvDrHOyhV+eKmC2phDuDWlJRxGXdDmWRKn +mEoMoMLScTBCP3US12a+7VbALqqr8KQE3CNFQ+QnweTxD+kEii6A9hp8+NrMUSZgQCOPzyFK98 EYmtw2ChM36b1Kskgyfs50EwbIOyJQ5c8YLUsTzSWfQNkRflBZsuoBferNQJMYJAY0HXkmV8Xz8 SO3PyAz84nMGFImvgaGQW5sBU5tHGFhW2/csguRONTIfhn3YRi1HgyprXc0lsC+xu5bi1q+Xyb4 XIyF14XeVVS4yiHvF0diwz3ICBWBg92FNRRINRgt4LVFUWcxtSC257TNEIjIiklINDE3Q7dZ4wH 6u9Kp0dkLyELI2R6isYnd6jyFtXeNYSSpt9CA6liidqrPIqZiuN8xRTWjbpGiU04AyP+zfjX3ed z8ldtGTPvszE560nooOg== X-Google-Smtp-Source: AGHT+IFvEOKTtZvWAJdlUFGVd7DilRN/+qfWHzv/v33xsIhsDx5q3XryS530liXMZQowF7WrFH2OuQ== X-Received: by 2002:a05:620a:1998:b0:892:10cb:b427 with SMTP id af79cd13be357-8bb3a3786d6mr2013695385a.67.1765901526861; Tue, 16 Dec 2025 08:12:06 -0800 (PST) Received: from RHTRH0061144.redhat.com ([47.14.5.10]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-88993b433a3sm76832666d6.12.2025.12.16.08.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Dec 2025 08:12:06 -0800 (PST) From: 0-day Robot To: test-report@dpdk.org, Stephen Hemminger Subject: |SUCCESS| pw159215 [PATCH v5 04/17] graph: avoid overflowing comment buffer Date: Tue, 16 Dec 2025 11:12:05 -0500 Message-ID: <20251216161205.762486-1-robot@bytheb.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251207191242.165619-5-stephen@networkplumber.org> References: <20251205022948.327743-1-stephen@networkplumber.org> <20251207191242.165619-1-stephen@networkplumber.org> <20251207191242.165619-5-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: test-report-bounces@dpdk.org Test-Label: 0day Robot - Claude SONNET Test-Status: SUCCESS http://dpdk.org/patch/159215 _AI Review Comments Available_ git sha: [commit SHA not available in patch format] Author: Stephen Hemminger Subject: [PATCH v5 04/17] graph: avoid overflowing comment buffer The library builds a pcapng comment to put on each packet but the buffer is not big enough for the largest possible graph node name, etc. Change to use asprintf() to allow any string length. Note, if asprintf() fails it is better to still log the packet without comment so no data is lost. > diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c > index 08dcda0d28..602be79ced 100644 > --- a/lib/graph/graph_pcap.c > +++ b/lib/graph/graph_pcap.c > @@ -194,7 +194,7 @@ graph_pcap_dispatch(struct rte_graph *graph, > uint16_t nb_objs) > { > struct rte_mbuf *mbuf_clones[RTE_GRAPH_BURST_SIZE]; > - char buffer[GRAPH_PCAP_BUF_SZ]; > + char *comment = NULL; > uint64_t i, num_packets; > struct rte_mbuf *mbuf; > ssize_t len; > @@ -207,19 +207,22 @@ graph_pcap_dispatch(struct rte_graph *graph, > if (num_packets > nb_objs) > num_packets = nb_objs; > > - snprintf(buffer, GRAPH_PCAP_BUF_SZ, "%s: %s", graph->name, node->name); > + /* put a comment on all these packets */ > + if (asprintf(&comment, "%s: %s", graph->name, node->name) < 0) > + graph_err("asprintf for comment failed."); Will comment remain NULL if asprintf() fails? The function continues to use comment for packet capture even after asprintf() failure, passing NULL to rte_pcapng_copy(). > > for (i = 0; i < num_packets; i++) { > struct rte_mbuf *mc; > mbuf = (struct rte_mbuf *)objs[i]; > > mc = rte_pcapng_copy(mbuf->port, 0, mbuf, pkt_mp, mbuf->pkt_len, > - 0, buffer); > + 0, comment); What happens when rte_pcapng_copy() receives comment as NULL? Does this function handle NULL comment parameters safely? > if (mc == NULL) > break; > > mbuf_clones[i] = mc; > } > + free(comment); Does free(NULL) behave correctly when asprintf() failed and comment remains NULL? > > /* write it to capture file */ > len = rte_pcapng_write_packets(pcapng_fd, mbuf_clones, i);