From patchwork Fri Mar 11 21:23:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 596512 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id AD4301402D9; Sat, 12 Mar 2016 08:23:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b=hL/5PBa1; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1aeUWq-0002UQ-Oz; Fri, 11 Mar 2016 21:23:24 +0000 Received: from mail-io0-f171.google.com ([209.85.223.171]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.76) (envelope-from ) id 1aeUWl-0002UK-Uj for kernel-team@lists.ubuntu.com; Fri, 11 Mar 2016 21:23:20 +0000 Received: by mail-io0-f171.google.com with SMTP id m184so161445451iof.1 for ; Fri, 11 Mar 2016 13:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=jP7mjkGIoEScNIljeNDKsb/SgV5aCeqv3yJTj6qvKWI=; b=hL/5PBa1EXX7vWP7E7mTsRfex+CUYOKd7CZ3jRklA+a4X+T6xHd2YeknT+IYjijvRS GCw3OoYhlFoUsE2fHANcNAyzCFFnx9Co0e4ofIEaeEvemOyzW28w+bmFY70onTVBFRb3 Kkzc9G4xHX9CY9bfqStBYG2RODB+Bd/0gkkm9QvOpmVLQwn7BaKDHXQ6cgLH8r6BK3WV 39umeGBgKW0qaFjZs5a6XbkKoGgQme5tsU3MdiKn0pexNg1YhscgCcMTyRXOgH4YFnwS 8jJUssIsHUHs7ydoNnNCeWDMg9Z/EH3feY96JwS6NPEGixIJ8Hf/vKoPSf8IFQ2PApg1 L6FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=jP7mjkGIoEScNIljeNDKsb/SgV5aCeqv3yJTj6qvKWI=; b=cvJxQcOl40TfjYABBNIZ9Wf7MP0SI+z5ckrPZSlk9UjNG7fjMAixaNbYNMSObVe092 IywzUxVmmYWijGD5E/YnUQahUiWhXw5iQfz8cgTFqzXB8lF4mUlkpHaPF/Gl2dBdlPo0 WGOy28Ic1GQ8PfM1BUhYTod/D2Y82zQ4FTmuekOexoaPHsDL8kzlkiGiLArt2SlFCO5f N/bJ7RtLl0lfM7hMH4gvI4mgcPvetQ+1lSbUpa+hOpRKAOQ1HLXQs8NEoJew63Htj1VX tO2UKfeB3HxECF3BKYa2Mo0YkHjYvO4KABm+VSFnEuBPtqQr0kMmxCC+9TPGKH+YJBy+ APxg== X-Gm-Message-State: AD7BkJIaDqk/aVSo/i/42k3rCzQ8jyBoad+BLxnsVHvSNNW4x8SzBjnQLpn1U60QZdSD5kt2 X-Received: by 10.107.129.84 with SMTP id c81mr13539743iod.102.1457731398782; Fri, 11 Mar 2016 13:23:18 -0800 (PST) Received: from localhost ([2605:a601:aaa:d620:c444:c0e0:987f:46eb]) by smtp.gmail.com with ESMTPSA id b142sm4223196ioe.27.2016.03.11.13.23.17 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 11 Mar 2016 13:23:18 -0800 (PST) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH][wily/xenial] ovl: copy new uid/gid into overlayfs runtime inode Date: Fri, 11 Mar 2016 15:23:14 -0600 Message-Id: <1457731394-67110-1-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Konstantin Khlebnikov Overlayfs must update uid/gid after chown, otherwise functions like inode_owner_or_capable() will check user against stale uid. Catched by xfstests generic/087, it chowns file and calls utimes. Signed-off-by: Konstantin Khlebnikov Signed-off-by: Miklos Szeredi Cc: (backported from commit b81de061fa59f17d2730aabb1b84419ef3913810) BugLink: http://bugs.launchpad.net/bugs/1555997 Signed-off-by: Seth Forshee --- fs/overlayfs/inode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index b29036a..05ac9a9 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -65,6 +65,8 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr) mutex_lock(&upperdentry->d_inode->i_mutex); err = notify_change(upperdentry, attr, NULL); + if (!err) + ovl_copyattr(upperdentry->d_inode, dentry->d_inode); mutex_unlock(&upperdentry->d_inode->i_mutex); } ovl_drop_write(dentry);