Commit 84562378 authored by Jeff Layton's avatar Jeff Layton Committed by Zhang Changzhong
Browse files

overlayfs: set ctime when setting mtime and atime

stable inclusion
from stable-v4.19.297
commit 55fabed6352309cb71e0c76814f1f7023250ebf0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8MCB5
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=55fabed6352309cb71e0c76814f1f7023250ebf0



--------------------------------

[ Upstream commit 03dbab3b ]

Nathan reported that he was seeing the new warning in
setattr_copy_mgtime pop when starting podman containers. Overlayfs is
trying to set the atime and mtime via notify_change without also
setting the ctime.

POSIX states that when the atime and mtime are updated via utimes() that
we must also update the ctime to the current time. The situation with
overlayfs copy-up is analogies, so add ATTR_CTIME to the bitmask.
notify_change will fill in the value.

Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
Acked-by: default avatarChristian Brauner <brauner@kernel.org>
Acked-by: default avatarAmir Goldstein <amir73il@gmail.com>
Message-Id: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parent 7ad175cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment