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 689E1A034F; Sat, 5 Feb 2022 18:21:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C52B340E09; Sat, 5 Feb 2022 18:21:44 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0046D4069D for ; Sat, 5 Feb 2022 18:21:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644081703; 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=IwJUC2zJan3rH1bflNwaPN+xFVA4twICtUEAR79A4yI=; b=RZnH+Rs/gEiREzjBkgVp2IbAbikCUMuNS7BNDEjg3/EbYBfs2z3oyj4ekMx0a1fEANrtJs 0w0VVmPjuRtqjCSyJec/avGJgRcH2O5WzrlateWk2gXoG2+1jlBp2eocLLQubwUdkIWZkO DN2w2KSZY+0OJSeWP6XI0ZmQEaDHqcY= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-izyOVbY6PZ6J_sO_ZnXQ_g-1; Sat, 05 Feb 2022 12:21:42 -0500 X-MC-Unique: izyOVbY6PZ6J_sO_ZnXQ_g-1 Received: by mail-lj1-f200.google.com with SMTP id b14-20020a2eb90e000000b00243a877827eso2367547ljb.23 for ; Sat, 05 Feb 2022 09:21:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=IwJUC2zJan3rH1bflNwaPN+xFVA4twICtUEAR79A4yI=; b=BdLJXZjtr+MSJbv0kLg1JPfPVOfkoePSFSx2YrN6BZs7cTKI7FPl51xfN97lxrvo5I cEqUGq2GPE/78WPP0BrcA/p5m2JXWsbu/tF6zVE5pU9RioGu2ZQ4gVtRS0897b/xcj0d qHxtnwFseH18AI71b11fenUVEPYHD+jOpWzYXPpalWBXNoRkauYF0jKAHvskWjyRN1z1 9JklzwnsMxmvn6O3a4DImnPP2Okkra7YS/KIJx6S2qUr36WP8BCnIaveDgi0yfDiYnMj 3j70Z9fnDV8oR9UmFj1iD9AIhbynGo481HFW1Kkx/PxLEZ8S1UKq7uCjdAEewidWY8ue 4cgg== X-Gm-Message-State: AOAM532cE6Pjgmryk0km4HhYtwO3vJqFhtboo4ClQgiQcCsYaaQpFcW/ Hnq/olg2cQccpr+QSnpI8w2YowsviUMyT/ydw9HQ3//7M0dEEQtu3w+1lo3ZoFMJvuUfmgbHzXA BYedm2fuiw2ktEVxkSsc= X-Received: by 2002:a05:6512:3b90:: with SMTP id g16mr3167649lfv.575.1644081700639; Sat, 05 Feb 2022 09:21:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5lguV+oYooYGugBMip7ltkmo2ztpr8pPN40ZkoRg/O3LXlPlhIFf0ZVpIj4KiQK8pDr2jlXW6Uolwk/MB2aw= X-Received: by 2002:a05:6512:3b90:: with SMTP id g16mr3167633lfv.575.1644081700347; Sat, 05 Feb 2022 09:21:40 -0800 (PST) MIME-Version: 1.0 References: <20211214033016.29927-1-wangzhihong.wzh@bytedance.com> In-Reply-To: <20211214033016.29927-1-wangzhihong.wzh@bytedance.com> From: David Marchand Date: Sat, 5 Feb 2022 18:21:29 +0100 Message-ID: Subject: Re: [PATCH] ring: fix overflow in memory size calcuation To: Zhihong Wang Cc: "Ananyev, Konstantin" , Honnappa Nagarahalli , dev , dpdk stable , liangma@liangbit.com, =?UTF-8?Q?Morten_Br=C3=B8rup?= Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, Dec 14, 2021 at 4:30 AM Zhihong Wang wrote: > > Parameters count and esize are both unsigned int, and their product can > legally exceed unsigned int and lead to runtime access violation. > > Fixes: cc4b218790f6 ("ring: support configurable element size") > Cc: stable@dpdk.org > > Signed-off-by: Zhihong Wang Reviewed-by: Liang Ma Reviewed-by: Morten Br=C3=B8rup Acked-by: Konstantin Ananyev Applied, thanks. --=20 David Marchand