Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5212455pxb; Sun, 13 Feb 2022 11:59:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyz6vAyhvT9wkLbbdlR3eA4wqIYAtuvX3FUTx6dqzSJWHpukBbNZQpslw2rPjPHhS0JmIat X-Received: by 2002:a65:5641:: with SMTP id m1mr8914866pgs.395.1644782398307; Sun, 13 Feb 2022 11:59:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644782398; cv=none; d=google.com; s=arc-20160816; b=M6aurgiFBAFE3aSnXJo3YSCz2YZAXR4Ui+N0FoaglamZT25OTL+Msg0yHPH8MWzQCr PKlixhIsaBrvxPhJq4Y8+CCXEb6Th8CxMNOc3A86ENBX4szPkFfxctDwM0gOMBPdyyGs ZENff4BULbqs7eAxK6oCTjgu0Xx00gIcj9a9eyYwCmAgCAwdTslH5ibYG0i0Bo3vM8NV XvWsoiyOc30n3BXZzIzkA+3iuX3tRTfO4nbkQsRYNR/uTBJau0zkShRCSxlt79diHXmL r9RF2035bkQAgpaKS7rv3qCFzcE10EQJirfEnXUo0NHGxRuoP5QMD+p7teNv1RU+H3yK PSfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=YjctwbGWG4CdlUe/4Uf4hkYj0w6B9sukDOlX+GMDnSE=; b=RNTWt9L2AtMc2UGvniwYJxxNbYQGlC6SwMghEen4+texYzKHwkSKCK+4vxuIosy+xG bERA2AUY4fBvgeSNINYhXbBc3LGErRD3+RHWw3dd2uujR7HzgVfAzxwgvcYN6AO1tZQ7 lNnxTJPXfuI8RhMJ41kFJkt3BrlWdCcSpf98ce5uY+Seh3hYl1Ipx7Uey03GuzhzMpIx 9KEyqANkp4rKeQLglvxu9ZT9PGaNEqU515/WHsqKpCRcmrtpqcoI8udr7uZH+XtC4PyP 6GDHVG0SWUz4sTv1oxcEmyjds488MXdGq+gUpZDCSxNLkpK0who/X0pu0J5LfpAUJt0S 7PCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-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 q42si9585994pjq.28.2022.02.13.11.59.23; Sun, 13 Feb 2022 11:59:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-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-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353494AbiBKUv4 (ORCPT + 99 others); Fri, 11 Feb 2022 15:51:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353353AbiBKUvu (ORCPT ); Fri, 11 Feb 2022 15:51:50 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC35CCFA for ; Fri, 11 Feb 2022 12:51:32 -0800 (PST) Received: from [192.168.0.2] (ip5f5aee34.dynamic.kabel-deutschland.de [95.90.238.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id A6B4E61E6478B; Fri, 11 Feb 2022 21:51:29 +0100 (CET) Message-ID: Date: Fri, 11 Feb 2022 21:51:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [BlueZ PATCH 1/4] adapter: Fix the reusing gerror without re-initialization Content-Language: en-US To: Luiz Augusto von Dentz Cc: Tedd Ho-Jeong An , linux-bluetooth@vger.kernel.org References: <20220211001840.22566-1-hj.tedd.an@gmail.com> From: Paul Menzel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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-bluetooth@vger.kernel.org Dear Luiz, Am 11.02.22 um 21:30 schrieb Luiz Augusto von Dentz: > On Fri, Feb 11, 2022 at 8:41 AM Paul Menzel wrote: >> Am 11.02.22 um 01:18 schrieb Tedd Ho-Jeong An: >>> From: Tedd Ho-Jeong An >> >> I had a hard time to understand, what the git commit message summary >> meant. Maybe: >> >>> adapter: Use g_clear_error() to set gerr to NULL to fix segfault >> >> >>> When the GError variable is freeed with g_error_free(), it is not set to >>> NULL and reusing the same variable again can cause the seg_fault because >>> it is still pointing the old memory address which is freed. >> >> Could you please include an example stack-/backtrace? > > That is part of issue if you open the link: > > https://github.com/bluez/bluez/issues/276#issue-1111278644 Yes, I know. I prefer commit messages to be self-contained, as it’s never known if you are online or the Web service has problems or is shut down. But of course, if BlueZ does it differently, that is fine. >>> This patch relaces the g_error_free() to g_clear_error() which frees the >>> variable and set it to NULL if the variable is used in the function >> >> set*s* >> >>> again. >>> >>> Fixes: 2287c517ca1bd ("adapter: Fix unchecked return value") >>> Fixes: https://github.com/bluez/bluez/issues/276 >> >> To make the tags unambiguous, at least in the Linux kernel world, >> *Resolves* or *Closes* are used to refer to issues. > > But this is on kernel space, and afaik github uses *Fixes* instead to > auto close the issues, so I don't really follow what you are trying to > suggest here, or do you want github to start following Linux kernel > tags? GitHub already does. ;-) Resolves, Closes, Fixes all automatically close the referenced issue. […] Kind regards, Paul