From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757278AbbIUT2z (ORCPT ); Mon, 21 Sep 2015 15:28:55 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:36823 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756553AbbIUT2x (ORCPT ); Mon, 21 Sep 2015 15:28:53 -0400 Date: Mon, 21 Sep 2015 22:28:49 +0300 From: Cyrill Gorcunov To: Dave Hansen Cc: dave.hansen@linux.intel.com, avagin@gmail.com, akpm@linux-foundation.org, xemul@parallels.com, eparis@redhat.com, john@johnmccutchan.com, rlove@rlove.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] inotify: hide internal kernel bits from fdinfo Message-ID: <20150921192849.GC3181@uranus> References: <20150921184501.E0313E5A@viggo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150921184501.E0313E5A@viggo.jf.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2015 at 11:45:01AM -0700, Dave Hansen wrote: > > From: Dave Hansen > > There was a report that my patch: > > inotify: actually check for invalid bits in sys_inotify_add_watch() > > broke CRIU. > > The reason is that CRIU looks up raw flags in /proc/$pid/fdinfo/* > to figure out how to rebuild inotify watches and then passes those > flags directly back in to the inotify API. One of those flags > (FS_EVENT_ON_CHILD) is set in mark->mask, but is not part of the > inotify API. It is used inside the kernel to _implement_ inotify > but it is not and has never been part of the API. > > My patch above ensured that we only allow bits which are part of > the API (IN_ALL_EVENTS). This broke CRIU. > > FS_EVENT_ON_CHILD is really internal to the kernel. It is set > _anyway_ on all inotify marks. So, CRIU was really just trying > to set a bit that was already set. > > This patch hides that bit from fdinfo. CRIU will not see the > bit, not try to set it, and should work as before. We should not > have been exposing this bit in the first place, so this is a good > patch independent of the CRIU problem. > > Signed-off-by: Dave Hansen > Reported-by: Andrey Wagin Acked-by: Cyrill Gorcunov Thank you!