From: Steve French <smfrench@gmail.com>
To: Stefan Metzmacher <metze@samba.org>
Cc: Namjae Jeon <linkinjeon@kernel.org>,
Asim Viladi Oglu Manizada <manizada@pm.me>,
kernel test robot <lkp@intel.com>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Steve French <stfrench@microsoft.com>,
"linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>
Subject: Re: [samba-ksmbd:ksmbd-for-next-next 11/12] fs/smb/server/smb2pdu.c:5723:3: warning: variable 'pntsd' is uninitialized when used here
Date: Mon, 23 Mar 2026 10:38:40 -0500 [thread overview]
Message-ID: <CAH2r5msADO+SbgJxwX0vNU0keHb5WScqOmrb+uszmG2uZt9Qrw@mail.gmail.com> (raw)
In-Reply-To: <69c54f80-dff1-4c02-af97-08799fe59b94@samba.org>
I agree - looks like a bug. Should be setting the declaration to null
struct smb_ntsd *pntsd = NULL;
since the initialization of ptsd is in an if clause, you could end up
doing kfree of uninitialized pntsd pointer on line 5801
On Mon, Mar 23, 2026 at 9:52 AM Stefan Metzmacher <metze@samba.org> wrote:
>
> Am 23.03.26 um 15:43 schrieb Namjae Jeon:
> > On Mon, Mar 23, 2026 at 10:22 PM Steve French <smfrench@gmail.com> wrote:
> >>
> >> looks like a simple fix to initialize it to null at declaration, right?
> > It seems this test was performed on an outdated version. The current
> > ksmbd-for-next already includes the updated one, so we don't need to
> > check it.
>
> For it still happens with the current state:
>
> 1ce4e48216b84385319da308f2262eb11ee7e459
> (smfrench-smb3-kernel/ksmbd-for-next) smb: smbdirect: fix inverted comparison operator in negotiation log message
>
> And there it's likely:
>
> 6a0795e46296589d8eba6c194586e9e65974d73f
> ksmbd: fix OOB write in QUERY_INFO for compound requests
>
> With setting it to NULL the smatch warning goes away.
>
> metze
--
Thanks,
Steve
prev parent reply other threads:[~2026-03-23 15:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202603180118.ClDWNtId-lkp@intel.com>
2026-03-23 8:56 ` [samba-ksmbd:ksmbd-for-next-next 11/12] fs/smb/server/smb2pdu.c:5723:3: warning: variable 'pntsd' is uninitialized when used here Stefan Metzmacher
2026-03-23 13:21 ` Steve French
2026-03-23 14:43 ` Namjae Jeon
2026-03-23 14:52 ` Stefan Metzmacher
2026-03-23 15:38 ` Steve French [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAH2r5msADO+SbgJxwX0vNU0keHb5WScqOmrb+uszmG2uZt9Qrw@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=manizada@pm.me \
--cc=metze@samba.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=stfrench@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).