[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PUZPR04MB6316E73EE47154A64F8733DA8118A@PUZPR04MB6316.apcprd04.prod.outlook.com>
Date: Sun, 28 Sep 2025 10:28:49 +0000
From: "Yuezhang.Mo@...y.com" <Yuezhang.Mo@...y.com>
To: Ethan Ferguson <ethan.ferguson@...ier.com>
CC: "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"cpgs@...sung.com" <cpgs@...sung.com>,
"linkinjeon@...nel.org"
<linkinjeon@...nel.org>,
"sj1557.seo@...sung.com" <sj1557.seo@...sung.com>
Subject: Re: [PATCH v7 1/1] exfat: Add support for FS_IOC_{GET,SET}FSLABEL
On Fri, Sep 12, 2025 11:26 Ethan Ferguson <ethan.ferguson@...ier.com> wrote:
> +int exfat_read_volume_label(struct super_block *sb, struct exfat_uni_name *label_out)
> +{
> + int ret, i;
> + struct exfat_sb_info *sbi = EXFAT_SB(sb);
> + struct exfat_entry_set_cache es;
> + struct exfat_dentry *ep;
> +
> + mutex_lock(&sbi->s_lock);
> +
> + memset(label_out, 0, sizeof(*label_out));
> + ret = exfat_get_volume_label_dentry(sb, &es);
> + if (ret < 0) {
> + /*
> + * ENOENT signifies that a volume label dentry doesn't exist
> + * We will treat this as an empty volume label and not fail.
> + */
> + if (ret == -ENOENT)
> + ret = 0;
> +
> + goto unlock;
> + }
> +
> + ep = exfat_get_dentry_cached(&es, 0);
> + label_out->name_len = ep->dentry.volume_label.char_count;
> + if (label_out->name_len > EXFAT_VOLUME_LABEL_LEN) {
> + ret = -EIO;
> + goto unlock;
> + }
> +
> + for (i = 0; i < label_out->name_len; i++)
> + label_out->name[i] = le16_to_cpu(ep->dentry.volume_label.volume_label[i]);
> +
> +unlock:
> + mutex_unlock(&sbi->s_lock);
> + return ret;
> +}
Hi Ethan Ferguson,
This function has a buffer leak due to a missed call to
exfat_put_dentry_set(). Please fix it.
Thanks
Powered by blists - more mailing lists