Re: [PATCH] proc: show locks in /proc/pid/fdinfo/X

2015-03-06 Thread Cyrill Gorcunov
332 ?00:00:00 rpcbind ... Looks reasonable to me, thanks! Acked-by: Cyrill Gorcunov gorcu...@openvz.org -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH] mm: replace mmap_sem for mm->exe_file serialization

2015-02-26 Thread Cyrill Gorcunov
On Thu, Feb 26, 2015 at 11:36:57AM -0800, Davidlohr Bueso wrote: > We currently use the mmap_sem to serialize the mm exe_file. > This is atrocious and a clear example of the misuses this > lock has all over the place, making any significant changes > to the address space locking that much more

Re: [PATCH] mm: replace mmap_sem for mm-exe_file serialization

2015-02-26 Thread Cyrill Gorcunov
On Thu, Feb 26, 2015 at 11:36:57AM -0800, Davidlohr Bueso wrote: We currently use the mmap_sem to serialize the mm exe_file. This is atrocious and a clear example of the misuses this lock has all over the place, making any significant changes to the address space locking that much more complex

Re: [RFC][PATCH v3] procfs: Always expose /proc//map_files/ and make it readable

2015-02-11 Thread Cyrill Gorcunov
ODE_ATTACH); > + put_task_struct(task); > + } else return ERR_PTR(-ESRCH); Other than that, looks good to me, thanks! Rewieved-by: Cyrill Gorcunov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to m

Re: [RFC][PATCH v3] procfs: Always expose /proc/pid/map_files/ and make it readable

2015-02-11 Thread Cyrill Gorcunov
(-ESRCH); Other than that, looks good to me, thanks! Rewieved-by: Cyrill Gorcunov gorcu...@openvz.org -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [RFC][PATCH v2] procfs: Always expose /proc//map_files/ and make it readable

2015-01-27 Thread Cyrill Gorcunov
On Tue, Jan 27, 2015 at 11:53:19AM -0800, Kees Cook wrote: > >> > >> Are mount namespaces handled in this output? > > > > Could you clarify this moment, i'm not sure i get it. > > I changed how I asked this question in my review of the documentation, > but it looks like these symlinks aren't

Re: [PATCH] docs: procs -- Describe /proc//map_files entry

2015-01-27 Thread Cyrill Gorcunov
On Tue, Jan 27, 2015 at 11:50:49AM -0800, Kees Cook wrote: > > + > > +The main purpose of map_files directory is to be able to retrieve a set of > > +memory mapped files in a fast way instead of parsing /proc//maps or > > +/proc//smaps which contain a way more records. Same time one can > >

[PATCH] docs: procs -- Describe /proc//map_files entry

2015-01-27 Thread Cyrill Gorcunov
Signed-off-by: Cyrill Gorcunov CC: Kees Cook CC: Andrew Morton CC: "Kirill A. Shutemov" CC: Calvin Owens CC: Alexey Dobriyan CC: Oleg Nesterov CC: "Eric W. Biederman" CC: Al Viro CC: Peter Feiner CC: Pavel Emelyanov --- Gentlemen, could you please take a look onc

[PATCH] docs: procs -- Describe /proc/pid/map_files entry

2015-01-27 Thread Cyrill Gorcunov
Signed-off-by: Cyrill Gorcunov gorcu...@openvz.org CC: Kees Cook keesc...@chromium.org CC: Andrew Morton a...@linux-foundation.org CC: Kirill A. Shutemov kir...@shutemov.name CC: Calvin Owens calvinow...@fb.com CC: Alexey Dobriyan adobri...@gmail.com CC: Oleg Nesterov o...@redhat.com CC: Eric W

Re: [PATCH] docs: procs -- Describe /proc/pid/map_files entry

2015-01-27 Thread Cyrill Gorcunov
On Tue, Jan 27, 2015 at 11:50:49AM -0800, Kees Cook wrote: + +The main purpose of map_files directory is to be able to retrieve a set of +memory mapped files in a fast way instead of parsing /proc/pid/maps or +/proc/pid/smaps which contain a way more records. Same time one can open(2)

Re: [RFC][PATCH v2] procfs: Always expose /proc/pid/map_files/ and make it readable

2015-01-27 Thread Cyrill Gorcunov
On Tue, Jan 27, 2015 at 11:53:19AM -0800, Kees Cook wrote: Are mount namespaces handled in this output? Could you clarify this moment, i'm not sure i get it. I changed how I asked this question in my review of the documentation, but it looks like these symlinks aren't regular symlinks

Re: [RFC][PATCH v2] procfs: Always expose /proc//map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 04:15:26PM -0800, Kees Cook wrote: > > > > akpm3:/usr/src/25> grep -r map_files Documentation > > If akpm's comments weren't clear: this needs to be fixed. Everything > in /proc should appear in Documentation. I'll do that. > > The 640708a2cff7f81 changelog says: > > > >

Re: [RFC][PATCH v2] procfs: Always expose /proc//map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 10:50:23PM -0800, Andrew Morton wrote: > On Tue, 27 Jan 2015 09:46:47 +0300 Cyrill Gorcunov wrote: > > > > There's one other problem here: we're assuming that the map_files > > > implementation doesn't have bugs. If it does have bugs then relaxin

Re: [RFC][PATCH v2] procfs: Always expose /proc//map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 03:43:46PM -0800, Andrew Morton wrote: > > > > Looks good to me, thanks! Though I would really appreciate if someone > > from security camp take a look as well. > > hm, who's that. Kees comes to mind. yup, I managed to forget CC him. > > And reviewers' task would be a

Re: [RFC][PATCH v2] procfs: Always expose /proc//map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 02:47:31PM +0200, Kirill A. Shutemov wrote: > On Fri, Jan 23, 2015 at 07:15:44PM -0800, Calvin Owens wrote: > > Currently, /proc//map_files/ is restricted to CAP_SYS_ADMIN, and > > is only exposed if CONFIG_CHECKPOINT_RESTORE is set. This interface > > is very useful for

Re: [PATCH] proc/pagemap: walk page tables under pte lock

2015-01-26 Thread Cyrill Gorcunov
non-atomic if pte is larger than wordsize. > Other pte walkers (smaps, numa_maps, clear_refs) already lock ptes. > > Signed-off-by: Konstantin Khlebnikov > Reported-by: Andrey Ryabinin > Fixes: 052fb0d635df ("proc: report file/anon bit in /proc/pid/pagemap") > Cc: S

Re: [PATCH] proc/pagemap: walk page tables under pte lock

2015-01-26 Thread Cyrill Gorcunov
-by: Cyrill Gorcunov gorcu...@openvz.org Thank you! -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [RFC][PATCH v2] procfs: Always expose /proc/pid/map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 10:50:23PM -0800, Andrew Morton wrote: On Tue, 27 Jan 2015 09:46:47 +0300 Cyrill Gorcunov gorcu...@gmail.com wrote: There's one other problem here: we're assuming that the map_files implementation doesn't have bugs. If it does have bugs then relaxing

Re: [RFC][PATCH v2] procfs: Always expose /proc/pid/map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 03:43:46PM -0800, Andrew Morton wrote: Looks good to me, thanks! Though I would really appreciate if someone from security camp take a look as well. hm, who's that. Kees comes to mind. yup, I managed to forget CC him. And reviewers' task would be a heck of a

Re: [RFC][PATCH v2] procfs: Always expose /proc/pid/map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 04:15:26PM -0800, Kees Cook wrote: akpm3:/usr/src/25 grep -r map_files Documentation If akpm's comments weren't clear: this needs to be fixed. Everything in /proc should appear in Documentation. I'll do that. The 640708a2cff7f81 changelog says: : This

Re: [RFC][PATCH v2] procfs: Always expose /proc/pid/map_files/ and make it readable

2015-01-26 Thread Cyrill Gorcunov
On Mon, Jan 26, 2015 at 02:47:31PM +0200, Kirill A. Shutemov wrote: On Fri, Jan 23, 2015 at 07:15:44PM -0800, Calvin Owens wrote: Currently, /proc/pid/map_files/ is restricted to CAP_SYS_ADMIN, and is only exposed if CONFIG_CHECKPOINT_RESTORE is set. This interface is very useful for

Re: [RFC][PATCH] procfs: Always expose /proc//map_files/ and make it readable

2015-01-21 Thread Cyrill Gorcunov
On Wed, Jan 21, 2015 at 06:45:54PM -0800, Calvin Owens wrote: > Currently, /proc//map_files/ is restricted to CAP_SYS_ADMIN, and > is only exposed if CONFIG_CHECKPOINT_RESTORE is set. This interface > is very useful for enumerating the files mapped into a process when > the more verbose

Re: [RFC][PATCH] procfs: Always expose /proc/pid/map_files/ and make it readable

2015-01-21 Thread Cyrill Gorcunov
On Wed, Jan 21, 2015 at 06:45:54PM -0800, Calvin Owens wrote: Currently, /proc/pid/map_files/ is restricted to CAP_SYS_ADMIN, and is only exposed if CONFIG_CHECKPOINT_RESTORE is set. This interface is very useful for enumerating the files mapped into a process when the more verbose information

Re: linux-next: build failure after merge of the akpm-current tree

2015-01-19 Thread Cyrill Gorcunov
On Mon, Jan 19, 2015 at 07:17:18PM +1100, Stephen Rothwell wrote: > Hi Andrew, > > After merging the akpm tree, today's linux-next build (sparc defconfig) > failed like this: > > In file included from arch/sparc/include/asm/bug.h:20:0, > from include/linux/bug.h:4, >

Re: linux-next: build failure after merge of the akpm-current tree

2015-01-19 Thread Cyrill Gorcunov
On Mon, Jan 19, 2015 at 07:17:18PM +1100, Stephen Rothwell wrote: Hi Andrew, After merging the akpm tree, today's linux-next build (sparc defconfig) failed like this: In file included from arch/sparc/include/asm/bug.h:20:0, from include/linux/bug.h:4,

Re: [RFC][PATCH] procfs: Add /proc//mapped_files

2015-01-14 Thread Cyrill Gorcunov
On Wed, Jan 14, 2015 at 12:46:53PM -0800, Calvin Owens wrote: > > > > > > Restriction to CAP_SYSADMIN for follow_link is undertansble, but why do we > > > restrict readdir and readlink? > > > > We didn't think this functionality might be needed someone but us (criu > > camp), > > so that the

Re: [PATCH] mm: account pmd page tables to the process

2015-01-14 Thread Cyrill Gorcunov
nux > kernel doesn't account PMD tables to the process, only PTE. > > The use-cases below use few tricks to allocate a lot of PMD page tables > while keeping VmRSS and VmPTE low. oom_score for the process will be 0. Reviewed-by: Cyrill Gorcunov -- To unsubscribe from this list: se

Re: [RFC][PATCH] procfs: Add /proc//mapped_files

2015-01-14 Thread Cyrill Gorcunov
On Wed, Jan 14, 2015 at 05:25:01PM +0200, Kirill A. Shutemov wrote: ... > > > > This gives lsof and suchlike a way to determine the pathnames of files > > mapped into a process without incurring the O(N^2) behavior of the > > maps file. > > We already have /proc/PID/map_files/ directory which

Re: [PATCH 1/2] mm: rename mm->nr_ptes to mm->nr_pgtables

2015-01-14 Thread Cyrill Gorcunov
On Wed, Jan 14, 2015 at 04:33:58PM +0200, Kirill A. Shutemov wrote: > > > > It looks like this doesn't matter. The statistics here prints the size > > of summary memory occupied for pte_t entries, here PTRS_PER_PTE * > > sizeof(pte_t) > > is only valid for, once we start accounting pmd into same

Re: [PATCH 1/2] mm: rename mm->nr_ptes to mm->nr_pgtables

2015-01-14 Thread Cyrill Gorcunov
On Tue, Jan 13, 2015 at 01:49:10PM -0800, Dave Hansen wrote: > On 01/13/2015 01:43 PM, Cyrill Gorcunov wrote: > > On Tue, Jan 13, 2015 at 09:14:15PM +0200, Kirill A. Shutemov wrote: > >> We're going to account pmd page tables too. Let's rename mm->nr_pgtables > >

Re: [RFC][PATCH] procfs: Add /proc/pid/mapped_files

2015-01-14 Thread Cyrill Gorcunov
On Wed, Jan 14, 2015 at 12:46:53PM -0800, Calvin Owens wrote: Restriction to CAP_SYSADMIN for follow_link is undertansble, but why do we restrict readdir and readlink? We didn't think this functionality might be needed someone but us (criu camp), so that the rule of thumb was

Re: [PATCH 1/2] mm: rename mm-nr_ptes to mm-nr_pgtables

2015-01-14 Thread Cyrill Gorcunov
On Wed, Jan 14, 2015 at 04:33:58PM +0200, Kirill A. Shutemov wrote: It looks like this doesn't matter. The statistics here prints the size of summary memory occupied for pte_t entries, here PTRS_PER_PTE * sizeof(pte_t) is only valid for, once we start accounting pmd into same counter

Re: [RFC][PATCH] procfs: Add /proc/pid/mapped_files

2015-01-14 Thread Cyrill Gorcunov
On Wed, Jan 14, 2015 at 05:25:01PM +0200, Kirill A. Shutemov wrote: ... This gives lsof and suchlike a way to determine the pathnames of files mapped into a process without incurring the O(N^2) behavior of the maps file. We already have /proc/PID/map_files/ directory which lists all

Re: [PATCH] mm: account pmd page tables to the process

2015-01-14 Thread Cyrill Gorcunov
doesn't account PMD tables to the process, only PTE. The use-cases below use few tricks to allocate a lot of PMD page tables while keeping VmRSS and VmPTE low. oom_score for the process will be 0. Reviewed-by: Cyrill Gorcunov gorcu...@openvz.org -- To unsubscribe from this list: send the line

Re: [PATCH 1/2] mm: rename mm-nr_ptes to mm-nr_pgtables

2015-01-14 Thread Cyrill Gorcunov
On Tue, Jan 13, 2015 at 01:49:10PM -0800, Dave Hansen wrote: On 01/13/2015 01:43 PM, Cyrill Gorcunov wrote: On Tue, Jan 13, 2015 at 09:14:15PM +0200, Kirill A. Shutemov wrote: We're going to account pmd page tables too. Let's rename mm-nr_pgtables to something more generic. Signed-off

Re: [PATCH 1/2] mm: rename mm->nr_ptes to mm->nr_pgtables

2015-01-13 Thread Cyrill Gorcunov
On Tue, Jan 13, 2015 at 09:14:15PM +0200, Kirill A. Shutemov wrote: > We're going to account pmd page tables too. Let's rename mm->nr_pgtables > to something more generic. > > Signed-off-by: Kirill A. Shutemov > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -64,7 +64,7 @@ void

Re: [PATCH 1/2] mm: rename mm-nr_ptes to mm-nr_pgtables

2015-01-13 Thread Cyrill Gorcunov
On Tue, Jan 13, 2015 at 09:14:15PM +0200, Kirill A. Shutemov wrote: We're going to account pmd page tables too. Let's rename mm-nr_pgtables to something more generic. Signed-off-by: Kirill A. Shutemov kirill.shute...@linux.intel.com --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@

Re: [PATCH] ASLRv3: randomize_va_space=3 preventing offset2lib attack

2014-12-19 Thread Cyrill Gorcunov
On Fri, Dec 19, 2014 at 02:11:37PM -0800, Andy Lutomirski wrote: ... > > > > Therefore, I can fix the current implementation (maintaining the > > randomize_va_space=2) by moving the PIE executable from the mmap base > > area to another one for x86*, ARM* and MIPS (as s390 and PowerPC do). > > But

Re: Latest kernel build problem in arch/x86/ia32/audit.c

2014-12-19 Thread Cyrill Gorcunov
On Thu, Dec 18, 2014 at 10:04:09PM +0300, Cyrill Gorcunov wrote: > case __NR_execveat: >^ > arch/x86/ia32/audit.c:38:7: note: each undeclared identifier is reported only > once for each function it appears in > make[2]: *** [arch/x86/ia32/audit.o] Error 1 > make[1]:

Re: Latest kernel build problem in arch/x86/ia32/audit.c

2014-12-19 Thread Cyrill Gorcunov
On Thu, Dec 18, 2014 at 10:04:09PM +0300, Cyrill Gorcunov wrote: case __NR_execveat: ^ arch/x86/ia32/audit.c:38:7: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [arch/x86/ia32/audit.o] Error 1 make[1]: *** [arch/x86/ia32] Error

Re: [PATCH] ASLRv3: randomize_va_space=3 preventing offset2lib attack

2014-12-19 Thread Cyrill Gorcunov
On Fri, Dec 19, 2014 at 02:11:37PM -0800, Andy Lutomirski wrote: ... Therefore, I can fix the current implementation (maintaining the randomize_va_space=2) by moving the PIE executable from the mmap base area to another one for x86*, ARM* and MIPS (as s390 and PowerPC do). But we shall

Latest kernel build problem in arch/x86/ia32/audit.c

2014-12-18 Thread Cyrill Gorcunov
Hi! Being trying to build latest repo (2dbfca5a181973558277b28b1f4c36362291f5e0) and ended up in CC arch/x86/ia32/audit.o arch/x86/ia32/audit.c: In function ‘ia32_classify_syscall’: arch/x86/ia32/audit.c:38:7: error: ‘__NR_execveat’ undeclared (first use in this function) case

Latest kernel build problem in arch/x86/ia32/audit.c

2014-12-18 Thread Cyrill Gorcunov
Hi! Being trying to build latest repo (2dbfca5a181973558277b28b1f4c36362291f5e0) and ended up in CC arch/x86/ia32/audit.o arch/x86/ia32/audit.c: In function ‘ia32_classify_syscall’: arch/x86/ia32/audit.c:38:7: error: ‘__NR_execveat’ undeclared (first use in this function) case

Re: [RFC PATCH] proc, pidns: Add highpid

2014-11-29 Thread Cyrill Gorcunov
On Fri, Nov 28, 2014 at 03:05:01PM -0800, Andy Lutomirski wrote: > Pid reuse is common, which means that it's difficult or impossible > to read information about a pid from /proc without races. > > This introduces a second number associated with each (task, pidns) > pair called highpid. Highpid

Re: [RFC PATCH] proc, pidns: Add highpid

2014-11-29 Thread Cyrill Gorcunov
On Fri, Nov 28, 2014 at 03:05:01PM -0800, Andy Lutomirski wrote: Pid reuse is common, which means that it's difficult or impossible to read information about a pid from /proc without races. This introduces a second number associated with each (task, pidns) pair called highpid. Highpid is a

Re: [PATCH 1/3] kcmp: Move kcmp.h into uapi

2014-10-23 Thread Cyrill Gorcunov
On Thu, Oct 23, 2014 at 09:49:14AM +0200, Arnd Bergmann wrote: > On Thursday 23 October 2014 16:07:12 Michael Ellerman wrote: > > --- a/include/linux/kcmp.h > > +++ b/include/linux/kcmp.h > > @@ -1,17 +1,6 @@ > > #ifndef _LINUX_KCMP_H > > #define _LINUX_KCMP_H > > > > -/* Comparison type */ >

Re: [PATCH 3/3] selftests/kcmp: Always try to build the test

2014-10-23 Thread Cyrill Gorcunov
On Thu, Oct 23, 2014 at 04:07:14PM +1100, Michael Ellerman wrote: > Don't prevent the test building on non-x86. Just try and build it and > let the chips fall where they may. > > Signed-off-by: Michael Ellerman kcmp depends on checkpoint/restore config symbol which is known to work on x86 and

Re: [PATCH 2/3] selftests/kcmp: Don't include kernel headers

2014-10-23 Thread Cyrill Gorcunov
ed-off-by: Michael Ellerman The reason was to be able to run test without userspace headers generated. Still this one is better I think. Acked-by: Cyrill Gorcunov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org

Re: [PATCH 1/3] kcmp: Move kcmp.h into uapi

2014-10-23 Thread Cyrill Gorcunov
On Thu, Oct 23, 2014 at 04:07:12PM +1100, Michael Ellerman wrote: > kcmp.h appears to be part of the API, it's documented in kcmp(2), and > the selftests/kcmp code uses it. So move it to uapi so it's actually > exported. > > Signed-off-by: Michael Ellerman Acked-by:

Re: [PATCH 1/3] kcmp: Move kcmp.h into uapi

2014-10-23 Thread Cyrill Gorcunov
On Thu, Oct 23, 2014 at 04:07:12PM +1100, Michael Ellerman wrote: kcmp.h appears to be part of the API, it's documented in kcmp(2), and the selftests/kcmp code uses it. So move it to uapi so it's actually exported. Signed-off-by: Michael Ellerman m...@ellerman.id.au Acked-by: Cyrill Gorcunov

Re: [PATCH 2/3] selftests/kcmp: Don't include kernel headers

2014-10-23 Thread Cyrill Gorcunov
...@ellerman.id.au The reason was to be able to run test without userspace headers generated. Still this one is better I think. Acked-by: Cyrill Gorcunov gorcu...@openvz.org -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org

Re: [PATCH 3/3] selftests/kcmp: Always try to build the test

2014-10-23 Thread Cyrill Gorcunov
On Thu, Oct 23, 2014 at 04:07:14PM +1100, Michael Ellerman wrote: Don't prevent the test building on non-x86. Just try and build it and let the chips fall where they may. Signed-off-by: Michael Ellerman m...@ellerman.id.au kcmp depends on checkpoint/restore config symbol which is known to

Re: [PATCH 1/3] kcmp: Move kcmp.h into uapi

2014-10-23 Thread Cyrill Gorcunov
On Thu, Oct 23, 2014 at 09:49:14AM +0200, Arnd Bergmann wrote: On Thursday 23 October 2014 16:07:12 Michael Ellerman wrote: --- a/include/linux/kcmp.h +++ b/include/linux/kcmp.h @@ -1,17 +1,6 @@ #ifndef _LINUX_KCMP_H #define _LINUX_KCMP_H -/* Comparison type */ -enum kcmp_type

Re: [PATCH] fs: don't remove inotify watchers from alive inode-s (v2)

2014-09-25 Thread Cyrill Gorcunov
On Thu, Sep 25, 2014 at 10:30:10AM +0200, Jan Kara wrote: > On Wed 24-09-14 13:19:47, Andrew Morton wrote: > > On Wed, 24 Sep 2014 12:51:55 +0200 Jan Kara wrote: > > > > > Hello, > > > > > > Andrew, what do you think about the patch below? Al objected that it > > > changes userspace visible

Re: [PATCH] mm: softdirty: keep bit when zapping file pte

2014-09-25 Thread Cyrill Gorcunov
On Wed, Sep 24, 2014 at 02:59:27PM -0700, Andrew Morton wrote: > On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner wrote: > > > Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and > > 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of > > pte_*mksoft_dirty was being

Re: [PATCH] fs: don't remove inotify watchers from alive inode-s (v2)

2014-09-25 Thread Cyrill Gorcunov
On Thu, Sep 25, 2014 at 10:30:10AM +0200, Jan Kara wrote: On Wed 24-09-14 13:19:47, Andrew Morton wrote: On Wed, 24 Sep 2014 12:51:55 +0200 Jan Kara j...@suse.cz wrote: Hello, Andrew, what do you think about the patch below? Al objected that it changes userspace visible

Re: [PATCH] mm: softdirty: keep bit when zapping file pte

2014-09-25 Thread Cyrill Gorcunov
On Wed, Sep 24, 2014 at 02:59:27PM -0700, Andrew Morton wrote: On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner pfei...@google.com wrote: Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of pte_*mksoft_dirty

Re: [PATCH] mm: softdirty: keep bit when zapping file pte

2014-09-20 Thread Cyrill Gorcunov
;mk" function return values were > being ignored, I annotated the functions in > arch/x86/include/asm/pgtable.h with __must_check and rebuilt. > > Signed-off-by: Peter Feiner Acked-by: Cyrill Gorcunov I might be missing it, thanks a huge Peter! -- To unsubscribe from this l

Re: [PATCH] mm: softdirty: keep bit when zapping file pte

2014-09-20 Thread Cyrill Gorcunov
were being ignored, I annotated the functions in arch/x86/include/asm/pgtable.h with __must_check and rebuilt. Signed-off-by: Peter Feiner pfei...@google.com Acked-by: Cyrill Gorcunov gorcu...@openvz.org I might be missing it, thanks a huge Peter! -- To unsubscribe from this list: send

Re: [PATCH] fs: don't remove inotify watchers from alive inode-s (v2)

2014-09-19 Thread Cyrill Gorcunov
Reviewed-by: Jan Kara Reviewed-by: Cyrill Gorcunov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] fs: don't remove inotify watchers from alive inode-s (v2)

2014-09-19 Thread Cyrill Gorcunov
Reviewed-by: Cyrill Gorcunov gorcu...@openvz.org -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] fs: don't remove inotify watchers from alive inode-s

2014-09-08 Thread Cyrill Gorcunov
es userspace will see but I think there were a bug before this patch, so Reviewed-by: Cyrill Gorcunov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-i

Re: [PATCH] fs: don't remove inotify watchers from alive inode-s

2014-09-08 Thread Cyrill Gorcunov
there were a bug before this patch, so Reviewed-by: Cyrill Gorcunov gorcu...@openvz.org -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: [PATCH] kcmp: Fix standard comparison bug

2014-09-05 Thread Cyrill Gorcunov
On Thu, Sep 04, 2014 at 12:40:06PM +0200, Rasmus Villemoes wrote: > The C operator <= defines a perfectly fine total ordering on the set > of values representable in a long. However, unlike its namesake in the > integers, it is not translation invariant, meaning that we do not have > "b <= c" iff

Re: [PATCH] kcmp: Fix standard comparison bug

2014-09-05 Thread Cyrill Gorcunov
On Thu, Sep 04, 2014 at 12:40:06PM +0200, Rasmus Villemoes wrote: The C operator = defines a perfectly fine total ordering on the set of values representable in a long. However, unlike its namesake in the integers, it is not translation invariant, meaning that we do not have b = c iff a+b =

Re: [PATCH] kcmp: Fix standard comparison bug

2014-09-04 Thread Cyrill Gorcunov
> > Cc: > Signed-off-by: Rasmus Villemoes It's more than that, I looked into disassembly code and found that compiler overoptimize obfuscation, instead of doing ^ and * sequently it substracts xor production of both operands first and only then multiplies the result. Lets stick

Re: [PATCH] kcmp: Fix standard comparison bug

2014-09-04 Thread Cyrill Gorcunov
and found that compiler overoptimize obfuscation, instead of doing ^ and * sequently it substracts xor production of both operands first and only then multiplies the result. Lets stick with the fix. Reviewed-by: Cyrill Gorcunov gorcu...@openvz.org I'll take more precise look at evening, thanks

Re: [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values

2014-09-02 Thread Cyrill Gorcunov
On Tue, Sep 02, 2014 at 12:14:08PM +0400, Cyrill Gorcunov wrote: > On Tue, Sep 02, 2014 at 12:00:14PM +0400, Andrey Vagin wrote: > > MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64 > > bytes, so exportfs_encode_inode_fh can return an error. > > &g

Re: [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed

2014-09-02 Thread Cyrill Gorcunov
On Tue, Sep 02, 2014 at 12:00:15PM +0400, Andrey Vagin wrote: > Currently we handle only ENOSPC. In case of other errors the file_handle > variable isn't filled properly and we will show a part of stack. > > Cc: Cyrill Gorcunov > Cc: Alexander Viro > Cc: Andrew Morton >

Re: [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values

2014-09-02 Thread Cyrill Gorcunov
On Tue, Sep 02, 2014 at 12:00:14PM +0400, Andrey Vagin wrote: > MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64 > bytes, so exportfs_encode_inode_fh can return an error. > > Cc: Cyrill Gorcunov > Cc: Alexander Viro > Cc: Andrew Morton > Signed

Re: [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values

2014-09-02 Thread Cyrill Gorcunov
On Tue, Sep 02, 2014 at 12:00:14PM +0400, Andrey Vagin wrote: MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64 bytes, so exportfs_encode_inode_fh can return an error. Cc: Cyrill Gorcunov gorcu...@openvz.org Cc: Alexander Viro v...@zeniv.linux.org.uk Cc: Andrew Morton

Re: [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed

2014-09-02 Thread Cyrill Gorcunov
On Tue, Sep 02, 2014 at 12:00:15PM +0400, Andrey Vagin wrote: Currently we handle only ENOSPC. In case of other errors the file_handle variable isn't filled properly and we will show a part of stack. Cc: Cyrill Gorcunov gorcu...@openvz.org Cc: Alexander Viro v...@zeniv.linux.org.uk Cc

Re: [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values

2014-09-02 Thread Cyrill Gorcunov
On Tue, Sep 02, 2014 at 12:14:08PM +0400, Cyrill Gorcunov wrote: On Tue, Sep 02, 2014 at 12:00:14PM +0400, Andrey Vagin wrote: MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64 bytes, so exportfs_encode_inode_fh can return an error. Cc: Cyrill Gorcunov gorcu

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-28 Thread Cyrill Gorcunov
On Wed, Aug 27, 2014 at 04:12:43PM -0700, Hugh Dickins wrote: > > > > > > Weak argument to me. > > Yes. However rarely it's modified, we don't want any chance of it > corrupting another flag. > > VM_SOFTDIRTY is special in the sense that it's maintained in a very > different way from the other

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-28 Thread Cyrill Gorcunov
On Wed, Aug 27, 2014 at 04:12:43PM -0700, Hugh Dickins wrote: Weak argument to me. Yes. However rarely it's modified, we don't want any chance of it corrupting another flag. VM_SOFTDIRTY is special in the sense that it's maintained in a very different way from the other VM_flags.

[PATCH -mm] prctl: Return -EFAULT on auxv fetching failure

2014-08-27 Thread Cyrill Gorcunov
Dan reported that returning bytes left if copy_from_user failed is a bad option, return traditional -EFAULT instead. Reported-by: Dan Carpenter Cc: Andrew Morton Signed-off-by: Cyrill Gorcunov --- Dan, this is not for current linux-next, but for Andrew's -mm queue, since he has prctl code

[PATCH -mm] prctl: Return -EFAULT on auxv fetching failure

2014-08-27 Thread Cyrill Gorcunov
Dan reported that returning bytes left if copy_from_user failed is a bad option, return traditional -EFAULT instead. Reported-by: Dan Carpenter dan.carpen...@oracle.com Cc: Andrew Morton a...@linux-foundation.org Signed-off-by: Cyrill Gorcunov gorcu...@gmail.com --- Dan, this is not for current

[PATCH -mm] headers: prctl.h -- Add missing linux/types.h

2014-08-26 Thread Cyrill Gorcunov
, | from Documentation/prctl/disable-tsc-test.c:14: | ./usr/include/linux/prctl.h:132:2: error: unknown type name '__u64' | Include the header needed. Signed-off-by: Cyrill Gorcunov Cc: Andrew Morton Cc: Stephen Rothwell --- include/uapi/linux/prctl.h |2 ++ 1 file changed, 2

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 06:43:55PM +0300, Kirill A. Shutemov wrote: > On Tue, Aug 26, 2014 at 07:18:13PM +0400, Cyrill Gorcunov wrote: > > > Basically, it's safe if only soft-dirty is allowed to modify vm_flags > > > without down_write(). But why is soft-dirty so special? &g

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 05:56:12PM +0300, Kirill A. Shutemov wrote: > > > > > > It seems safe in vma-softdirty context. But if somebody else will decide > > > that > > > it's fine to modify vm_flags without down_write (in their context), we > > > will get trouble. Sasha will come with weird bug

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 05:04:19PM +0300, Kirill A. Shutemov wrote: > > > > > > But now I'm realizing that if this is the _only_ place which modifies > > > vm_flags with down_read, then it's "probably" safe. I've a vague > > > feeling that this was discussed before - is that so, Cyrill? > > > >

Re: [PATCH -mm] prctl: PR_SET_MM -- Introduce PR_SET_MM_MAP operation, v4

2014-08-26 Thread Cyrill Gorcunov
On Mon, Aug 25, 2014 at 02:08:43PM +0400, Cyrill Gorcunov wrote: > During development of c/r we've noticed that in case if we need to > support user namespaces we face a problem with capabilities in > prctl(PR_SET_MM, ...) call, in particular once new user namespace > is cre

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Mon, Aug 25, 2014 at 09:45:34PM -0700, Hugh Dickins wrote: > > +static int clear_refs(struct mm_struct *mm, enum clear_refs_types type, > > + int write) > > +{ ... > > + > > + if (write) > > + down_write(>mmap_sem); > > + else > > +

Re: linux-next: build failure after merge of the akpm-current tree

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 04:35:02PM +1000, Stephen Rothwell wrote: > Hi Andrew, > > After merging the akpm-current tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > ./usr/include/linux/prctl.h:132: found __[us]{8,16,32,64} type without > #include > In file included

Re: linux-next: build failure after merge of the akpm-current tree

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 04:35:02PM +1000, Stephen Rothwell wrote: Hi Andrew, After merging the akpm-current tree, today's linux-next build (x86_64 allmodconfig) failed like this: ./usr/include/linux/prctl.h:132: found __[us]{8,16,32,64} type without #include linux/types.h In file

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Mon, Aug 25, 2014 at 09:45:34PM -0700, Hugh Dickins wrote: +static int clear_refs(struct mm_struct *mm, enum clear_refs_types type, + int write) +{ ... + + if (write) + down_write(mm-mmap_sem); + else + down_read(mm-mmap_sem); + +

Re: [PATCH -mm] prctl: PR_SET_MM -- Introduce PR_SET_MM_MAP operation, v4

2014-08-26 Thread Cyrill Gorcunov
On Mon, Aug 25, 2014 at 02:08:43PM +0400, Cyrill Gorcunov wrote: During development of c/r we've noticed that in case if we need to support user namespaces we face a problem with capabilities in prctl(PR_SET_MM, ...) call, in particular once new user namespace is created capable

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 05:04:19PM +0300, Kirill A. Shutemov wrote: But now I'm realizing that if this is the _only_ place which modifies vm_flags with down_read, then it's probably safe. I've a vague feeling that this was discussed before - is that so, Cyrill? Well, as far as I

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 05:56:12PM +0300, Kirill A. Shutemov wrote: It seems safe in vma-softdirty context. But if somebody else will decide that it's fine to modify vm_flags without down_write (in their context), we will get trouble. Sasha will come with weird bug report one day

Re: [PATCH v5] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-26 Thread Cyrill Gorcunov
On Tue, Aug 26, 2014 at 06:43:55PM +0300, Kirill A. Shutemov wrote: On Tue, Aug 26, 2014 at 07:18:13PM +0400, Cyrill Gorcunov wrote: Basically, it's safe if only soft-dirty is allowed to modify vm_flags without down_write(). But why is soft-dirty so special? because how we use this bit

[PATCH -mm] headers: prctl.h -- Add missing linux/types.h

2014-08-26 Thread Cyrill Gorcunov
:0, | from Documentation/prctl/disable-tsc-test.c:14: | ./usr/include/linux/prctl.h:132:2: error: unknown type name '__u64' | Include the header needed. Signed-off-by: Cyrill Gorcunov gorcu...@openvz.org Cc: Andrew Morton a...@linux-foundation.org Cc: Stephen Rothwell s

Re: [PATCH v2] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-25 Thread Cyrill Gorcunov
On Mon, Aug 25, 2014 at 09:12:07PM +0200, Oleg Nesterov wrote: > + vma = find_vma(current->mm, addr); > + if (vma) { > + unsigned long end = addr + size; > + > + if (vma->vm_flags & VM_GROWSDOWN) > + end +=

[PATCH -mm] prctl: PR_SET_MM -- Introduce PR_SET_MM_MAP operation, v4

2014-08-25 Thread Cyrill Gorcunov
bers validation lockless, it's unneeded and confusing especially because of next bullet - don't use VMA lookup, a program may map new vma and unmap old own ones generated by the kernel during executable startup - use write-lock for mm::exe_link update so that get_mm_exe_file won't race

[PATCH -mm] prctl: PR_SET_MM -- Introduce PR_SET_MM_MAP operation, v4

2014-08-25 Thread Cyrill Gorcunov
and confusing especially because of next bullet - don't use VMA lookup, a program may map new vma and unmap old own ones generated by the kernel during executable startup - use write-lock for mm::exe_link update so that get_mm_exe_file won't race with us Signed-off-by: Cyrill Gorcunov

Re: [PATCH v2] ipc/shm: fix the historical/wrong mm-start_stack check

2014-08-25 Thread Cyrill Gorcunov
On Mon, Aug 25, 2014 at 09:12:07PM +0200, Oleg Nesterov wrote: + vma = find_vma(current-mm, addr); + if (vma) { + unsigned long end = addr + size; + + if (vma-vm_flags VM_GROWSDOWN) + end +=

Re: [PATCH v3] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-24 Thread Cyrill Gorcunov
since > VM_SOFTDIRTY is 0 in this case: > > if (IS_ENABLED(CONFIG_MEM_SOFT_DIRTY) && !(vm_flags & VM_SOFTDIRTY)) > > Otherwise looks good to me. > > Suggested-by: Kirill A. Shutemov > Reviewed-by: Kirill A. Shutemov Really sorry for delay. Th

Re: [PATCH v3] mm: softdirty: enable write notifications on VMAs after VM_SOFTDIRTY cleared

2014-08-24 Thread Cyrill Gorcunov
)) Otherwise looks good to me. Suggested-by: Kirill A. Shutemov kirill.shute...@linux.intel.com Reviewed-by: Kirill A. Shutemov kirill.shute...@linux.intel.com Really sorry for delay. Thanks a huge, guys! Reviewed-by: Cyrill Gorcunov gorcu...@openvz.org -- To unsubscribe from this list: send

Re: + prctl-pr_set_mm-introduce-pr_set_mm_map-operation-v3.patch added to -mm tree

2014-08-23 Thread Cyrill Gorcunov
On Sat, Aug 23, 2014 at 09:29:15PM +0200, Oleg Nesterov wrote: > On 08/23, Cyrill Gorcunov wrote: > > > > On Sat, Aug 23, 2014 at 05:32:22PM +0200, Oleg Nesterov wrote: > > > > > > And btw, where do you see RLIMIT_STACK in do_shmat() ? > > > > Indi

Re: + prctl-pr_set_mm-introduce-pr_set_mm_map-operation-v3.patch added to -mm tree

2014-08-23 Thread Cyrill Gorcunov
On Sat, Aug 23, 2014 at 05:32:22PM +0200, Oleg Nesterov wrote: > > > > > > Besides, it can't help anyway. cred_guard_mutex is per-process (not > > > per-thread), > > > suppose that a vfork()'ed child does prctl() while another thread reads > > > the > > > parent's /proc/pid/auxv. > > > > Then

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-23 Thread Cyrill Gorcunov
d not > dare to do this. So the patch only fixes the 1st problem (mostly to > avoid the usage of mm->start_stack) and ignores VM_GROWSUP. > > Signed-off-by: Oleg Nesterov Reviewed-by: Cyrill Gorcunov I don't understand this check either, the comment above it says nothi

<    3   4   5   6   7   8   9   10   11   12   >