I have not had a chance to try and reproduce the issue with the example
mentioned in this bug report but I have been able to verify that the
kernel in bionic-proposed fixes the problem I have reported in the
following bug report that has been rightfully marked as a duplicate:


Steps I took to install the bionic-porposed kernel:

sudo apt-get install software-properties-common
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release 
-sc)-proposed restricted main universe"
sudo apt -y update
sudo apt-get -t bionic-proposed install linux-generic
 # Reboot

After reboot:

cpriebe@x:~$ uname -a
Linux x 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 
x86_64 x86_64 GNU/Linux

cpriebe@x:~$ sudo apt-cache policy linux-generic
  Version table:
 *** 500
        500 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
        100 /var/lib/dpkg/status

Considering the other bug has been marked as a duplicate I assume it is okay 
for me to change the tag on this. If this is not okay, please let me know 
and/or change it back.

** Tags removed: verification-needed-bionic
** Tags added: verification-done-bionic

You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.

  mprotect fails on ext4 with dax

Status in Ubuntu:
Status in linux package in Ubuntu:
Status in pmdk package in Ubuntu:
Status in linux source package in Bionic:
  Fix Committed

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://github.com/pmem/pmdk) and seems to be Ubuntu 
  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) {
                                fprintf(stderr, "usage %s file size\n", 
                                return 1;

                 int size = atoi(argv[2]);

                 int fd = open(argv[1], O_RDWR);
                 if (fd < 0) {
                                return 1;

                 void *addr = mmap(NULL, size, PROT_READ | PROT_WRITE, 
MAP_SHARED, fd, 0);
                 if (addr == MAP_FAILED) {
                                return 1;

                 if(mprotect(addr, size, PROT_NONE)) {
                                return 1;

                 return 0;
  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 
   lo        no wireless extensions.

   enp0s3    no wireless extensions.
   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)

  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.15.0-36-generic 
root=UUID=48e87c4c-3028-4252-b7bb-e1e6091ff7f6 ro quiet splash
  ProcVersionSignature: Ubuntu 4.15.0-36.39-generic 4.15.18
   linux-restricted-modules-4.15.0-36-generic N/A
   linux-backports-modules-4.15.0-36-generic  N/A
   linux-firmware                             1.173.1

  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.product.family: Virtual Machine
  dmi.product.name: VirtualBox
  dmi.product.version: 1.2
  dmi.sys.vendor: innotek GmbH

To manage notifications about this bug go to:

Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to