Project

General

Profile

Bug #8619

epoll should exclude normal files/directories

Added by Alexander Pyhalov about 2 years ago. Updated about 2 years ago.

Status:
In Progress
Priority:
Normal
Category:
kernel
Start date:
2017-09-07
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

The following program fails on linux with "epoll_ctl: Operation not permitted", but succeeds on fresh OI (illumos-gate from August 7) when /tmp/1 file exists:

#include <stdio.h>
#include <sys/types.h>
#include <sys/epoll.h>
#include <stdlib.h>
#include <fcntl.h>

int
main (int argc, char *argv[])
{
  int sfd, s;
  int efd;
  struct epoll_event event;
  struct epoll_event *events;

  sfd = open("/tmp/1",O_RDONLY);
  if (sfd == -1) {
      perror ("open");
      abort ();
  }

  efd = epoll_create1 (0);
  if (efd == -1)
    {
      perror ("epoll_create");
      abort ();
    }

  event.data.fd = sfd;
  event.events = EPOLLIN | EPOLLET;
  s = epoll_ctl (efd, EPOLL_CTL_ADD, sfd, &event);
  if (s == -1)
    {
      perror ("epoll_ctl");
      abort ();
    }
  return 0;
}

On Linux it fails with epoll_ctl: Operation not permitted.
This leads to test_selectors.py python 3.4.7 test failure.

History

#1

Updated by Alexander Pyhalov about 2 years ago

  • Subject changed from epoll_ctl should fail on file fd to epoll_ctl EPOLL_CTL_ADD should fail on file fd
#2

Updated by Patrick Mooney about 2 years ago

  • Category set to kernel
  • Assignee set to Patrick Mooney
#3

Updated by Patrick Mooney about 2 years ago

  • Subject changed from epoll_ctl EPOLL_CTL_ADD should fail on file fd to epoll should exclude normal files/directories
  • Status changed from New to In Progress
#4

Updated by Patrick Mooney about 2 years ago

This is replicated by the downstream bug OS-5941.

It is recommended that the fix for OS-6116 be merged simultaneously. I'll open a corresponding illumos ticket for that issue as well.

Also available in: Atom PDF