Skip to content

Commit a4eb935

Browse files
committed
Merge tag 'fs_for_v6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull udf and quota updates from Jan Kara: "A fix for UDF and quota" * tag 'fs_for_v6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fs: udf: fix OOB read in lengthAllocDescs handling fs: quota: create dedicated workqueue for quota_release_work
2 parents 67f5f11 + 3bd5e45 commit a4eb935

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

fs/quota/dquot.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES;
162162
/* SLAB cache for dquot structures */
163163
static struct kmem_cache *dquot_cachep;
164164

165+
/* workqueue for work quota_release_work*/
166+
static struct workqueue_struct *quota_unbound_wq;
167+
165168
void register_quota_format(struct quota_format_type *fmt)
166169
{
167170
spin_lock(&dq_list_lock);
@@ -881,7 +884,7 @@ void dqput(struct dquot *dquot)
881884
put_releasing_dquots(dquot);
882885
atomic_dec(&dquot->dq_count);
883886
spin_unlock(&dq_list_lock);
884-
queue_delayed_work(system_dfl_wq, &quota_release_work, 1);
887+
queue_delayed_work(quota_unbound_wq, &quota_release_work, 1);
885888
}
886889
EXPORT_SYMBOL(dqput);
887890

@@ -3041,6 +3044,11 @@ static int __init dquot_init(void)
30413044

30423045
shrinker_register(dqcache_shrinker);
30433046

3047+
quota_unbound_wq = alloc_workqueue("quota_events_unbound",
3048+
WQ_UNBOUND | WQ_MEM_RECLAIM, WQ_MAX_ACTIVE);
3049+
if (!quota_unbound_wq)
3050+
panic("Cannot create quota_unbound_wq\n");
3051+
30443052
return 0;
30453053
}
30463054
fs_initcall(dquot_init);

fs/udf/inode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,9 @@ int udf_current_aext(struct inode *inode, struct extent_position *epos,
22722272
if (check_add_overflow(sizeof(struct allocExtDesc),
22732273
le32_to_cpu(header->lengthAllocDescs), &alen))
22742274
return -1;
2275+
2276+
if (alen > epos->bh->b_size)
2277+
return -1;
22752278
}
22762279

22772280
switch (iinfo->i_alloc_type) {

0 commit comments

Comments
 (0)