From: Lai Siyao Date: Fri, 14 Dec 2012 02:25:08 +0000 (+0800) Subject: LU-2463 security: osd_mknod shouldn't alter mode after creation X-Git-Tag: 2.3.58~15 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=018988a3b7241407a5c6d6829fac62ae9f2c486f LU-2463 security: osd_mknod shouldn't alter mode after creation ldiskfs osd_mknod() calls init_special_inode() after creation, which will update inode->i_mode, don't use the mode from client because mode is decided at creation time. Test-Parameters: envdefinitions=SLOW=yes testlist=posix Signed-off-by: Lai Siyao Change-Id: Id11c00bf57903e210fc96d33437dd3ece6f2e171 Reviewed-on: http://review.whamcloud.com/4829 Reviewed-by: Bobi Jam Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 59d093f..c0e5a91 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -1784,7 +1784,8 @@ static int osd_mknod(struct osd_thread_info *info, struct osd_object *obj, * This inode should be marked dirty for i_rdev. Currently * that is done in the osd_attr_init(). */ - 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;