[PATCH] Make task directories in /proc pollable

2012-12-03 Thread Andy Lutomirski
king /proc/self for POLLIN will reliably detect this feature. [1] http://lwn.net/Articles/462177/ [2] http://0pointer.de/blog/projects/plumbers-wishlist-3.html Signed-off-by: Andy Lutomirski --- fs/proc/base.c| 26 ++ include/linux/init_task.h | 2 ++ inc

Re: [3.6 regression?] THP + migration/compaction livelock (I think)

2012-12-05 Thread Andy Lutomirski
t; Sounds good! Andy, have you had the opportunity to try to reproduce your > issue with the backports that Mel listed? I think he'll be considering > asking for some of these to be backported for a future stable release so > any input you can provide would certainly be helpful. I

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-05 Thread Andy Lutomirski
On Tue, Dec 4, 2012 at 5:54 AM, Serge E. Hallyn wrote: > Quoting Andy Lutomirski (l...@amacapital.net): >> >> d) If I really wanted, I could emulate execve without actually doing >> >> execve, and capabilities would be inherited. >> > >> > If you

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-05 Thread Andy Lutomirski
On Wed, Dec 5, 2012 at 1:05 PM, Serge Hallyn wrote: > Quoting Andy Lutomirski (l...@amacapital.net): >> On Tue, Dec 4, 2012 at 5:54 AM, Serge E. Hallyn wrote: >> > Quoting Andy Lutomirski (l...@amacapital.net): >> >> >> d) If I really wanted, I could e

Re: [PATCH v2] epoll: Support for disabling items, and a self-test app.

2012-10-18 Thread Andy Lutomirski
[cc Paul McKenney, who is probably the leading expert on these things] On 10/17/2012 04:30 PM, Andrew Morton wrote: > On Tue, 16 Oct 2012 17:12:57 +0200 > "Michael Kerrisk (man-pages)" wrote: > >> On Thu, Aug 23, 2012 at 11:15 PM, Paton J. Lewis wrote: >>> From: "Paton J. Lewis" >>> >>> Enhanc

[PATCH] Document how capability bits work

2012-12-07 Thread Andy Lutomirski
Signed-off-by: Andy Lutomirski --- Documentation/security/capabilities.txt | 161 1 file changed, 161 insertions(+) create mode 100644 Documentation/security/capabilities.txt diff --git a/Documentation/security/capabilities.txt b/Documentation/security

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-07 Thread Andy Lutomirski
On Fri, Dec 7, 2012 at 9:07 AM, Andrew G. Morgan wrote: > I'm still missing something with the problem definition. > > So far if I follow the discussion we have determined that inheritance > as implemented is OK except for the fact that giving user an > inheritable pI bit which gives them default

Re: [PATCH] Document how capability bits work

2012-12-07 Thread Andy Lutomirski
On Fri, Dec 7, 2012 at 11:21 AM, Serge Hallyn wrote: > Quoting Andy Lutomirski (l...@amacapital.net): >> Signed-off-by: Andy Lutomirski >> --- >> Documentation/security/capabilities.txt | 161 >> >> 1 file changed, 161 ins

Re: [PATCH] Document how capability bits work

2012-12-07 Thread Andy Lutomirski
On Fri, Dec 7, 2012 at 5:10 PM, Rob Landley wrote: > On 12/07/2012 01:32:18 PM, Andy Lutomirski wrote: >> >> On Fri, Dec 7, 2012 at 11:21 AM, Serge Hallyn >> wrote: >> > Quoting Andy Lutomirski (l...@amacapital.net): >> >> Signed-off-by: Andy Lutomirsk

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-08 Thread Andy Lutomirski
On Sat, Dec 8, 2012 at 2:33 PM, Andrew G. Morgan wrote: > On Fri, Dec 7, 2012 at 10:39 AM, Andy Lutomirski wrote: >> It breaks down because, currently, users with nonzero pI have no >> direct ability to wield the capabilities. That means that every >> single binary with fI

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-08 Thread Andy Lutomirski
On Sat, Dec 8, 2012 at 3:37 PM, Andy Lutomirski wrote: > > Again (any mainly because I feel like there's a giant mental > disconnect here in that I really don't understand wtf the current / > POSIX system is trying to accomplish): what would be wrong with a > model in wh

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-10 Thread Andy Lutomirski
On Mon, Dec 10, 2012 at 6:59 AM, Serge Hallyn wrote: > Quoting Andy Lutomirski (l...@amacapital.net): >> It's especially bad because granting CAP_DAC_READ_SEARCH to user "foo" >> doesn't mean anything. Is he authorized to back things up to >> encrypted st

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-10 Thread Andy Lutomirski
On Mon, Dec 10, 2012 at 7:47 AM, Casey Schaufler wrote: > Put an ACL on the program file. > If you want different users to run with different privilege > make two copies of the program and give them different > ACLs and cap sets. > If your program is so big that making a copy is a disk space issue

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-10 Thread Andy Lutomirski
On Mon, Dec 10, 2012 at 11:13 AM, Casey Schaufler wrote: > On 12/10/2012 10:12 AM, Andy Lutomirski wrote: >> I think that the Windows approach is worth looking at. See here: >> >> http://msdn.microsoft.com/en-us/library/windows/desktop/aa375202%28v=vs.85%29.aspx >> &g

Re: [RFC] Capabilities still can't be inherited by normal programs

2012-12-10 Thread Andy Lutomirski
On Mon, Dec 10, 2012 at 11:51 AM, Casey Schaufler wrote: > On 12/10/2012 11:31 AM, Andy Lutomirski wrote: >> On Mon, Dec 10, 2012 at 11:13 AM, Casey Schaufler >> wrote: >>> On 12/10/2012 10:12 AM, Andy Lutomirski wrote: >>>> I think that the Windows app

Re: [PATCH] Add VDSO time function support for x86 32-bit kernel

2012-12-11 Thread Andy Lutomirski
On Tue, Dec 11, 2012 at 8:11 AM, wrote: > From: Stefani Seibold > > This small patch add the functions vdso_gettimeofday(), vdso_clock_gettime() > and vdso_time() support to the VDSO for x86 32-bit kernels. > > The reason to do this was to get a fast reliable time stamp. Many developers > uses T

Re: [PATCH] Add VDSO time function support for x86 32-bit kernel

2012-12-11 Thread Andy Lutomirski
On Tue, Dec 11, 2012 at 11:27 AM, John Stultz wrote: > On 12/11/2012 08:11 AM, stef...@seibold.net wrote: >> >> From: Stefani Seibold >> >> This small patch add the functions vdso_gettimeofday(), >> vdso_clock_gettime() >> and vdso_time() support to the VDSO for x86 32-bit kernels. >> >> The reas

Re: [PATCH] Add VDSO time function support for x86 32-bit kernel

2012-12-11 Thread Andy Lutomirski
On Tue, Dec 11, 2012 at 12:54 PM, Stefani Seibold wrote: > Am Dienstag, den 11.12.2012, 11:27 -0800 schrieb John Stultz: >> On 12/11/2012 08:11 AM, stef...@seibold.net wrote: >> > From: Stefani Seibold >> > >> > This small patch add the functions vdso_gettimeofday(), >> > vdso_clock_gettime() >>

Re: [PATCH] Add VDSO time function support for x86 32-bit kernel

2012-12-11 Thread Andy Lutomirski
[cc: Jeremy Fitzhardinge -- you wrote some of this] On Tue, Dec 11, 2012 at 12:40 PM, Stefani Seibold wrote: > Am Dienstag, den 11.12.2012, 11:37 -0800 schrieb Andy Lutomirski: >> On Tue, Dec 11, 2012 at 8:11 AM, wrote: >> > --- a/arch/x86/vdso/vclock_gettime.c >&g

Re: [PATCH v5 0/4] arch/arm: support seccomp

2012-11-13 Thread Andy Lutomirski
On 11/10/2012 02:44 PM, Kees Cook wrote: > This adds support for seccomp BPF to ARM. When built with the seccomp > improvement patch waiting in linux-next ("seccomp: Make syscall skipping > and nr changes more consistent"), this passes the seccomp regression > test suite: https://github.com/redpig/

[3.6 regression?] THP + migration/compaction livelock (I think)

2012-11-13 Thread Andy Lutomirski
I've seen an odd problem three times in the past two weeks. I suspect a Linux 3.6 regression. I"m on 3.6.3-1.fc17.x86_64. I run a parallel compilation, and no progress is made. All cpus are pegged at 100% system time by the respective cc1plus processes. Reading /proc//stack shows either [] __

Re: [3.6 regression?] THP + migration/compaction livelock (I think)

2012-11-13 Thread Andy Lutomirski
On Tue, Nov 13, 2012 at 3:11 PM, David Rientjes wrote: > On Tue, 13 Nov 2012, Andy Lutomirski wrote: > >> I've seen an odd problem three times in the past two weeks. I suspect >> a Linux 3.6 regression. I"m on 3.6.3-1.fc17.x86_64. I run a parallel >> compilat

Re: [3.6 regression?] THP + migration/compaction livelock (I think)

2012-11-13 Thread Andy Lutomirski
On Tue, Nov 13, 2012 at 3:41 PM, David Rientjes wrote: > On Tue, 13 Nov 2012, Andy Lutomirski wrote: > >> It just happened again. >> >> $ grep -E "compact_|thp_" /proc/vmstat >> compact_blocks_moved 8332448774 >> compact_pages_moved 21831286 >>

Re: [PATCH v2 2/3] mm: Update file times when inodes are written after mmaped writes

2013-01-03 Thread Andy Lutomirski
On Mon, Dec 31, 2012 at 8:11 AM, Jan Kara wrote: > On Sat 22-12-12 00:43:30, Andy Lutomirski wrote: >> On Sat, Dec 22, 2012 at 12:29 AM, Christoph Hellwig >> wrote: >> > NAK, we went through great trouble to get rid of the nasty layering >> > violation whe

Re: [PATCH 10/9] mm: make do_mmap_pgoff return populate as a size in bytes, not as a bool

2013-01-03 Thread Andy Lutomirski
On Sat, Dec 22, 2012 at 1:45 AM, Michel Lespinasse wrote: > do_mmap_pgoff() rounds up the desired size to the next PAGE_SIZE multiple, > however there was no equivalent code in mm_populate(), which caused issues. > > This could be fixed by introduced the same rounding in mm_populate(), > however I

Re: [PATCH 0/9] Avoid populating unbounded num of ptes with mmap_sem held

2013-01-03 Thread Andy Lutomirski
On Sat, Dec 22, 2012 at 1:37 AM, Michel Lespinasse wrote: > On Fri, Dec 21, 2012 at 6:16 PM, Andy Lutomirski wrote: >> On Fri, Dec 21, 2012 at 5:59 PM, Michel Lespinasse wrote: >>> Could you share your test case so I can try reproducing the issue >>> you're seei

Re: [PATCH 0/9] Avoid populating unbounded num of ptes with mmap_sem held

2013-01-04 Thread Andy Lutomirski
the sourrounding > code has to hold the mmap_sem write side since it's manipulating vmas. > This means we're doing an unbounded amount of pte population work with > mmap_sem held, and this causes problems as Andy Lutomirski reported > (we've hit this at Google as well, thoug

Re: [PATCH v2] mm: Downgrade mmap_sem before locking or populating on mmap

2012-12-17 Thread Andy Lutomirski
On Sun, Dec 16, 2012 at 7:29 PM, Michel Lespinasse wrote: > On Sun, Dec 16, 2012 at 10:05 AM, Andy Lutomirski wrote: >> On Sun, Dec 16, 2012 at 4:39 AM, Michel Lespinasse wrote: >>> I think this could be done by extending the mlock work I did as part >>> of v2.6.38-

Re: [PATCH] Add 32 bit VDSO time function support

2012-12-17 Thread Andy Lutomirski
then added the new code on top of it. > > Changelog: > 25.11.2012 - first release and proof of concept for linux 3.4 > 11.12.2012 - Port to linux 3.7 and code cleanup > 12.12.2012 - fixes suggested by Andy Lutomirski >- fixes suggested by John Stultz >

Are there u32 atomic bitops? (or dealing w/ i_flags)

2012-12-17 Thread Andy Lutomirski
I want to change inode->i_flags access to be atomic -- there are some locking oddities right now, I think, and I want to use a new inode flag to signal mtime updates from page_mkwrite. The problem is that i_flags is an unsigned int, and making it an unsigned long seems like a waste, but there aren

[PATCH v3] mm: Downgrade mmap_sem before locking or populating on mmap

2012-12-17 Thread Andy Lutomirski
This is a serious cause of mmap_sem contention. MAP_POPULATE and MCL_FUTURE, in particular, are disastrous in multithreaded programs. This is not a complete solution due to reader/writer fairness. Signed-off-by: Andy Lutomirski --- Changes from v2: The mmap functions now unconditionally

Re: Are there u32 atomic bitops? (or dealing w/ i_flags)

2012-12-17 Thread Andy Lutomirski
On Mon, Dec 17, 2012 at 5:57 PM, Al Viro wrote: > On Mon, Dec 17, 2012 at 05:10:21PM -0800, Andy Lutomirski wrote: >> I want to change inode->i_flags access to be atomic -- there are some >> locking oddities right now, I think, and I want to use a new inode >> flag to s

Re: [PATCH 6/6] Add 32 bit VDSO support for 32 and 64 bit kernels

2012-12-18 Thread Andy Lutomirski
On Tue, Dec 18, 2012 at 12:32 PM, Stefani Seibold wrote: > Am Dienstag, den 18.12.2012, 10:44 -0800 schrieb H. Peter Anvin: >> On 12/18/2012 08:52 AM, Stefani Seibold wrote: >> > >> > Pardon, i never disregarded nor i have agreed that this is going to be a >> > part of the VDSO. I currently have a

Re: Are there u32 atomic bitops? (or dealing w/ i_flags)

2012-12-18 Thread Andy Lutomirski
On Tue, Dec 18, 2012 at 1:30 PM, Dave Chinner wrote: > On Mon, Dec 17, 2012 at 06:42:44PM -0800, Andy Lutomirski wrote: >> On Mon, Dec 17, 2012 at 5:57 PM, Al Viro wrote: >> > On Mon, Dec 17, 2012 at 05:10:21PM -0800, Andy Lutomirski wrote: >> >> I want to chan

Re: Are there u32 atomic bitops? (or dealing w/ i_flags)

2012-12-20 Thread Andy Lutomirski
On Wed, Dec 19, 2012 at 11:03 PM, Dave Chinner wrote: > > The fact you are conerned about this function tells me something > important - that you aren't having problems with i_mutex (show me > where i_mutex is taken on the page_mkwrite path ;), but you are > having latency problems with the ext4 .

[RFC PATCH 1/4] mm: Explicitly track when the page dirty bit is transferred from a pte

2012-12-20 Thread Andy Lutomirski
This is a slight cleanup, but, more importantly, it will let us easily detect writes via mmap when the process is done writing (e.g. munmaps, msyncs, fsyncs, or dies). Signed-off-by: Andy Lutomirski --- include/linux/mm.h | 1 + mm/memory-failure.c | 4 +--- mm/page-writeback.c | 16

[RFC PATCH 2/4] mm: Update file times when inodes are written after mmaped writes

2012-12-20 Thread Andy Lutomirski
next patch will remove the now-unnecessary file_update_time calls. Signed-off-by: Andy Lutomirski --- fs/inode.c | 37 + include/linux/fs.h | 1 + include/linux/pagemap.h | 3 +++ mm/memory.c | 2 +- mm/mmap.c

[RFC PATCH 4/4] ext4: Fix an incorrect comment about i_mutex

2012-12-20 Thread Andy Lutomirski
Signed-off-by: Andy Lutomirski --- fs/ext4/fsync.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index be1d89f..8c15642 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -113,8 +113,6 @@ static int __sync_inode(struct inode *inode, int datasync

[RFC PATCH 0/4] Rework mtime and ctime updates on mmaped writes

2012-12-20 Thread Andy Lutomirski
ated 30 seconds after writing, all by themselves :) Lockdep has no complaints. NB: I am not at all an expert in anything fs or pagecache related. Please help me find things that may be wrong with these patches. Andy Lutomirski (4): mm: Explicitly track when the page dirty bit is transferre

[RFC PATCH 3/4] Remove file_update_time from all mkwrite paths

2012-12-20 Thread Andy Lutomirski
The times are now updated at sync time. Signed-off-by: Andy Lutomirski --- fs/9p/vfs_file.c | 3 --- fs/btrfs/inode.c | 4 +--- fs/buffer.c | 6 -- fs/ceph/addr.c | 3 --- fs/ext4/inode.c | 1 - fs/gfs2/file.c | 3 --- fs/nilfs2/file.c | 1 - fs/sysfs/bin.c | 2 -- mm/filemap.c

Re: Are there u32 atomic bitops? (or dealing w/ i_flags)

2012-12-20 Thread Andy Lutomirski
On Thu, Dec 20, 2012 at 3:36 PM, Dave Chinner wrote: > On Thu, Dec 20, 2012 at 12:05:09PM -0800, Andy Lutomirski wrote: >> On Wed, Dec 19, 2012 at 11:03 PM, Dave Chinner wrote: >> start_this_handle jbd2__journal_start jbd2_journal_start >> ext4_journal_star

Re: [RFC PATCH 2/4] mm: Update file times when inodes are written after mmaped writes

2012-12-20 Thread Andy Lutomirski
On Thu, Dec 20, 2012 at 4:14 PM, Dave Chinner wrote: > On Thu, Dec 20, 2012 at 03:10:10PM -0800, Andy Lutomirski wrote: >> The onus is currently on filesystems to call file_update_time >> somewhere in the page_mkwrite path. This is unfortunate for three >> reasons: >&

Re: [RFC PATCH 2/4] mm: Update file times when inodes are written after mmaped writes

2012-12-20 Thread Andy Lutomirski
On Thu, Dec 20, 2012 at 4:34 PM, Jan Kara wrote: > On Thu 20-12-12 15:10:10, Andy Lutomirski wrote: >> The onus is currently on filesystems to call file_update_time >> somewhere in the page_mkwrite path. This is unfortunate for three >> reasons: >> >> 1. page_m

Re: [RFC PATCH 2/4] mm: Update file times when inodes are written after mmaped writes

2012-12-21 Thread Andy Lutomirski
On Fri, Dec 21, 2012 at 2:51 AM, Jan Kara wrote: > On Thu 20-12-12 21:36:58, Andy Lutomirski wrote: >> On Thu, Dec 20, 2012 at 4:14 PM, Dave Chinner wrote: >> > On Thu, Dec 20, 2012 at 03:10:10PM -0800, Andy Lutomirski wrote: >> >> The onus is currently on filesy

[PATCH] ext4: Fix an incorrect comment about i_mutex

2012-12-21 Thread Andy Lutomirski
i_mutex is not held when ->sync_file is called. Reviewed-by: Jan Kara Signed-off-by: Andy Lutomirski --- fs/ext4/fsync.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index be1d89f..8c15642 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -11

[PATCH v2 2/3] mm: Update file times when inodes are written after mmaped writes

2012-12-21 Thread Andy Lutomirski
pping. (This happens during writeback and when ptes are unmapped.) Subsequently (after an inode is written back or when a vma is removed), the AS_CMTIME bit is checked, and, if set, the inode's time is updated. The next patch will remove the now-unnecessary file_update_time calls in ->page_

[PATCH v2 3/3] Remove file_update_time from all mkwrite paths

2012-12-21 Thread Andy Lutomirski
The times are now updated at sync time. Signed-off-by: Andy Lutomirski --- fs/9p/vfs_file.c | 3 --- fs/btrfs/inode.c | 4 +--- fs/buffer.c | 6 -- fs/ceph/addr.c | 3 --- fs/ext4/inode.c | 1 - fs/gfs2/file.c | 3 --- fs/nilfs2/file.c | 1 - fs/sysfs/bin.c | 2 -- mm/filemap.c

[PATCH v2 0/3] Rework mtime and ctime updates on mmaped writes

2012-12-21 Thread Andy Lutomirski
riting via mmap. The times are also updated 30 seconds after writing, all by themselves :) xfstest #215 also passes.Lockdep has no complaints. Changes from v1: - inode_update_time_writable now locks against the fs freezer - Minor cleanups - Major changelog improvements Andy Lutomirski (3): mm:

[PATCH v2 1/3] mm: Explicitly track when the page dirty bit is transferred from a pte

2012-12-21 Thread Andy Lutomirski
This is a slight cleanup, but, more importantly, it will let us easily detect writes via mmap when the process is done writing (e.g. munmaps, msyncs, fsyncs, or dies). Signed-off-by: Andy Lutomirski --- include/linux/mm.h | 1 + mm/memory-failure.c | 4 +--- mm/page-writeback.c | 16

Re: [PATCH 0/9] Avoid populating unbounded num of ptes with mmap_sem held

2012-12-21 Thread Andy Lutomirski
On Thu, Dec 20, 2012 at 4:49 PM, Michel Lespinasse wrote: > We have many vma manipulation functions that are fast in the typical case, > but can optionally be instructed to populate an unbounded number of ptes > within the region they work on: > - mmap with MAP_POPULATE or MAP_LOCKED flags; > - re

Re: [PATCH 0/9] Avoid populating unbounded num of ptes with mmap_sem held

2012-12-21 Thread Andy Lutomirski
On Fri, Dec 21, 2012 at 4:59 PM, Michel Lespinasse wrote: > On Fri, Dec 21, 2012 at 4:36 PM, Andy Lutomirski wrote: >> On Thu, Dec 20, 2012 at 4:49 PM, Michel Lespinasse wrote: >>> We have many vma manipulation functions that are fast in the typical case, >>> but can

Re: [PATCH 0/9] Avoid populating unbounded num of ptes with mmap_sem held

2012-12-21 Thread Andy Lutomirski
On Fri, Dec 21, 2012 at 5:59 PM, Michel Lespinasse wrote: > On Fri, Dec 21, 2012 at 5:09 PM, Andy Lutomirski wrote: >> On Fri, Dec 21, 2012 at 4:59 PM, Michel Lespinasse wrote: >>> On Fri, Dec 21, 2012 at 4:36 PM, Andy Lutomirski >>> wrote: >>>> Someth

Re: [PATCH v2 2/3] mm: Update file times when inodes are written after mmaped writes

2012-12-22 Thread Andy Lutomirski
On Sat, Dec 22, 2012 at 12:29 AM, Christoph Hellwig wrote: > NAK, we went through great trouble to get rid of the nasty layering > violation where the VM called file_update_time directly just a short > while ago, reintroducing that is a massive step back. > > Make sure whatever "solution" for your

Re: [PATCH 52/58] x86: vdso: Add prototypes for __vdso_* functions

2012-11-19 Thread Andy Lutomirski
86/vdso/vgetcpu.c b/arch/x86/vdso/vgetcpu.c > index 5463ad5..b55350f 100644 > --- a/arch/x86/vdso/vgetcpu.c > +++ b/arch/x86/vdso/vgetcpu.c > @@ -12,6 +12,8 @@ > #include > #include > > +long __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache > *unused);

Re: [PATCH 52/58] x86: vdso: Add prototypes for __vdso_* functions

2012-11-19 Thread Andy Lutomirski
On Mon, Nov 19, 2012 at 12:37 PM, Josh Triplett wrote: > On Mon, Nov 19, 2012 at 12:04:23PM -0800, Andy Lutomirski wrote: >> On Sun, Nov 18, 2012 at 9:28 PM, Josh Triplett wrote: >> > arch/x86/vdso/vclock_gettime.c and arch/x86/vdso/vgetcpu.c define >> > several fu

Re: [PATCH 0/5] x86: oops on uaccess faults outside of user addresses

2013-06-13 Thread Andy Lutomirski
On Wed, May 22, 2013 at 2:07 PM, Andy Lutomirski wrote: > Currently, __get_user can't trigger an OOPS -- any exception will be > caught and return -EFAULT. This means that, if an access_ok check is > missing somewhere, then an attacker can freely use it to probe for valid >

[PATCH] net: Unbreak compat_sys_{send,recv}msg

2013-06-05 Thread Andy Lutomirski
I broke them in this commit: commit 1be374a0518a288147c6a7398792583200a67261 Author: Andy Lutomirski Date: Wed May 22 14:07:44 2013 -0700 net: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg This patch adds __sys_sendmsg and __sys_sendmsg as common helpers that accept

Re: MTRR use in drivers

2013-06-23 Thread Andy Lutomirski
sion report that you broke old boxes. >> > > Not "just because", but *if* the choice is between breaking old boxes > and breaking new boxes I'll take the latter. > >> Andy Lutomirski just submitted a bunch of patches to clean up the DRM >> us

Re: [RFC 3/6] drm: add SimpleDRM driver

2013-06-24 Thread Andy Lutomirski
On 06/24/2013 03:27 PM, David Herrmann wrote: > + sdrm->fb_map = ioremap(sdrm->fb_base, sdrm->fb_size); This should probably be ioremap_wc. Otherwise it will be *really* slow if used in legacy mode and it may cause conflicts with the pgprot_writecombine mode for mmap. (Watching boot messages

[PATCH] proc: Expose /proc//task//children unconditionally

2013-06-25 Thread Andy Lutomirski
This is currently only available if CONFIG_CHECKPOINT_RESTORE, which is hidden under CONFIG_EXPERT. It's generally useful functionality, though, so expose it unconditionally. Cc: Cyrill Gorcunov Signed-off-by: Andy Lutomirski --- fs/proc/array.c | 2 -- fs/proc/base.c | 2 -- 2 files ch

Re: [PATCH] proc: Expose /proc//task//children unconditionally

2013-06-25 Thread Andy Lutomirski
On Tue, Jun 25, 2013 at 1:17 PM, Oleg Nesterov wrote: > On 06/26, Cyrill Gorcunov wrote: >> >> On Tue, Jun 25, 2013 at 12:51:45PM -0700, Andy Lutomirski wrote: >> > This is currently only available if CONFIG_CHECKPOINT_RESTORE, which >> > is hidden under CONF

Re: [PATCH] proc: Expose /proc//task//children unconditionally

2013-06-25 Thread Andy Lutomirski
On Tue, Jun 25, 2013 at 2:52 PM, Cyrill Gorcunov wrote: > On Tue, Jun 25, 2013 at 02:36:31PM -0700, Andy Lutomirski wrote: >> On Tue, Jun 25, 2013 at 1:17 PM, Oleg Nesterov wrote: >> > On 06/26, Cyrill Gorcunov wrote: >> >> >> >> On Tue, Jun 25, 2013

Re: [PATCH RFC nohz_full 0/8] Provide infrastructure for full-system idle

2013-06-25 Thread Andy Lutomirski
On 06/25/2013 02:49 PM, Thomas Gleixner wrote: > On Tue, 25 Jun 2013, Paul E. McKenney wrote: >> Note that this version pays attention to CPUs that have taken an NMI >> from idle. It is not clear to me that NMI handlers can safely access >> the time on a system that is long-term idle. Unless some

Re: adopt(pid_t pid) syscall proposal [patch included]

2013-06-11 Thread Andy Lutomirski
On 06/10/2013 06:23 PM, vcap...@gnugeneration.com wrote: + if (!uid_eq(cred->euid, tcred->suid) && + !uid_eq(cred->euid, tcred->uid) && + !uid_eq(cred->uid, tcred->suid) && + !uid_eq(cred->uid,

Re: [PATCH] proc: Document that /proc//task//children really is per-thread

2013-07-01 Thread Andy Lutomirski
On Mon, Jul 1, 2013 at 9:49 AM, Rob Landley wrote: > On 06/26/2013 04:05:01 PM, Andy Lutomirski wrote: >> >> I was surprised to discover that a process can have a parent that isn't >> a thread group leader. (The usual ppid interfaces hide this, but the >> childre

Re: [RFC PATCH] Allow optional module parameters

2013-07-03 Thread Andy Lutomirski
arbage=1 to prevent modulename from loading at boot. It may be worth adding a more intentional way to do that. --Andy -- Andy Lutomirski AMA Capital Management, LLC -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.k

Re: [RFC PATCH] Allow optional module parameters

2013-07-03 Thread Andy Lutomirski
On Wed, Jul 3, 2013 at 2:31 PM, Lucas De Marchi wrote: > On Wed, Jul 3, 2013 at 6:23 PM, Michal Marek wrote: >> Dne 3.7.2013 23:17, Andy Lutomirski napsal(a): >>> On Wed, Jul 3, 2013 at 2:03 PM, Michal Marek wrote: >>>> Dne 1.7.2013 18:33, Jonathan Masters napsal(a

Re: [PATCH] proc: Expose /proc//task//children unconditionally

2013-06-26 Thread Andy Lutomirski
On Wed, Jun 26, 2013 at 8:57 AM, Oleg Nesterov wrote: > On 06/25, Andy Lutomirski wrote: >> >> On Tue, Jun 25, 2013 at 2:52 PM, Cyrill Gorcunov wrote: >> > On Tue, Jun 25, 2013 at 02:36:31PM -0700, Andy Lutomirski wrote: >> >> On Tue, Jun 25, 2013 at 1:17 PM,

[PATCH] proc: Document that /proc//task//children really is per-thread

2013-06-26 Thread Andy Lutomirski
I was surprised to discover that a process can have a parent that isn't a thread group leader. (The usual ppid interfaces hide this, but the children list exposes it.) Signed-off-by: Andy Lutomirski Cc: Cyrill Gorcunov Cc: Oleg Nesterov --- Documentation/filesystems/proc.txt | 6

Re: deadlock in scheduler enabling HRTICK feature

2013-06-27 Thread Andy Lutomirski
On 06/27/2013 03:53 AM, Peter Zijlstra wrote: > On Thu, Jun 27, 2013 at 12:43:09PM +0200, Peter Zijlstra wrote: >> On Wed, Jun 26, 2013 at 10:46:33AM -0600, David Ahern wrote: >>> On 6/26/13 1:05 AM, Peter Zijlstra wrote: > What is the expectation that the feature provides? not a whole lot of >

Re: cgroup: status-quo and userland efforts

2013-06-28 Thread Andy Lutomirski
On 06/27/2013 11:01 AM, Tejun Heo wrote: > AFAICS, having a userland agent which has overall knowledge of the > hierarchy and enforcesf structure and limiations is a requirement to > make cgroup generally useable and useful. For systemd based systems, > systemd serving that role isn't too crazy.

Re: DoS with unprivileged mounts

2013-08-14 Thread Andy Lutomirski
On 08/14/2013 10:42 AM, Miklos Szeredi wrote: > There's a simple and effective way to prevent unlink(2) and rename(2) > from operating on any file or directory by simply mounting something > on it. In any mount instance in any namespace. > > Was this considered in the unprivileged mount design? >

Re: DoS with unprivileged mounts

2013-08-14 Thread Andy Lutomirski
On Wed, Aug 14, 2013 at 12:53 PM, Eric W. Biederman wrote: > Andy Lutomirski writes: > >> On 08/14/2013 10:42 AM, Miklos Szeredi wrote: >>> There's a simple and effective way to prevent unlink(2) and rename(2) >>> from operating on any file or directory by

Re: page fault scalability (ext3, ext4, xfs)

2013-08-14 Thread Andy Lutomirski
On Wed, Aug 14, 2013 at 4:06 PM, Theodore Ts'o wrote: > On Wed, Aug 14, 2013 at 01:50:02PM -0700, Dave Hansen wrote: >> >> Would a plain old fallocate() do the trick, or does it actually need >> zeros written to it? > > It would be better to write zeros to it, so we aren't measuring the > cost of

mei oopses at startup if it's built-in (3.11-rc5)

2013-08-14 Thread Andy Lutomirski
It blows up early enough that it's awkward to get the whole oops, but it's in the probe function. If it's a module, I get instead: [ 73.401679] mei_me :00:16.0: Device doesn't have valid ME Interface [ 73.401684] mei_me :00:16.0: initialization failed. Let me know if I should debug f

Re: page fault scalability (ext3, ext4, xfs)

2013-08-14 Thread Andy Lutomirski
On Wed, Aug 14, 2013 at 7:10 PM, Dave Chinner wrote: > On Wed, Aug 14, 2013 at 09:11:01PM -0400, Theodore Ts'o wrote: >> On Wed, Aug 14, 2013 at 04:38:12PM -0700, Andy Lutomirski wrote: >> > > It would be better to write zeros to it, so we aren't measuring t

Re: page fault scalability (ext3, ext4, xfs)

2013-08-14 Thread Andy Lutomirski
On Wed, Aug 14, 2013 at 11:01 PM, Dave Chinner wrote: > On Wed, Aug 14, 2013 at 09:32:13PM -0700, Andy Lutomirski wrote: >> On Wed, Aug 14, 2013 at 7:10 PM, Dave Chinner wrote: >> > On Wed, Aug 14, 2013 at 09:11:01PM -0400, Theodore Ts'o wrote: >> >> On We

Re: page fault scalability (ext3, ext4, xfs)

2013-08-14 Thread Andy Lutomirski
On Wed, Aug 14, 2013 at 11:18 PM, David Lang wrote: > On Wed, 14 Aug 2013, Andy Lutomirski wrote: > >>> The big problem with this approach is that not doing the >>> timestamp update on page faults is going to break the inode change >>> version counting because f

Re: DoS with unprivileged mounts

2013-08-14 Thread Andy Lutomirski
On Wed, Aug 14, 2013 at 11:45 PM, Eric W. Biederman wrote: > Miklos Szeredi writes: > >> On Wed, Aug 14, 2013 at 9:32 PM, Eric W. Biederman >> wrote: >> The solution is also theoretically simple: mounts in unpriv namespaces are marked "volatile" and are dissolved on an unlink type oper

Re: page fault scalability (ext3, ext4, xfs)

2013-08-15 Thread Andy Lutomirski
On Thu, Aug 15, 2013 at 12:11 AM, Dave Chinner wrote: > On Wed, Aug 14, 2013 at 11:14:37PM -0700, Andy Lutomirski wrote: >> On Wed, Aug 14, 2013 at 11:01 PM, Dave Chinner wrote: >> > On Wed, Aug 14, 2013 at 09:32:13PM -0700, Andy Lutomirski wrote: >> >> On Wed,

Re: mei oopses at startup if it's built-in (3.11-rc5)

2013-08-15 Thread Andy Lutomirski
On Wed, Aug 14, 2013 at 9:05 PM, Winkler, Tomas wrote: > > >> -Original Message----- >> From: Andy Lutomirski [mailto:l...@amacapital.net] >> Sent: Thursday, August 15, 2013 03:15 >> To: Winkler, Tomas; linux-kernel@vger.kernel.org >> Subject: mei oopses a

Re: page fault scalability (ext3, ext4, xfs)

2013-08-15 Thread Andy Lutomirski
On Thu, Aug 15, 2013 at 2:28 PM, Dave Chinner wrote: > On Thu, Aug 15, 2013 at 09:45:31AM +0200, Jan Kara wrote: >> On Thu 15-08-13 17:11:42, Dave Chinner wrote: >> > On Wed, Aug 14, 2013 at 11:14:37PM -0700, Andy Lutomirski wrote: >> > > On Wed, Aug 14,

Re: page fault scalability (ext3, ext4, xfs)

2013-08-15 Thread Andy Lutomirski
On Thu, Aug 15, 2013 at 2:37 PM, Dave Chinner wrote: > On Thu, Aug 15, 2013 at 08:17:18AM -0700, Andy Lutomirski wrote: >> I didn't think of that at all. >> >> If userspace does: >> >> ptr = mmap(...); >> ptr[0] = 1; >> sleep(1); >> ptr[0] =

Re: page fault scalability (ext3, ext4, xfs)

2013-08-15 Thread Andy Lutomirski
On Thu, Aug 15, 2013 at 3:18 PM, Dave Chinner wrote: > On Thu, Aug 15, 2013 at 02:43:09PM -0700, Andy Lutomirski wrote: >> On Thu, Aug 15, 2013 at 2:37 PM, Dave Chinner >> wrote: >> > On Thu, Aug 15, 2013 at 08:17:18AM -0700, Andy Lutomirski wrote: >> >> My

Re: page fault scalability (ext3, ext4, xfs)

2013-08-15 Thread Andy Lutomirski
On Thu, Aug 15, 2013 at 5:14 PM, Dave Chinner wrote: > On Thu, Aug 15, 2013 at 03:26:09PM -0700, Andy Lutomirski wrote: >> On Thu, Aug 15, 2013 at 3:18 PM, Dave Chinner wrote: >> > On Thu, Aug 15, 2013 at 02:43:09PM -0700, Andy Lutomirski wrote: >> >> On Thu,

[PATCH v3 4/5] mm: Scan for dirty ptes and update cmtime on MS_ASYNC

2013-08-16 Thread Andy Lutomirski
This is probably unimportant but improves POSIX compliance. Signed-off-by: Andy Lutomirski --- mm/msync.c | 83 +- 1 file changed, 72 insertions(+), 11 deletions(-) diff --git a/mm/msync.c b/mm/msync.c index 632df45..9e41acd 100644

[PATCH v3 3/5] mm: Notify filesystems when it's time to apply a deferred cmtime update

2013-08-16 Thread Andy Lutomirski
onal optimization, filesystems can call mapping_test_clear_cmtime themselves in ->writepages (as long as they're careful to scan all the pages first -- the cmtime bit may not be set when ->writepages is entered). This patch does not implement the MS_ASYNC case; that's in the next patch

[PATCH v3 5/5] ext4: Defer mmap cmtime update until writeback

2013-08-16 Thread Andy Lutomirski
A fancier implementation could probably avoid an extra journal transaction by adding a mapping_test_clear_cmtime call in ext4_writepages, but this should already be a considerable improvement -- we'll start one transaction per writepages call instead of one per page. Signed-off-by:

Re: page fault scalability (ext3, ext4, xfs)

2013-08-16 Thread Andy Lutomirski
On Fri, Aug 16, 2013 at 3:02 PM, J. Bruce Fields wrote: > On Fri, Aug 16, 2013 at 07:37:25AM +1000, Dave Chinner wrote: >> On Thu, Aug 15, 2013 at 08:17:18AM -0700, Andy Lutomirski wrote: >> > On Thu, Aug 15, 2013 at 12:11 AM, Dave Chinner wrote: >> > > On Wed, Au

[PATCH v3 2/5] fs: Add inode_update_time_writable

2013-08-16 Thread Andy Lutomirski
This is like file_update_time, except that it acts on a struct inode * instead of a struct file *. Signed-off-by: Andy Lutomirski --- fs/inode.c | 72 ++ include/linux/fs.h | 1 + 2 files changed, 58 insertions(+), 15 deletions

[PATCH v3 0/5] Rework mtime and ctime updates on mmaped

2013-08-16 Thread Andy Lutomirski
le now locks against the fs freezer. - Minor cleanups. - Major changelog improvements. Andy Lutomirski (5): mm: Track mappings that have been written via ptes fs: Add inode_update_time_writable mm: Notify filesystems when it's time to apply a deferred cmtime update mm: Scan

[PATCH v3 1/5] mm: Track mappings that have been written via ptes

2013-08-16 Thread Andy Lutomirski
red cmtime update mechanism, setting the AS_CMTIME bit has no effect. Signed-off-by: Andy Lutomirski --- include/linux/pagemap.h | 11 +++ mm/memory.c | 7 ++- mm/rmap.c | 27 +-- 3 files changed, 42 insertions(+), 3 deletions(-) di

Re: PATCH? fix unshare(NEWPID) && vfork()

2013-08-19 Thread Andy Lutomirski
p; (CLONE_THREAD|CLONE_PARENT)) > + if ((clone_flags & (CLONE_NEWUSER | CLONE_NEWPID)) || > + (task_active_pid_ns(current) != current->nsproxy->pid_ns)) { > + if (clone_flags & (CLONE_THREAD | CLONE_PARENT | > CLONE_NEWPID)) >

Re: PATCH? fix unshare(NEWPID) && vfork()

2013-08-19 Thread Andy Lutomirski
On Mon, Aug 19, 2013 at 11:33 AM, Oleg Nesterov wrote: > On 08/19, Andy Lutomirski wrote: >> >> On Mon, Aug 19, 2013 at 10:25 AM, Oleg Nesterov wrote: >> > Hello. >> > >> > Colin reports that vfork() doesn't work after unshare(PIDNS).

Re: page fault scalability (ext3, ext4, xfs)

2013-08-19 Thread Andy Lutomirski
On Mon, Aug 19, 2013 at 3:17 PM, J. Bruce Fields wrote: > On Thu, Aug 15, 2013 at 04:01:49PM +1000, Dave Chinner wrote: >> On Wed, Aug 14, 2013 at 09:32:13PM -0700, Andy Lutomirski wrote: >> > On Wed, Aug 14, 2013 at 7:10 PM, Dave Chinner wrote: >> > > On Wed, Au

Re: page fault scalability (ext3, ext4, xfs)

2013-08-19 Thread Andy Lutomirski
for write; fsync; write; fsync to leave the timestamp matching the first write. I'd rather get comments on the current form of my patches and maybe get them merged before looking at even more far-reaching extensions, though. --Andy -- Andy Lutomirski AMA Capital Management, L

Re: [PATCH v3 2/5] fs: Add inode_update_time_writable

2013-08-19 Thread Andy Lutomirski
On Mon, Aug 19, 2013 at 7:28 PM, Dave Chinner wrote: > On Fri, Aug 16, 2013 at 04:22:09PM -0700, Andy Lutomirski wrote: >> This is like file_update_time, except that it acts on a struct inode * >> instead of a struct file *. >> >> Signed-off-by: Andy Lutomirski >>

Re: [PATCH v3 3/5] mm: Notify filesystems when it's time to apply a deferred cmtime update

2013-08-19 Thread Andy Lutomirski
On Mon, Aug 19, 2013 at 7:36 PM, Dave Chinner wrote: > On Fri, Aug 16, 2013 at 04:22:10PM -0700, Andy Lutomirski wrote: >> Filesystems that defer cmtime updates should update cmtime when any >> of these events happen after a write via a mapping: >> >> - The mapping is

Re: [PATCH v3 5/5] ext4: Defer mmap cmtime update until writeback

2013-08-19 Thread Andy Lutomirski
On Mon, Aug 19, 2013 at 7:38 PM, Dave Chinner wrote: > On Fri, Aug 16, 2013 at 04:22:12PM -0700, Andy Lutomirski wrote: >> A fancier implementation could probably avoid an extra journal >> transaction by adding a mapping_test_clear_cmtime call in >> ext4_writepages, but thi

Re: [PATCH v3 2/5] fs: Add inode_update_time_writable

2013-08-19 Thread Andy Lutomirski
On Mon, Aug 19, 2013 at 8:33 PM, Dave Chinner wrote: > On Mon, Aug 19, 2013 at 08:20:12PM -0700, Andy Lutomirski wrote: >> On Mon, Aug 19, 2013 at 7:28 PM, Dave Chinner wrote: >> > On Fri, Aug 16, 2013 at 04:22:09PM -0700, Andy Lutomirski wrote: >> >> This is like

<    1   2   3   4   5   6   7   8   9   10   >