Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2354654iob; Sun, 15 May 2022 16:32:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoyAVx+Q/fjaTuugT0142/JG4vMkGPzgzqTI/l41LGxbb2/mgUjFpHv4MTD8SUt7O1Vo7w X-Received: by 2002:aa7:d619:0:b0:42a:af7b:eda7 with SMTP id c25-20020aa7d619000000b0042aaf7beda7mr3244018edr.235.1652657532591; Sun, 15 May 2022 16:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652657532; cv=none; d=google.com; s=arc-20160816; b=sZ1J98Pv7yt/eqrNAXMBUH4/FR0FtLNpkojGTzDRoeMPg2n0ySPoT0w6AtZNhEOQVt JzXBdnwMFTp/kjrJPM91Eyt+Cx4WfOsF5nbQXwVs1gL6X7IrK4w2hpgNZMvookloanRZ 2CB2hiIiKrjwRdpXE0W1+2jmvKHRCGTtPHRyGhJHSB9RM+hbWlFLQFiwPQrsqFEtlSQO ZUW432hprzVt7tCatUFSmMNUYjjRvQxatxuFXVlYbJlpJhxtp8/DTJU6FmHpFw2piAM1 kinVNVkZ9YgpSqn3JPe/mdQy81tfBkf7+qwPKNnXMCOL6rtB5mniF1nsnEtIIpKJQaqb 1Prg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from; bh=Wj3dHFP87QvgAMItXCj+/F+AR0VHgUzczTu9FkLK/mg=; b=EuBB7Qz5xf2tLGJq/LRpQJ00AovHsww8eR2U80xj3+Y1DdV/e0BhW1Zl5CR8BWY+B6 x1tXFf4DyoTme+9vO+vTf7CkmMZAGfwIlpzF4w99H9uFI+dSpqTkY7ywIRrsCMLLnbh+ ZzF110MjosLOpwbK3lLUc25DE65iQdqsn5l12/XkvOiTQFy3cXovBBsDl0x7TYYt8t1Z vzcHWo1OpYlJFBeuiuplYaj3UDQk70kInOc5R+hO81TXEbZgZMQq40dkQCEFTo60xuVR mZ3/h1kUzBGzDueZEiHS+X62zp8ZfooiuGbVWjtQQUnnC1y26qXc1B5gk2P0Vr8K2Kgw rwKg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020aa7d58c000000b00425c1092266si7816164edq.86.2022.05.15.16.31.17; Sun, 15 May 2022 16:32:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236281AbiEOKOs (ORCPT + 99 others); Sun, 15 May 2022 06:14:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236241AbiEOKOe (ORCPT ); Sun, 15 May 2022 06:14:34 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2045A393D0 for ; Sun, 15 May 2022 03:14:34 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4L1JCC4Hgsz4xZ3; Sun, 15 May 2022 20:14:31 +1000 (AEST) From: Michael Ellerman To: arnd@arndb.de, alastair@d-silva.org, ajd@linux.ibm.com, Hangyu Hua , mpe@ellerman.id.au, gregkh@linuxfoundation.org, fbarrat@linux.ibm.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org In-Reply-To: <20220418085758.38145-1-hbh25y@gmail.com> References: <20220418085758.38145-1-hbh25y@gmail.com> Subject: Re: [PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu Message-Id: <165260953458.1040779.9899337864192630526.b4-ty@ellerman.id.au> Date: Sun, 15 May 2022 20:12:14 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 On Mon, 18 Apr 2022 16:57:58 +0800, Hangyu Hua wrote: > info_release() will be called in device_unregister() when info->dev's > reference count is 0. So there is no need to call ocxl_afu_put() and > kfree() again. > > Fix this by adding free_minor() and return to err_unregister error path. > > > [...] Applied to powerpc/next. [1/1] misc: ocxl: fix possible double free in ocxl_file_register_afu https://git.kernel.org/powerpc/c/950cf957fe34d40d63dfa3bf3968210430b6491e cheers