NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/56364: genfb uses device properties to pass around virtual / physical addresses
>Number: 56364
>Category: kern
>Synopsis: genfb uses device properties to pass around virtual / physical addresses
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Aug 15 20:55:00 +0000 2021
>Originator: Jason Thorpe
>Release: 9.99.82
>Organization:
RISCy Business
>Environment:
NetBSD the-ripe-vessel 9.99.82 NetBSD 9.99.82 (GENERIC) #0: Tue May 18 17:05:45 UTC 2021 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
genfb uses device properties to pass around physical and virtual addresses. This is an abuse of the the properties facility. Physical addresses may be acceptable (after all, some device trees natively store address resources as properties), but it is bad practice to store virtual addresses there, especially if running on a system with KASLR enabled.
>How-To-Repeat:
Code inspection. Here is an example from amlogic/meson_genfb.c driver. Other drivers are similar:
prop_dictionary_set_uint32(cfg, "address", 0);
prop_dictionary_set_uint32(cfg, "virtual_address",
(uintptr_t)sc->sc_dmap);
>Fix:
Not provided.
Home |
Main Index |
Thread Index |
Old Index