Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2056001rwn; Fri, 9 Sep 2022 07:58:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR46wWpoV6z9HFHnxRBS/yHC36ulzxZP5iwNo1vMCCdDoybtEOJmVCxdQosEnIDkv7+KZYk3 X-Received: by 2002:aa7:da86:0:b0:44e:91c8:eb4f with SMTP id q6-20020aa7da86000000b0044e91c8eb4fmr12393650eds.252.1662735500393; Fri, 09 Sep 2022 07:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662735500; cv=none; d=google.com; s=arc-20160816; b=thpxdnEiX73V8Q8C1gWnCZ1YRea5F6lOM2bdh4TBzFwYITvUPee4n7aeXk9UF+MXJT /Df5uMqYQp/2Bda3rihjNW2k1rRX/QipCMTGL9FiqFcZlaEZIO5r7ROfL+LOJQqTUyA3 XuJRqovNavsdzxl7GC3wxQSM5hxZ4C6pcmU069Z7RonrafL9iXjx3W0EyhwFH4enlEQ/ PJnnQWrG0rDBqhRcxgMBYJTkA1DNlSwjQMD3278+pQHCIxcdKxJkoD1fRhHMOEQGIIjJ xC5DMKop15O7WWG5ocX7VnGQ4XapPbNXwi738gJ1DlYiKiOeGlUriuB22pCouZU1AqFc Hk+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6lhLlhxfOjgL1Bth9mcHIlbp3cpWG9g9ba2QTnmM87s=; b=EDUPrBm9DudsREsDN/eX0eK5LGjRUAfyYgrVyRqpxY0ClRWzQE4yy8+8pMlX1IDOOS bXwA92ExEc6bXusCTs96mCsRaLeXZ80OOkex7lOsogh2DQX4VN63xn/gP3iRU7ekQcBS ZoiwM3MKUCIYtGmgp+xxgY5qDY5BT8+5Hyqvx2Uw261wPsoCHD+nmQa1A6xdnc3NpEUQ Ct54f8rVP4iidab9sSB7FpxmkgGd0mp4+C1lfW8lAlpk3pU72hBhfz032uFHM720pL7f g1gBaCc40kAq8Xfx6zumyRUh6RBJTSj8F94aWaH2W+9vH4jm4xcF2nMjrp9XSGCmLVTD 36TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MuhQoyzR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a17090631c900b00734bbe8d2e1si559214ejf.545.2022.09.09.07.57.54; Fri, 09 Sep 2022 07:58:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MuhQoyzR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231924AbiIIOmU (ORCPT + 99 others); Fri, 9 Sep 2022 10:42:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbiIIOmS (ORCPT ); Fri, 9 Sep 2022 10:42:18 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C84F910B577 for ; Fri, 9 Sep 2022 07:42:17 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id k80so2966292ybk.10 for ; Fri, 09 Sep 2022 07:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=6lhLlhxfOjgL1Bth9mcHIlbp3cpWG9g9ba2QTnmM87s=; b=MuhQoyzRTIr3sfU/R4tTPiPkiQTsnKI3UW/13xM3MteEEpI551whUSdSH412BQuKJK iU72F+nL8NcYglUCNx6A46k1JZ2tCh8GZQ1ISveNfPYBuaavJPBoAWmo1ehKLq6cH9wZ wb2YWKAyx+07CoDHzFr/sg5AiB2a6XAPL+TOICqjPRqtLm4vzMyf2gVLrtDOhCtpfEtG JoQ4Cm899e6YsN1HzPfKltu49VsE3ILRCdllduAZ/wJQ4i+39TIgqogMyjh9tytNTUUB lH122hho5jt8tc560VsFVoIxwTfpoOTo30C0ZFUiY0GN8hoI0/KdT1wB6ZH47KQ086+e sEPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=6lhLlhxfOjgL1Bth9mcHIlbp3cpWG9g9ba2QTnmM87s=; b=kYHswg7vy84zoqYudzueqrG4+YF9IG77BtLi/Q7nNXpyqIEHADzzFzLAq/fyoylWHz 9AzLCQ3OSw5FKAUvekBli1jtUhHQ9nmQJ5EVUdc7GssQ4FGEY/CMfqNooEi1Ei/jMUzW bnEcwGV3jnYVB/FZCEoRKdQHN5eF+vkZlI5c+9OWg9IFz4j3k0wQRyY1m7xpsuo+muzI dYN9Y01sz+9bZyc8I/R+DnvYXI3zKCGa/qQTKCUhFPK57C1Ry8GICBShQIdOTOnnQlDB S7dfCWO252yKEdiBBmkLMdNf6B9QgVEEKcRA2u1nTRuNLPi8uDjf8CaWaDXZXhoz+40E fQ4g== X-Gm-Message-State: ACgBeo3ghAO1ZT7D02LNV2qbZ4ggF6uWbuGK/2nRqsZmKmgR/gHZVpjU A373ieoMzZbQ9YpyNDVIB0Nc+lmtPmNerSeIfRQvQ/7Sw+E= X-Received: by 2002:a5b:c92:0:b0:688:436c:b2b with SMTP id i18-20020a5b0c92000000b00688436c0b2bmr12028529ybq.436.1662734536565; Fri, 09 Sep 2022 07:42:16 -0700 (PDT) MIME-Version: 1.0 References: <20220909141338.19343-1-namcaov@gmail.com> In-Reply-To: <20220909141338.19343-1-namcaov@gmail.com> From: Nam Cao Date: Fri, 9 Sep 2022 16:42:05 +0200 Message-ID: Subject: Re: [PATCH] staging: vt6655: fix potential memory leak To: forest@alittletooquiet.net, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I did not realize this initially, but this bug can cause more serious problem than just a memory leak. In the case that kzalloc fails right from the beginning with i=0; then in the while loop, "i" will wrap around and the code will access priv->apTD0Rings[4294967295] which is obviously not good. Best regards, Nam