[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKYAXd9pMJik+1BRywYm-5-9bx9uHni6mucP6DvQufKuWM17pQ@mail.gmail.com>
Date: Thu, 2 Oct 2025 08:08:32 +0900
From: Namjae Jeon <linkinjeon@...nel.org>
To: Ethan Ferguson <ethan.ferguson@...ier.com>
Cc: "Yuezhang.Mo@...y.com" <Yuezhang.Mo@...y.com>,
"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>,
"sj1557.seo@...sung.com" <sj1557.seo@...sung.com>
Subject: Re: [PATCH v7 1/1] exfat: Add support for FS_IOC_{GET,SET}FSLABEL
On Thu, Oct 2, 2025 at 1:34 AM Ethan Ferguson <ethan.ferguson@...ier.com> wrote:
>
> Hi,
>
> On 9/28/25 06:28, Yuezhang.Mo@...y.com wrote:
> > 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
> Apologies that I missed that, I would be more than happy to submit a fixed patch for this,
> but I checked the dev branch of the exfat tree and noticed some lines were added to fix this
> problem in my commit. If true, this is fine by me, and I will sign off on it, but I just
> want to make sure that's true, because if so then I don't think another patch by me is needed.
I have directly updated it. So you don't need to submit the updated
patch to the list.
Thanks.
>
> Thank you!
Powered by blists - more mailing lists