|
@@ -18,6 +18,7 @@
|
|
|
#include <linux/quotaops.h>
|
|
|
#include <linux/types.h>
|
|
|
#include <linux/writeback.h>
|
|
|
+#include <linux/nospec.h>
|
|
|
|
|
|
static int check_quotactl_permission(struct super_block *sb, int type, int cmd,
|
|
|
qid_t id)
|
|
@@ -701,6 +702,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
|
|
|
|
|
|
if (type >= MAXQUOTAS)
|
|
|
return -EINVAL;
|
|
|
+ type = array_index_nospec(type, MAXQUOTAS);
|
|
|
/*
|
|
|
* Quota not supported on this fs? Check this before s_quota_types
|
|
|
* since they needn't be set if quota is not supported at all.
|