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] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bad0596-c983-6915-67d0-0cda9ac70e5c@gmx.de>
Date:   Fri, 26 Nov 2021 17:11:11 +0100
From:   Lino Sanfilippo <LinoSanfilippo@....de>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     linux@...linux.org.uk, jirislaby@...nel.org,
        p.rosenberger@...bus.com, lukas@...ner.de,
        linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] serial: amba-pl011: do not request memory region twice


Hi,

On 26.11.21 at 16:28, Greg KH wrote:
> On Fri, Nov 26, 2021 at 03:39:25PM +0100, Lino Sanfilippo wrote:
>> The driver attempts to request and release the IO memory region for a uart
>> port twice:
>>
>> First during the probe() function devm_ioremap_resource() is used to
>> allocate and map the ports memory.
>> Then a combo of pl011_config_port() and pl011_release_port() is used to
>> request/release the same memory area. These functions are called by the
>> serial core as soon as the uart is registered/unregistered.
>>
>> However since the allocation request via devm_ioremap_resource() already
>> succeeds, the attempt to claim the memory again via pl011_config_port()
>> fails. This failure remains unnoticed, since the concerning return value is
>> not evaluated.
>> Later at module unload also the attempt to release the unclaimed memory
>> in pl011_release_port() fails. This time the failure results in a “Trying
>> to free nonexistent resource" warning printed by the serial core.
>>
>> Fix these issues by removing the callbacks that implement the redundant
>> memory allocation/release.
>>
>> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@....de>
>> ---
>>
>> This patch was tested on a 5.10 Raspberry Pi kernel with a CM3.
>
> What commit id does this change fix?
>
> thanks,
>
> greg k-h
>

AFAICS its commit 3873e2d7f63a ("drivers: PL011: refactor pl011_probe()") which
changed  devm_ioremap() in pl011_setup_port() to  devm_ioremap_resource().
Since the latter not only remaps but also requests the memory region it
collides with the memory request in pl011_config_port(). I will add an appropriate
Fixes tag for this.

Regards,
Lino

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ