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]
Date:   Thu, 30 Mar 2023 14:45:18 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Lee Jones" <lee@...nel.org>,
        "Loic Poulain" <loic.poulain@...aro.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mfd: syscon: Use of_io_request_and_map() for IO mapping

On Thu, Mar 30, 2023, at 13:42, Lee Jones wrote:
> On Mon, 20 Mar 2023, Loic Poulain wrote:
>
>> Use of_io_request_and_map() instead of of_iomap() so that the
>> region is reserved and protected, i.e reported in /proc/iomem
>> and not accessible from user side (CONFIG_IO_STRICT_DEVMEM).
>>
>> Signed-off-by: Loic Poulain <loic.poulain@...aro.org>
>> ---
>>  drivers/mfd/syscon.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
>> index bdb2ce7ff03b..7e6d4edda118 100644
>> --- a/drivers/mfd/syscon.c
>> +++ b/drivers/mfd/syscon.c
>> @@ -60,7 +60,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
>>  		goto err_map;
>>  	}
>>
>> -	base = of_iomap(np, 0);
>> +	base = of_io_request_and_map(np, 0, NULL);
>>  	if (!base) {
>>  		ret = -ENOMEM;
>>  		goto err_map;
>
> Looks sane though.
>
> Arnd, do you have an opinion?

Thanks for pinging me. I would indeed expect this to cause
problems, as syscon mappings are likely to be used in a way
that is not entirely clean, with other devices defining
overlapping ranges.

For any other driver, the change makes a lot of sense after
checking the DT file, but for syscon in particular I don't
think it's even realistic to check all users.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ