genode/repos
Martin Stein 1336b0a751 mmio: upper-bounds checks
The classes Genode::Mmio, Genode::Register_set, Genode::Attached_mmio, and
Platform::Device::Mmio now receive a template parameter 'size_t SIZE'. In each
type that derives from one of these classes, it is now statically checked that
the range of each Genode::Register::Register- and
Genode::Register_set::Register_array-deriving sub-type is within [0..SIZE).

That said, SIZE is the minimum size of the memory region provided to the above
mentioned Mmio classes in order to avoid page faults or memory corruption when
accessing the registers and register arrays declared inside.

Note, that the range end of a register array is not the end of the last item
but the end of integer access that is used for accessing the last bit in the
last item.

The constructors of Genode::Mmio, Genode::Attached_mmio, and
Platform::Device::Mmio now receive an argument 'Byte_range_ptr range' that is
expected to be the range of the backing memory region. In each type that derives
from on of these classes, it is now dynamically checked that 'range.num_bytes
>= SIZE', thereby implementing the above mention protection against page faults
and memory corruption.

The rest of the commit adapts the code throughout the Genode Labs repositories
regarding the changes. Note that for that code inside Core, the commits mostly
uses a simplified approach by constructing MMIO objects with range
[base..base+SIZE) and not with a mapping- or specification-related range size.
This should be fixed in the future.

Furthermore, there are types that derive from an MMIO class but don't declare
any registers or register arrays (especially with Platform::Device::Mmio). In
this case SIZE is set to 0. This way, the parameters must be actively corrected
by someone who later wants to add registers or register arrays, plus the places
can be easily found by grep'ing for Mmio<0>.

Fix #4081
2024-02-26 08:59:07 +01:00
..
base mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
base-fiasco depot: update recipe hashes 2023-12-13 12:33:05 +01:00
base-foc depot: update recipe hashes 2023-12-13 12:33:05 +01:00
base-hw mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
base-linux depot: update recipe hashes 2023-12-13 12:33:05 +01:00
base-nova depot: update recipe hashes 2023-12-13 12:33:05 +01:00
base-okl4 depot: update recipe hashes 2023-12-13 12:33:05 +01:00
base-pistachio depot: update recipe hashes 2023-12-13 12:33:05 +01:00
base-sel4 depot: update recipe hashes 2023-12-13 12:33:05 +01:00
dde_bsd mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
dde_ipxe mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
dde_linux mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
dde_rump depot: update recipe hashes 2023-12-13 12:33:05 +01:00
demo depot: update recipe hashes 2023-12-13 12:33:05 +01:00
gems depot: add tcp_terminal recipe 2024-02-26 08:31:04 +01:00
hello_tutorial hello_tutorial: use [build_artifacts] in hello.run 2023-11-28 14:44:29 +01:00
libports libc: consistency of tv_sec when tv_nsec wraps 2024-02-26 08:31:05 +01:00
os mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
pc mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
ports mmio: upper-bounds checks 2024-02-26 08:59:07 +01:00
README doc: update repos/README 2022-05-25 12:23:04 +02:00

                      ===============================
                      Genode source-code repositories
                      ===============================


This directory contains the source-code repositories of the Genode OS
Framework. Each sub directory has the same principle layout as described in the
build-system manual:

:Build-system manual:

  [https://genode.org/documentation/developer-resources/build_system]

The build system uses a configurable selection of those reposities to obtain
the source codes for the build process. The repositories are not independent
but build upon of each other:

:'base':

  This directory contains the source-code repository of the fundamental
  frameworks and interfaces of Genode. Furthermore, it contains the generic
  parts of core.

:'base-<platform>':
  These directories contain platform-specific source-code repositories
  complementing the 'base' repository. The following platforms are supported:

  :'hw':
    The hw platform hosts Genode on a custom microkernel specifically
    developed for Genode. The name "hw" denotes that Genode is executed on
    bare hardware without a 3rd-party kernel underneath.

  :'linux':
    Linux kernel (both x86_32 and x86_64)

  :'nova':
    NOVA hypervisor ([https://hypervisor.org])

  :'foc':
    Fiasco.OC is a modernized version of the Fiasco microkernel with a
    completely revised kernel interface fostering capability-based
    security. It is not compatible with L4/Fiasco.

  :'okl4':
    OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.

  :'pistachio':
    L4ka::Pistachio kernel developed at University of Karlsruhe.

  :'fiasco':
    L4/Fiasco kernel developed at University of Technology Dresden.

  :'sel4':
    seL4 microkernel ([https://sel4.systems/])

:'os':

  This directory contains the non-base OS components such as the init
  component, device drivers, and basic system services.

:'demo':

  This directory contains the source-code repository of various services and
  applications that we use for demonstration purposes. For example, a graphical
  application launcher called Launchpad and the Scout tutorial browser.

:'hello_tutorial':

  Tutorial for creating a simple client-server scenario with Genode. This
  repository includes documentation and the complete source code.

:'libports':

  This source-code repository contains ports of popular open-source libraries
  to Genode, most importantly the C library. The repository contains no
  upstream source code but means to download the code and adapt it to Genode.
  For instructions about how to use this mechanism, please consult the README
  file at the top level of the repository. Among the 3rd-party libraries
  are Qt5, freetype, ncurses, and Mesa.

:'dde_linux':

  This source-code repository contains the device driver environment for
  executing Linux subsystems as Genode components.

:'dde_ipxe':

  This source-code repository contains the device-driver environment for
  executing network drivers of the iPXE project.

:'dde_bsd':

  This source-code repository contains the device-driver environment for
  drivers of the OpenBSD operating system.

:'dde_rump':

  This source-code repository contains the port of rump kernels, which are
  used to execute subsystems of the NetBSD kernel as user level processes.
  The repository contains a server that uses a rump kernel to provide
  various NetBSD file systems to Genode.

:'pc':
  This source-code repository hosts device drivers that are specific for PC
  platforms. It depends on the 'dde_linux' repository.

:'ports':

  This source-code repository hosts ports of 3rd-party applications to
  Genode. The repository does not contain upstream source code but provides
  a mechanism for downloading the official source distributions and adapt
  them to the Genode environment. The used mechanism is roughly the same
  as used for the 'libports' repository. Please consult 'libports/README'
  for further information.

:'gems':

  This source-code repository contains Genode applications that use
  both native Genode interfaces as well as features of other high-level
  repositories, in particular shared libraries provided by 'libports'.