1.1 --- a/files/file_paging.cc Tue Apr 06 00:14:00 2021 +0200
1.2 +++ b/files/file_paging.cc Tue Apr 06 23:20:03 2021 +0200
1.3 @@ -40,11 +40,11 @@
1.4
1.5
1.6
1.7 -/* Convert opening flags to paging flags. */
1.8 +/* Convert opening flags to map-compatible paging flags. */
1.9
1.10 flags_t FilePaging::get_flags(flags_t flags)
1.11 {
1.12 - return flags & (O_WRONLY | O_RDWR) ? L4_FPAGE_RW : L4_FPAGE_RO;
1.13 + return flags & (O_WRONLY | O_RDWR) ? L4RE_DS_MAP_FLAG_RW : L4RE_DS_MAP_FLAG_RO;
1.14 }
1.15
1.16
2.1 --- a/generic/pager.cc Tue Apr 06 00:14:00 2021 +0200
2.2 +++ b/generic/pager.cc Tue Apr 06 23:20:03 2021 +0200
2.3 @@ -65,6 +65,12 @@
2.4 {
2.5 offset_t file_offset = _start + offset;
2.6 offset_t max_offset = _start + _size;
2.7 +
2.8 + /* Prevent access beyond that defined by the pager. */
2.9 +
2.10 + if (flags & ~_flags)
2.11 + return -L4_EACCESS;
2.12 +
2.13 Flexpage *flexpage = _mapper->get(file_offset, flags);
2.14
2.15 /* Issue the flexpage via the IPC system. */
2.16 @@ -73,14 +79,14 @@
2.17 flags, region);
2.18
2.19 if (!err)
2.20 - err = complete_Dataspace_map(*region);
2.21 + err = complete_Dataspace_map(*region);
2.22
2.23 /* After the flexpage is issued, it is queued for future reuse. */
2.24
2.25 _mapper->queue(flexpage);
2.26
2.27 if (err)
2.28 - return err;
2.29 + return err;
2.30
2.31 return IPC_MESSAGE_SENT;
2.32 }
3.1 --- a/pipes/pipe_pager.cc Tue Apr 06 00:14:00 2021 +0200
3.2 +++ b/pipes/pipe_pager.cc Tue Apr 06 23:20:03 2021 +0200
3.3 @@ -8,7 +8,7 @@
3.4 done by requesting a region. */
3.5
3.6 PipePager::PipePager(PipePaging *paging, bool writing)
3.7 -: Pager(NULL, writing ? L4_FPAGE_RW : L4_FPAGE_RO),
3.8 +: Pager(NULL, writing ? L4RE_DS_MAP_FLAG_RW : L4RE_DS_MAP_FLAG_RO),
3.9 _paging(paging), _writing(writing)
3.10 {
3.11 /* Initialise the size of the paged region. */