浏览代码

apparmor: check that xindex is in trans_table bounds

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
John Johansen 9 年之前
父节点
当前提交
23ca7b640b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      security/apparmor/policy_unpack.c

+ 1 - 1
security/apparmor/policy_unpack.c

@@ -676,7 +676,7 @@ static bool verify_xindex(int xindex, int table_size)
 	int index, xtype;
 	int index, xtype;
 	xtype = xindex & AA_X_TYPE_MASK;
 	xtype = xindex & AA_X_TYPE_MASK;
 	index = xindex & AA_X_INDEX_MASK;
 	index = xindex & AA_X_INDEX_MASK;
-	if (xtype == AA_X_TABLE && index > table_size)
+	if (xtype == AA_X_TABLE && index >= table_size)
 		return 0;
 		return 0;
 	return 1;
 	return 1;
 }
 }