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 CB9A945B17; Sat, 12 Oct 2024 04:43:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B68D6402E0; Sat, 12 Oct 2024 04:43:44 +0200 (CEST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id B5B2840268 for ; Sat, 12 Oct 2024 04:43:43 +0200 (CEST) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-71e15fe56c9so1914142b3a.3 for ; Fri, 11 Oct 2024 19:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728701023; x=1729305823; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=a7YXIGkc/82Z4t9/nPBjo8sme+RRfF8CRIrJL8j/XwU=; b=dOPpzJ2Qzm+t7WbCYAeE+S0kvxOyq1fMeJiLEcNmPJLDNqX1cR+dapfCFER7hPOVfH jn1y3anuYSmtB2Uw4S7xntDX/lkLee75rm8UrWaEGYyNGY3IaIM8S3hD7GVhkvRf/7Vk Xs0FqO7ROW9f5SRWEnkTigZgjjao3AdOpys8PUTixXev2dFPNp8e3WOpDJPdwqFl9fKC qe5ImfhJII7j4PvZJiJLroD8lqSQXnb3Qu+coakQo6n0N8K64eqf6m5/Jvels7YWwYqM mfR46RbgMjMXTyvhJmpkwaKkGfA72r7yAwtVSk+hySkYd5e3ZqmiVayWatCLK7Zk4+Bg tGHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728701023; x=1729305823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a7YXIGkc/82Z4t9/nPBjo8sme+RRfF8CRIrJL8j/XwU=; b=rzrJMjF5V8tugvqrxC20kDsT7WESYldqYn+/ofcQYWrjqqgmuHwPGzpvW9GwbL/AM7 jt4++emfd1Wl5sQQwUEpR6Dq0pCwlk3jopWFe+csrkXwP9z7c2c1qrx8QZ8sHAkCWEa9 nalaOV1je12iQa9c8tehKV3rvHXA19FoovqAKsgT7aHpHT4siekNkIw0JS6z2sVPxkbW t8Bk/23XROuzWNHMI5zOvsYIces8f2vBmtWo23b2qNnYVRNp5eD7qasm8IdJAe0wzwah qDVQdnk1TsgGY5+DBVCB5YscY1R5Gvdyah9b3odCtuCkH3DUWScMWCn7bIS6JBf+f8ny iIBw== X-Gm-Message-State: AOJu0YwSrQIepya3h7ZnxJ9bGOBdCL+YAHnJeG78zNaIXM7HCUpDcAaQ ZH1ddHZcvockQqhWMrUlWyXdWr1trQZjAHubJkTng57g3U+asr0KMbuMuYz1AwM= X-Google-Smtp-Source: AGHT+IEgYWbGYaowavEsPpXs+1rvPPoKFFKpeHB7STIROez/BwwyuaWMcNgyvkR9q6bSQPsC/SvHYQ== X-Received: by 2002:a05:6a00:3e1e:b0:71e:1066:1f94 with SMTP id d2e1a72fcca58-71e37e48b51mr6589075b3a.9.1728701022756; Fri, 11 Oct 2024 19:43:42 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2aa93b27sm3352960b3a.121.2024.10.11.19.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 19:43:42 -0700 (PDT) Date: Fri, 11 Oct 2024 19:43:40 -0700 From: Stephen Hemminger To: Konstantin Ananyev Cc: dev@dpdk.org, songx.jiale@intel.com, Konstantin Ananyev Subject: Re: [PATCH v2 2/2] examples/l3fwd: fix read beyond array boundaries in ACL mode Message-ID: <20241011194340.65bd8f93@hermes.local> In-Reply-To: <20240730122235.1084-3-konstantin.v.ananyev@yandex.ru> References: <20240726194302.920-1-konstantin.v.ananyev@yandex.ru> <20240730122235.1084-1-konstantin.v.ananyev@yandex.ru> <20240730122235.1084-3-konstantin.v.ananyev@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 30 Jul 2024 13:22:35 +0100 Konstantin Ananyev wrote: > From: Konstantin Ananyev > > With commit: ACL mode now can use send_packets_multi(). > What I missed with that changes: send_packets_multi() can't deal > properly with input dst_port[i] == BAD_PORT (though it can set > it itself), as it uses dst_port[i] values to read L2 addresses for the port > and assumes dst_port[] to contain valid only values. > To fix that just add a check that all dst_port[] entries are valid before > calling : send_packets_multi(). Otherwhise use send_packets_single(). > An alternative, and probably more logical approach would be to > re-arrange send_packets_multi() so that it updates L2 packet headers > at the very last state - when dst_port[] are finialized. > But that would affect all other modes, but that would affect all other > modes and will require much more code changes and testing. > > Bugzilla ID: 1502 > Fixes: aa7c6077c19b ("examples/l3fwd: avoid packets reorder in ACL mode") > > Reported-by: Song Jiale > Signed-off-by: Konstantin Ananyev Please fix spelling errors in this version. WARNING:TYPO_SPELLING: 'Otherwhise' may be misspelled - perhaps 'Otherwise'? #71: calling : send_packets_multi(). Otherwhise use send_packets_single(). WARNING:TYPO_SPELLING: 'deined' may be misspelled - perhaps 'denied'? #121: FILE: examples/l3fwd/l3fwd_acl.c:1042: + /* bad or deined by ACL rule packets */