Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: lustre: fix quotactl permission denied (LU-4530)

The changes introduced in commit 4b1a25f06b30b203 ("fix build when
CONFIG_UIDGID_STRICT_TYPE_CHECKS is on") got the UID check the wrong way
around, leading to "Permission denied" when a regular user attempts to
retrieve his quota (lfs quota -u ...) but allowing him to retrieve other
users quota.

Full details at: https://jira.hpdd.intel.com/browse/LU-4530

Cc: Peng Tao <tao.peng@emc.com>
Cc: <stable@vger.kernel.org> # 3.12.x
Cc: <stable@vger.kernel.org> # 3.13.x
Signed-off-by: Cédric Dufour <cedric.dufour@idiap.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+1 -1
+1 -1
drivers/staging/lustre/lustre/llite/dir.c
··· 1086 1086 break; 1087 1087 case Q_GETQUOTA: 1088 1088 if (((type == USRQUOTA && 1089 - uid_eq(current_euid(), make_kuid(&init_user_ns, id))) || 1089 + !uid_eq(current_euid(), make_kuid(&init_user_ns, id))) || 1090 1090 (type == GRPQUOTA && 1091 1091 !in_egroup_p(make_kgid(&init_user_ns, id)))) && 1092 1092 (!cfs_capable(CFS_CAP_SYS_ADMIN) ||