From: Greg KH <greg@kroah.com>
To: "Xu, Lizhi" <Lizhi.Xu@windriver.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Arnd Bergmann <arnd@arndb.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: 回复: 回复: 回复: linux-next: build failure after merge of the char-misc tree
Date: Thu, 3 Jul 2025 13:20:47 +0200 [thread overview]
Message-ID: <2025070323-unpicked-virtuous-07fa@gregkh> (raw)
In-Reply-To: <BL1PR11MB5979690F05AA49123A47C37E8643A@BL1PR11MB5979.namprd11.prod.outlook.com>
On Thu, Jul 03, 2025 at 11:09:10AM +0000, Xu, Lizhi wrote:
> Please read the context carefully, and you will understand that this is
> where everything starts.
I'm sorry, but I do not understand your quoting style. Didn't the links
I provided earlier explain this?
> In the code before memset, the ev variable only
> initializes the members of its member hdr.
What code does that?
> Originally, "struct vmci_event_ctx ev = {0};" could be used to solve this
> problem. After careful analysis, I can clearly see that the data after the
> ev member hdr is not fully initialized, so memset() is used to set the
> uninitialized data after the hdr member in ev to 0.
Again, you have a structure that has 2 structures in it, but no
guarantees that there will not be any padding between those structures:
struct vmci_event_ctx {
struct vmci_event_msg msg;
struct vmci_event_payld_ctx payload;
};
Nor do you have any guarantee that those structures don't also have
holes in them. How does any of this work? Is it just luck? I walked
things backwards and find it impossible to guess as to any of the fields
here actually being properly aligned or even using the correct data
types to cross the user/kernel boundary.
And then you throw the whole thing on the stack:
> 248 struct vmci_event_ctx ev;
And attempt to initialize the fields manually. What could go wrong?
(hint, syzbot showed what went wrong, and the compiler is now telling
you how your proposed fix is not correct in the long-run...)
Please fix this properly.
greg k-h
next prev parent reply other threads:[~2025-07-03 11:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 7:10 linux-next: build failure after merge of the char-misc tree Stephen Rothwell
2025-07-03 8:30 ` Greg KH
2025-07-03 8:55 ` 回复: " Xu, Lizhi
2025-07-03 9:28 ` Greg KH
2025-07-03 9:44 ` 回复: " Xu, Lizhi
2025-07-03 10:03 ` Greg KH
2025-07-03 11:09 ` 回复: " Xu, Lizhi
2025-07-03 11:20 ` Greg KH [this message]
2025-07-04 1:32 ` Lizhi Xu
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=2025070323-unpicked-virtuous-07fa@gregkh \
--to=greg@kroah.com \
--cc=Lizhi.Xu@windriver.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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 NNTP newsgroup(s).