lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <79984ce2-98a2-42f4-85f8-fd53d71f10c7@suse.com>
Date: Tue, 5 Nov 2024 16:56:37 +0100
From: Jürgen Groß <jgross@...e.com>
To: Qiu-ji Chen <chenqiuji666@...il.com>, sstabellini@...nel.org,
 oleksandr_tyshchenko@...m.com, gregkh@...uxfoundation.org,
 sumit.garg@...aro.org, xin.wang2@....com
Cc: xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
 baijiaju1990@...il.com, stable@...r.kernel.org
Subject: Re: [PATCH] xen: Fix the issue of resource not being properly
 released in xenbus_dev_probe()

On 05.11.24 14:09, Qiu-ji Chen wrote:
> This patch fixes an issue in the function xenbus_dev_probe(). In the
> xenbus_dev_probe() function, within the if (err) branch at line 313, the
> program incorrectly returns err directly without releasing the resources
> allocated by err = drv->probe(dev, id). As the return value is non-zero,
> the upper layers assume the processing logic has failed. However, the probe
> operation was performed earlier without a corresponding remove operation.
> Since the probe actually allocates resources, failing to perform the remove
> operation could lead to problems.
> 
> To fix this issue, we followed the resource release logic of the
> xenbus_dev_remove() function by adding a new block fail_remove before the
> fail_put block. After entering the branch if (err) at line 313, the
> function will use a goto statement to jump to the fail_remove block,
> ensuring that the previously acquired resources are correctly released,
> thus preventing the reference count leak.
> 
> This bug was identified by an experimental static analysis tool developed
> by our team. The tool specializes in analyzing reference count operations
> and detecting potential issues where resources are not properly managed.
> In this case, the tool flagged the missing release operation as a
> potential problem, which led to the development of this patch.
> 
> Fixes: 4bac07c993d0 ("xen: add the Xenbus sysfs and virtual device hotplug driver")
> Cc: stable@...r.kernel.org
> Signed-off-by: Qiu-ji Chen <chenqiuji666@...il.com>

Reviewed-by: Juergen Gross <jgross@...e.com>


Juergen

Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3684 bytes)

Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ