From: Lai Siyao Date: Thu, 13 Dec 2012 06:38:03 +0000 (+0800) Subject: LU-2463 security: osd_mknod shouldn't alter mode after creation X-Git-Tag: 2.1.4-RC1~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6127a5acd943cddee33695056e3ff0908d975e51;p=fs%2Flustre-release.git LU-2463 security: osd_mknod shouldn't alter mode after creation osd_mknod() calls init_special_inode(), but it should use inode->i_mode instead of the one from client. Test-Parameters: envdefinitions=SLOW=yes testlist=posix Signed-off-by: Lai Siyao Change-Id: Iee0f49dc4beef4aae6b5b6f57679de2643887e25 Reviewed-on: http://review.whamcloud.com/4820 Tested-by: Hudson Reviewed-by: Jian Yu Tested-by: Jian Yu Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 4d1725e..542f4f3 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -1645,7 +1645,8 @@ static int osd_mknod(struct osd_thread_info *info, struct osd_object *obj, result = osd_mkfile(info, obj, mode, hint, th); if (result == 0) { LASSERT(obj->oo_inode != NULL); - init_special_inode(obj->oo_inode, mode, attr->la_rdev); + init_special_inode(obj->oo_inode, obj->oo_inode->i_mode, + attr->la_rdev); } LINVRNT(osd_invariant(obj)); return result;