Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2366277rwb; Mon, 19 Sep 2022 04:11:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/avtB/YdQ1fDiyZDPxXfav30lwyEmDF39QMiWXdETzFsRSUSF2HEMmghk7+wCFsU6NliV X-Received: by 2002:a05:6402:914:b0:451:22c5:2e28 with SMTP id g20-20020a056402091400b0045122c52e28mr14928226edz.294.1663585903162; Mon, 19 Sep 2022 04:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663585903; cv=none; d=google.com; s=arc-20160816; b=kQg8L/fKlAfO2m197j8JxJkgB1n3OJivlQvwIu1VFs9KMgPkvWqfvqHxwWAXTnG4WI 14f53w4lkQFQD7TKC1JeFg5aPu2Gmbos0C31tknXkDbXP7x2jJ2iLlVTie786ddE4rJ+ Pay4zd8nuspA7WKZXPNng08NvlZdVboKXOc/C1LwsvdA7xRq1lfxirlfWLr+yfOzrYNI ocJPkB9WQ8R53ChUC2SQv8NFxAImwrIBYIE7FdgjzuMHChlpCs0v/y+1MMb57XVDVT6/ DkL+PIX8pb8nfwD5EfoI4K69YjXBilw6LcGjVMkJsikhUUeUlvpA1V2LRadZxNaDaPsJ LvlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E1VSL0pjCixdyG4RV1ICMYhJ+r2n7useqdWsaGeETVY=; b=Y8IYTsL/9snP6SmNBKE4N4LX7IH+fyS8fOTrZXhcwdE0wMZD5x+B1bNiQVz0k9OH21 GMegiTNrx+/xyaxwVz/T2GmRjAXWpa2tDMiD58k399ga8TtE90D7WboMyLJUjrpOnSng 59vnmPJPTaeiPZqEXr29rfBrUvsZRcy+88awqMtYXJHmODqbHBzsnmnYABwZ70H1N2Pk MXt800VEZBmOddr89Ad6eWayS5mCldHz3fWL935pdWDUh0XHp7ZtFzTdcvCrxjR7M8rW sx1chyt0zl1UmxWwLfNENErndHJfTPuNG7PEB0Q8gttK21s7Eni06/kN6bT9P17l/3I7 870Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oUZxygDJ; 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 g10-20020a056402320a00b00453852df000si7062531eda.310.2022.09.19.04.11.18; Mon, 19 Sep 2022 04:11:43 -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=oUZxygDJ; 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 S229473AbiISKmH (ORCPT + 99 others); Mon, 19 Sep 2022 06:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbiISKlo (ORCPT ); Mon, 19 Sep 2022 06:41:44 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ADC432B95 for ; Mon, 19 Sep 2022 03:24:14 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id u132so27605865pfc.6 for ; Mon, 19 Sep 2022 03:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=E1VSL0pjCixdyG4RV1ICMYhJ+r2n7useqdWsaGeETVY=; b=oUZxygDJmOjyp2cM0o/4C+wL2ZcYG96F5yhOgZQ7joJlqMHNQH+/Z9cotgy9hCmuKQ k7BG+KNj1mDzTrqGNMpAY4ky8U8NXg2RQTIT93CpribCcOvPbnqDQZWKU+JZVnxlGv1S 2Zew4gaLIXaSrpfBo0AYbOHjkjkzbolqx5gL0DAuYdTGMTA4bgFlr7BANjL4doBRdLZF hDD7WuYw8yLu+W5PJ3bDNK738WPMfFHiCU5vnLW81hDyk8lCCn98YA10LrsEsfrjZ2RU Bbl7zQyaPo3QWxApYw08FmkHqIl7FwZBDGvefOObKFg9VOc4dvun+4SqAjqmkN8/bwAm dYtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=E1VSL0pjCixdyG4RV1ICMYhJ+r2n7useqdWsaGeETVY=; b=iUZYxxekv4wGwgs0bwgjbSZ8oZ6Yb7BqB5zIhDTcRc5bwqxGziYWa3lFhpKF7bF0PU 6HlzSBoqKCa26DMamqp9EJzf/tQg+0C70CGzmtoECGdv5QG+M7cQELcg73j/yhRmPMKX PG1NIHyEf42YfASZXJaYS9yLDd1q+S+jGLOQg1/UeGMosnq+1FnGpemJAQN8qxtNVuqI gaJBDdIy64CZaE3GLM7PgAsrgISf/u5tCCfTv+NMR2vG++t9V+sUjs2vEqEBAPrzFIVg dugXraqHCim9EoXyzJLjP0CiufimLL9M4tU5VeE8Xb+t8bjCFQXxnzl0kpA4sa4K4VmV 1tlQ== X-Gm-Message-State: ACrzQf3BhERkE2sdV651/2X/G8H8J2FGqm1BibWIQjbreKYzkxzO0RmO 1gJUr+8EHLGOjyig4THOxzw= X-Received: by 2002:a62:ea04:0:b0:547:50c0:c5ef with SMTP id t4-20020a62ea04000000b0054750c0c5efmr17307983pfh.15.1663582978104; Mon, 19 Sep 2022 03:22:58 -0700 (PDT) Received: from ubuntu ([175.124.254.119]) by smtp.gmail.com with ESMTPSA id rj9-20020a17090b3e8900b002008a85bac1sm6301718pjb.49.2022.09.19.03.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 03:22:57 -0700 (PDT) Date: Mon, 19 Sep 2022 03:22:51 -0700 From: Hyunwoo Kim To: Greg KH Cc: lkundrak@v3.sk, linux-kernel@vger.kernel.org, arnd@arndb.de, linux@dominikbrodowski.net Subject: Re: [PATCH v4] char: pcmcia: scr24x_cs: Fix use-after-free in scr24x_fops Message-ID: <20220919102251.GA314226@ubuntu> References: <20220919093801.GA307492@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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, Sep 19, 2022 at 11:45:27AM +0200, Greg KH wrote: > On Mon, Sep 19, 2022 at 02:38:01AM -0700, Hyunwoo Kim wrote: > > A race condition may occur if the user physically removes the > > pcmcia device while calling open() for this char device node. > > > > This is a race condition between the scr24x_open() function and > > the scr24x_remove() function, which may eventually result in UAF. > > > > So, add a mutex to the scr24x_open() and scr24x_remove() functions > > to avoid race contidion of krefs. > > > > Signed-off-by: Hyunwoo Kim > > Reported-by: kernel test robot > > The robot did not report this original problem :( > > > --- > > drivers/char/pcmcia/scr24x_cs.c | 73 +++++++++++++++++++++++---------- > > 1 file changed, 52 insertions(+), 21 deletions(-) > > You failed to put below the --- line what changed from previous versions > as the documentation asks for. thank you for telling me. I submitted a fixed v5 patch. Regards, Hyunwoo Kim.