linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Regression: Requiring CAP_SYS_ADMIN for /proc/<pid>/pagemap causes application-level breakage
@ 2015-04-24 15:01 Mark Williamson
  2015-04-24 15:26 ` Mark Seaborn
  0 siblings, 1 reply; 25+ messages in thread
From: Mark Williamson @ 2015-04-24 15:01 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Kirill A. Shutemov, Pavel Emelyanov, Konstantin Khlebnikov,
	Andrew Morton, Linus Torvalds, Mark Seaborn, Andy Lutomirski,
	linux-api-u79uwXL29TY76Z2rM5mHXA, Finn Grimwood, Daniel James

Hi all,

<resending without unwanted HTML-ifying - apologies for the noise if
this appears twice for you!>

Recent changes have restricted a userspace interface used by our
product; specifically, a security patch to require CAP_SYS_ADMIN when
opening /proc/PID/pagemap
(https://github.com/torvalds/linux/commit/ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce,
original LKML discussion here: https://lkml.org/lkml/2015/3/9/864).

Although I've marked this as a "Regression", we do realise there are
legitimate security concerns over the original implementation of this
interface.  Still, given the kernel's strong stance on preserving
userspace interfaces, we thought we ought to flag this quickly as
something that has changed application-relevant behaviour.

We believe this change came into released kernels with Linux 4.0.  We
first observed problems when testing on Ubuntu 15.04 this week; I see
the patch is now backported to the various -stable kernel lines, so
I'd expect it to show up in other distros in due course.  The obvious
solution (to simply run with CAP_SYS_ADMIN) is quite undesirable for
our product, which is a debugger; we're expecting our users to run
without special privileges.

In our use of /proc/PID/pagemap, we currently make use of the physical
pageframe addresses.  We should be able to work with a scrambled
representation of these (Andy Lutomirski suggested this in the
original discussion - https://lkml.org/lkml/2015/3/16/1273) so long as
the scrambling remained consistent during the lifetime of the open
pagemap file.  Alternatively, if physical addresses were simply zeroed
(also suggested by Pavel Emelyanov -
https://lkml.org/lkml/2015/3/9/871) we would be able to change our
code to rely only on the soft-dirty flag and thus still work
correctly.

I propose to follow up with a patch that provides unprivileged access
to /proc/PID/pagemap with the physical pageframe addresses zeroed.
Would this be an acceptable approach?

Thank you,
Mark Williamson

---
Undo Software - http://undo-software.com/

^ permalink raw reply	[flat|nested] 25+ messages in thread
[parent not found: <CAEVpBa+7Yp+zCTczZqBd6Qp_uM7yy0i8YZfZkUbDeUsPpKtqRQ@mail.gmail.com>]

end of thread, other threads:[~2015-04-30 18:45 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-24 15:01 Regression: Requiring CAP_SYS_ADMIN for /proc/<pid>/pagemap causes application-level breakage Mark Williamson
2015-04-24 15:26 ` Mark Seaborn
2015-04-24 16:43   ` Mark Williamson
     [not found]     ` <CAEVpBa+vjfR8p_fJQPXyrQCMYJOocQpTHmkTYmj7nOpGcce=Pg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-29 18:44       ` Mark Williamson
2015-04-29 19:23         ` Mark Williamson
     [not found]         ` <CAEVpBa+DPbhZeRsA=+Jnn7f1BqVZm9SU=ABjy6bAHbbMi_yn+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-29 19:36           ` Kirill A. Shutemov
     [not found]             ` <20150429193622.GA11892-nhfs4B5ZimeFUdmeq17FyvUpdFzICT1y@public.gmane.org>
2015-04-29 20:24               ` Mark Williamson
2015-04-29 20:33               ` Linus Torvalds
2015-04-29 20:44                 ` Konstantin Khlebnikov
2015-04-29 21:02                   ` Linus Torvalds
2015-04-29 21:05                     ` Kirill A. Shutemov
     [not found]                       ` <20150429210513.GA12431-nhfs4B5ZimeFUdmeq17FyvUpdFzICT1y@public.gmane.org>
2015-04-29 21:18                         ` Linus Torvalds
     [not found]                           ` <CA+55aFw-dK4U3Z_gi5wEdGsPz0ZaQMizETKqS-=ajpDAu03Fnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-29 21:37                             ` Kirill A. Shutemov
2015-04-30 11:43                     ` Konstantin Khlebnikov
     [not found]                       ` <CALYGNiOcb2Z+zBVQ0Z058Z7+jp3EixYq8MK1f3MYYXOpT9iAiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 13:11                         ` Konstantin Khlebnikov
     [not found]                           ` <CALYGNiNVvVUuXvRX2nTtcDA8a8uWdQNVJ4bb2HgCY2efeDJrRw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 13:22                             ` Kirill A. Shutemov
     [not found]                               ` <20150430132230.GE15874-nhfs4B5ZimeFUdmeq17FyvUpdFzICT1y@public.gmane.org>
2015-04-30 13:32                                 ` Konstantin Khlebnikov
2015-04-30 18:45                                 ` Mark Williamson
2015-04-30 18:32                             ` Mark Williamson
2015-04-30 11:50                     ` Mark Williamson
     [not found] <CAEVpBa+7Yp+zCTczZqBd6Qp_uM7yy0i8YZfZkUbDeUsPpKtqRQ@mail.gmail.com>
2015-04-24 16:08 ` Linus Torvalds
2015-04-24 16:10   ` Andy Lutomirski
     [not found]     ` <CALCETrUkkbZaNGkcZMenciC7o9BO7U52LPXQwT+Q5TT8W2=uKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-24 16:27       ` Linus Torvalds
2015-04-29 14:38     ` Mark Williamson
     [not found]   ` <CA+55aFymwdHBs02GQkqQYwYF9Ru5dMKd4=2whLUfPwZSPU7ZGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-24 16:46     ` Mark Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).