mprotect fails on ext4 with dax
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu |
Invalid
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Invalid
|
High
|
Unassigned | ||
Bionic |
Fix Released
|
High
|
Unassigned | ||
pmdk (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have a file located on ext4 mounted with "dax". When I call mmap on that file with protection flag different than PROT_NONE and pass the returned address to mprotect(..., PROT_NONE) it fails with:
mprotect: Permission denied
This bug affects PMDK (https:/
Problem was observer on kernel 4.15.0-36-generic and 4.15.0-34-generic
Below is a code which can be used to reproduce the issue.
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
int main(int argc, char *argv[])
{
if (argc < 3) {
}
int size = atoi(argv[2]);
int fd = open(argv[1], O_RDWR);
if (fd < 0) {
}
void *addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (addr == MAP_FAILED) {
}
}
}
---
ProblemType: Bug
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 18.04
InstallationDate: Installed on 2018-10-23 (0 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
IwConfig:
lo no wireless extensions.
enp0s3 no wireless extensions.
Lsusb:
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: innotek GmbH VirtualBox
Package: linux (not installed)
ProcFB:
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.173.1
RfKill:
Tags: bionic
Uname: Linux 4.15.0-36-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 12/01/2006
dmi.bios.vendor: innotek GmbH
dmi.bios.version: VirtualBox
dmi.board.name: VirtualBox
dmi.board.vendor: Oracle Corporation
dmi.board.version: 1.2
dmi.chassis.type: 1
dmi.chassis.vendor: Oracle Corporation
dmi.modalias: dmi:bvninnotekG
dmi.product.family: Virtual Machine
dmi.product.name: VirtualBox
dmi.product.
dmi.sys.vendor: innotek GmbH
CVE References
description: | updated |
description: | updated |
Changed in pmdk (Ubuntu): | |
status: | New → Confirmed |
Changed in linux (Ubuntu): | |
assignee: | Joseph Salisbury (jsalisbury) → nobody |
Changed in linux (Ubuntu Bionic): | |
assignee: | Joseph Salisbury (jsalisbury) → nobody |
Changed in linux (Ubuntu): | |
status: | Confirmed → Invalid |
tags: | added: cscc |
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1799237
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.