Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1636434
| From | Will Deacon <will.deacon@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] arm64: Add translation functions for /dev/mem read/write |
| Date | 2017-05-05 17:00 +0200 |
| Message-ID | <tDMS6-35I-15@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <tD0DM-4DU-15@gated-at.bofh.it> <tD5WO-8gC-21@gated-at.bofh.it> <tD8UF-1LK-15@gated-at.bofh.it> <tDajM-2yX-13@gated-at.bofh.it> <tDiKl-8hi-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, May 04, 2017 at 07:40:50AM +0100, Ard Biesheuvel wrote: > On 3 May 2017 at 22:47, Goel, Sameer <sgoel@codeaurora.org> wrote: > > > > > > On 5/3/2017 2:18 PM, Leif Lindholm wrote: > >> On Wed, May 03, 2017 at 11:07:45AM -0600, Goel, Sameer wrote: > >>> On 5/3/2017 5:26 AM, Will Deacon wrote: > >>>> [adding some /dev/mem fans to cc] > >>>> > >>>> On Tue, May 02, 2017 at 02:28:05PM -0600, Sameer Goel wrote: > >>>>> Port architecture specific xlate and unxlate functions for /dev/mem > >>>>> read/write. This sets up the mapping for a valid physical address if a > >>>>> kernel direct mapping is not already present. > >>>>> > >>>>> This is a generic issue as a user space app should not be allowed to crash > >>>>> the kernel. > >>>> > >>>>> This issue was observed when systemd tried to access performance > >>>>> pointer record from the FPDT table. > >>>> > >>>> Why is it doing that? Is there not a way to get this via /sys? > >>> > >>> There is no ACPI FPDT implementation in the kernel, so the userspace > >>> systemd code is getting the FPDT table contents from /sys > >>> and parsing the entries. The performance pointer record is a > >>> reserved address populated by UEFI and the userspace code tries to > >>> access it using /dev/mem. The physical address is valid, so cannot > >>> push back on the user space code. > >> > >> OK, so then we need to add support for parsing this table in the > >> kernel and exposing the referred-to regions in a controllable fashion. > >> Maybe something that belongs under /sys/firmware/efi (adding Matt), or > >> maybe something that deserves its own driver. > >> > >> The only two use-cases for /dev/mem on arm64 are: > >> - Implementing interfaces in the kernel takes up-front effort. > >> - Being able to accidentally panic the kernel from userland. > >> > > We will see this issue with any access using /dev/mem to a MEMBLOCK_NOMAP marked > > memblock. The kernel crash issue has to be fixed irrespective of ACPI FPDT support. > > > > I reported the same issue a couple of weeks ago [0]. So while we all > agree that such accesses shouldn't oops the kernel, I think we may > disagree on whether such accesses should be allowed in the first > place, especially when using read/write on /dev/mem (as opposed to > mmap()) Did you plan to respin those patches to address Alex's comments? I agree that it would be good to close the oops, regardless of the rest of the discussion here. Will
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] arm64: Add translation functions for /dev/mem read/write Sameer Goel <sgoel@codeaurora.org> - 2017-05-02 22:30 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write Will Deacon <will.deacon@arm.com> - 2017-05-03 13:30 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write "Goel, Sameer" <sgoel@codeaurora.org> - 2017-05-03 19:10 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write Leif Lindholm <leif.lindholm@linaro.org> - 2017-05-03 22:20 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write "Goel, Sameer" <sgoel@codeaurora.org> - 2017-05-03 23:50 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-05-04 08:50 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write "Goel, Sameer" <sgoel@codeaurora.org> - 2017-05-04 22:00 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write Will Deacon <will.deacon@arm.com> - 2017-05-05 17:00 +0200
Re: [PATCH] arm64: Add translation functions for /dev/mem read/write Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-05-05 18:30 +0200
csiph-web