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 E4698455AC; Sun, 7 Jul 2024 04:13:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D258E402E7; Sun, 7 Jul 2024 04:13:00 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) by mails.dpdk.org (Postfix) with ESMTP id A155E4026B; Sun, 7 Jul 2024 04:12:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RJIBzYQTbMG4Fj59adZTQi+9szAB5I7630WBzdEiaCdJniA0lqV/mFQ5e9Ap0mnexqzvlkFzrkALUvXclDIcd5I1rabFXE3wLIIb9TmNzLZzUs2iEAWCE+zzOhO5jBq1JM7FNZ60iXqKY/1+kJTbYRDImYvrFu4IBCrhM7oJ6Wz8gaZv6w9mJNI3vnSU7EagIPiudtou5azaWcFSt8NMH0ZgHnJo5qI9mcoVOJ3sJOpPE2oPRyTpUmPcR8pkQAfb98YQAC70njva0+x44FN6ejsP8+WrCj5eHAmrkXRbt5IvCWYmTOg5AChLLMtnvLPgHbtKIs4qwnLNSNG18lTGgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JQK6OU6WrdhoREqWG4Rv/RWbd/ehdq0GStJIcyxxF0Q=; b=jpeGVwv42zTn3knaO4Ig7ZA/CgNgTKmHZjOcxw+hOfNG8nygvuYZGY1WpZ/5LMPEYc75BM7gc+7fPzgyE5ICFQ2wjE4wQF2lfNtWDOgqGHpcQ2nk7ww96RUraPnsk2etU26oZstLbF1oiJbr+SztOUQ3lY/fXleWvpy36uMSPRhJUD9l0GhN5UweIwTvu1i4AhYvTHcMKf2slu2Uigt+PuoiZd1OEyA2ElbiOAm2faPJRCEb1Pz83r4Z52nuWKGA6MTWRafqN+Rh7Mvw7R6WpnVpnOrMao15hP8r4T6rrdQLF8GIfnhSRnkgCq4Nh/daO7mYOuUiMIVPGTrxkx+dKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JQK6OU6WrdhoREqWG4Rv/RWbd/ehdq0GStJIcyxxF0Q=; b=S1AkOO2Tp2+Hyx8sG6jfWxiFzl27J519px4QdMeFz5XGztDF4lQqaeepICefiYwQuBLAA4yTqcGVmAxYDNTrv79+qq/2q1qrNtpDLmY6Vtx219Pwhx1fijldE0+OBa91CHb9MPZfXnw/aIT3uXtztjonk4R1WNP1cBa2D9vZObI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SJ0PR12MB6783.namprd12.prod.outlook.com (2603:10b6:a03:44e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Sun, 7 Jul 2024 02:12:56 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::ebfb:2f9f:f9ca:82cd]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::ebfb:2f9f:f9ca:82cd%4]) with mapi id 15.20.7741.031; Sun, 7 Jul 2024 02:12:56 +0000 Message-ID: Date: Sun, 7 Jul 2024 03:12:51 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] net/memif: fix buffer overflow in zero copy Rx To: Mihai Brodschi , Jakub Grajciar Cc: dev@dpdk.org, stable@dpdk.org References: Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6UdcP/0/kEp49aIUhkRnQfmKmNVpcBEs4NqceNCWTQlaXdE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 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0030.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::15) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ0PR12MB6783:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ece046a-72d0-4183-d1f4-08dc9e2a50c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Ym5VNDFTa1k0SHpUeldlTWZHakNFK2laY1lON2Y4YTJlQkdFc2lrQ1hvdzhF?= =?utf-8?B?bC9sVHUzWFo4YWZwbzA1R2hqQXY2Zk9ocHZWcUJaK0JSOCtrRGkxeUIvNnpC?= =?utf-8?B?bXVpbkF1T0tjNmUvQUNPZTQ0U08zaFlYN0RVOW92VCtoWnlwVmRabXY3MTBl?= =?utf-8?B?Qk5NNW50cUhkZXZtaVRMa0tIQWgxTVYwT0tjcFZDbXBuOE1oeThOczU3dWUx?= =?utf-8?B?MTdDZHgrYlJrTXdEMEJPMUQ2aUxPRVFFakVmeHVSY0s1eVozR2hZbVp2eGxw?= =?utf-8?B?SjJ4MXhtNjc3ZVkwdUVyWmcvR1dWeXI4WEdZU29IUk5xZFdMVXpBblpFekRI?= =?utf-8?B?aXEwL0EreWxJSGNUMG1UbllSRkNJdm9qeWZUYXNRaC85SE84RGlPek9GZHBT?= =?utf-8?B?QzR6TnhGQXlIU3FvbmRjeTBOZ3Z0NGNYK1c1bk9sV2hWVDBtZ0xlMFUrTjBS?= =?utf-8?B?a21qUU9XMlg1S29nWUtrejZXNS9UNzlsazF3bGkxTDVpbnI1R3lBaVlKZmll?= =?utf-8?B?VUxKRjZFazJSODBUakFnN01XbFljQXVjbDRhdW5ON0tLcW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WdBOExlTk16cVdyaTd4NFNjMEo2?= =?utf-8?B?MlRQdTNvMmM0MExOUDNPckhpd1VGM1JwMmtNYXlUV0ZXVDBNdURMUWRvUWpW?= =?utf-8?B?NC9POHVKcDJSSmo1K1ZQQk8vZmZnOWRyWDRSZGF5R2RwN0NSUW0xQlZDNk9G?= =?utf-8?B?MHRHdUxKRllmMG0xVUVDaC9UdUNFZ0dFdnB5YTlhVDQvZDNwNm5abWJHSFFP?= =?utf-8?B?WUtueURodkhYeUJ5c29qckR5c2tsN3ZhbUpVd2MzYkQzSXNNZ2NWMGJJZ2RI?= =?utf-8?B?bzE2RXlvblF6S1lVeXhQZGxjVDZ3Q2hkaHhteHRyT3J6dVdJV3U4d0dBK3g0?= =?utf-8?B?ZFV0Q01YbFZJdy9uR3VBUT09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?REQzY0xVR21oL1JtNjFMNVB1bzhkc3VjVENBUTdUTWVNNlgrMGpwaUNlUkJ3?= =?utf-8?B?T25kMUJ5YWpYdHE2QWhodjU0T1d3eE9aS1U2cUFrc05XTnhOOWFXMUdkVWhK?= =?utf-8?B?cm4xRzVDbDlSZ3ZwYk9YamJEM0NPMkxVVEFyZkl2aXNTVmIwU0ZkNUZCK3ZT?= =?utf-8?B?NUdyN21iWFVEV3lzRng2blk1ZktGajhoR0hpdm1NZkJ4cUxaUngybVZzQW9N?= =?utf-8?B?bThrSGkvT0gzRFRMZnAyL2VwS1lKQVpPV0FSWlMvMlJKdWJLVXB2bkZPUTBx?= =?utf-8?B?bkFGdFhZbGhKRzV6aUFDMC9PNjFJMFFaTExEWEhldm1ISVhLUWVBZk9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?bVBZjI+NjlPHm6cR6XSrhxEg4?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ece046a-72d0-4183-d1f4-08dc9e2a50c5 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 02:12:56.2307 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MJl8XgcDLP3XQAbV6dXjj3cB3lmfBCpi+c1G2WYPcHTVju/Oyj8pQ6To7ahHKipM X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6783 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 6/28/2024 10:01 PM, Mihai Brodschi wrote: > rte_pktmbuf_alloc_bulk is called by the zero-copy receiver to allocate > new mbufs to be provided to the sender. The allocated mbuf pointers > are stored in a ring, but the alloc function doesn't implement index > wrap-around, so it writes past the end of the array. This results in > memory corruption and duplicate mbufs being received. > Hi Mihai, I am not sure writing past the ring actually occurs. As far as I can see is to keep the ring full as much as possible, when initially 'head' and 'tail' are 0, it fills all ring. Later tails moves and emptied space filled again. So head (in modulo) is always just behind tail after refill. In next run, refill will only fill the part tail moved, and this is calculated by 'n_slots'. As this is only the size of the gap, starting from 'head' (with modulo) shouldn't pass the ring length. Do you observe this issue practically? If so can you please provide your backtrace and numbers that is showing how to reproduce the issue? > Allocate 2x the space for the mbuf ring, so that the alloc function > has a contiguous array to write to, then copy the excess entries > to the start of the array. > Even issue is valid, I am not sure about solution to double to buffer memory, but lets confirm the issue first before discussing the solution. > Fixes: 43b815d88188 ("net/memif: support zero-copy slave") > Cc: stable@dpdk.org > Signed-off-by: Mihai Brodschi > --- > v2: > - fix email formatting > > --- > drivers/net/memif/rte_eth_memif.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c > index 16da22b5c6..3491c53cf1 100644 > --- a/drivers/net/memif/rte_eth_memif.c > +++ b/drivers/net/memif/rte_eth_memif.c > @@ -600,6 +600,10 @@ eth_memif_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > ret = rte_pktmbuf_alloc_bulk(mq->mempool, &mq->buffers[head & mask], n_slots); > if (unlikely(ret < 0)) > goto no_free_mbufs; > + if (unlikely(n_slots > ring_size - (head & mask))) { > + rte_memcpy(mq->buffers, &mq->buffers[ring_size], > + (n_slots + (head & mask) - ring_size) * sizeof(struct rte_mbuf *)); > + } > > while (n_slots--) { > s0 = head++ & mask; > @@ -1245,8 +1249,12 @@ memif_init_queues(struct rte_eth_dev *dev) > } > mq->buffers = NULL; > if (pmd->flags & ETH_MEMIF_FLAG_ZERO_COPY) { > + /* > + * Allocate 2x ring_size to reserve a contiguous array for > + * rte_pktmbuf_alloc_bulk (to store allocated mbufs). > + */ > mq->buffers = rte_zmalloc("bufs", sizeof(struct rte_mbuf *) * > - (1 << mq->log2_ring_size), 0); > + (1 << (mq->log2_ring_size + 1)), 0); > if (mq->buffers == NULL) > return -ENOMEM; > }