← Back to team overview

kernel-packages team mailing list archive

[Bug 1540731] Re: SocketMessenger::update_session_creds() fails to get client PID

 

I'd like to perform a kernel bisect to figure out which commit caused
this regression. We need to identify the earliest kernel that did not
exhibit the bug and the first kernel that did exhibit the bug.

Can you test the following kernels and post back?

v4.4 final: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4-wily/
If v4.4 final exhibits the bug, we should move on to testing some of the v4.4 release candidates. 

v4.4-rc4: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4-rc4-wily/

If v4.4-rc4 does not exhibit the bug then test v4.4-rc6:
v4.4-rc6: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4-rc6-wily/

If v4.4-rc4 does exhibit the bug then test v4.4-rc2:
v4.4-rc2: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4-rc2-wily/


Thanks in advance!

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1540731

Title:
  SocketMessenger::update_session_creds() fails to get client PID

Status in GLibC:
  New
Status in Mir:
  Confirmed
Status in linux package in Ubuntu:
  Confirmed

Bug description:
  Since updating to the 4.4.0-2 kernel recvmsg() fails SCM_CREDENTIALS
  request with EOPNOTSUPP.

  This manifests as a test failure in Mir:

      [ RUN      ] PromptSessionClientAPI.client_pid_is_associated_with_session
      unknown file: Failure

  Test case:

  #include <gtest/gtest.h>
  #include <gmock/gmock.h>
  #include <sys/socket.h>
  #include <sys/stat.h>

  TEST(IsItBroken, recvmsg)
  {
      using namespace testing;

      enum { server, client, size };
      int socket_fd[size];
      int const opt = 1;

      ASSERT_THAT(socketpair(AF_LOCAL, SOCK_STREAM, 0, socket_fd),
  Eq(0));

      auto const msg = "A random message";
      send(socket_fd[client], msg, sizeof msg, MSG_DONTWAIT | MSG_NOSIGNAL);

      ASSERT_THAT(setsockopt(socket_fd[server], SOL_SOCKET, SO_PASSCRED,
  &opt, sizeof(opt)), Ne(-1));

      union {
          struct cmsghdr cmh;
          char   control[CMSG_SPACE(sizeof(ucred))];
      } control_un;

      control_un.cmh.cmsg_len = CMSG_LEN(sizeof(ucred));
      control_un.cmh.cmsg_level = SOL_SOCKET;
      control_un.cmh.cmsg_type = SCM_CREDENTIALS;

      msghdr msgh;
      msgh.msg_name = nullptr;
      msgh.msg_namelen = 0;
      msgh.msg_iov = nullptr;
      msgh.msg_iovlen = 0;
      msgh.msg_control = control_un.control;
      msgh.msg_controllen = sizeof(control_un.control);

      errno = 0;

      EXPECT_THAT(recvmsg(socket_fd[server], &msgh, MSG_PEEK), Ne(-1))
          << "Error: " << strerror(errno);

      for (auto socket : socket_fd) close(socket);
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/glibc/+bug/1540731/+subscriptions