Re: [PATCH v7.3 8/9] cifs: Add support for parsing WSL symlinks in version 1 format
From: Pali Rohár
Date: Wed Oct 28 2026 - 19:45:38 EST
On Tuesday 27 October 2026 10:37:45 Namjae Jeon wrote:
...
> > + oparms = CIFS_OPARMS(cifs_sb, tcon, full_path, FILE_READ_DATA,
> > + FILE_OPEN, CREATE_NOT_DIR | OPEN_REPARSE_POINT,
> > + ACL_NO_MODE);
> > + oparms.fid = &fid;
> Should we pass initialized fid to ->open()? When SMB2/3 leasing is
> enabled, the open path copies fid->lease_key into the outgoing CREATE
> request, potentially disclosing 16 bytes of stale stack data to the
> server ?
I think that I have copied this pattern from somewhere. So maybe the
same issue is in other parts of the code.
> So, how about updating it like this ?
>
> struct cifs_fid fid = {};
> ...
> if (tcon->ses->server->ops->new_lease_key)
> tcon->ses->server->ops->new_lease_key(&fid);
I will look at it.
Anyway this series contains various changes and these last two PATCH8
and PATCH9 are not needed for rest of them. So if there is no issue with
PATCH1-7 I would like if we can process at least first 7 without need to
address issues in 8 and 9. I'm waiting for these changes for a longer
time and mostly I'm just resending 1-7 without any modification, just
rebasing them.
>
>
> > + oplock = tcon->ses->server->oplocks ? REQ_OPLOCK : 0;
> > + rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, NULL);
> > + if (rc)
> > + goto out;
> > +
> > + buf_type = CIFS_NO_BUFFER;
> > + io_parms = (struct cifs_io_parms) {
> > + .pid = current->tgid,
> > + .tcon = tcon,
> > + .offset = 0,
> > + .length = symname_utf8_len,
> > + };
> > + rc = tcon->ses->server->ops->sync_read(xid, &fid, &io_parms,
> > + &symname_utf8_len,
> > + &symname_utf8,
> > + &buf_type);
> > + if (!rc && symname_utf8_len != file_size)
> > + rc = -EIO;
...