Make sure that mtx_init does not assume clean memory.. If D2725,
this will no longer be the case, and the init will fail...
I have tested that this change compiles and boots w/o issues...
even a tail -f works w/o issue..
Differential D2890 Authored by jmg on Jun 23 2015, 7:02 AM.
Tags None Referenced Files
Details
Summary Make sure that mtx_init does not assume clean memory.. If D2725, I have tested that this change compiles and boots w/o issues...
Diff Detail
Event Timelinejmg updated this object. Herald added a subscriber: imp. · View Herald TranscriptJun 23 2015, 7:02 AM2015-06-23 07:02:34 (UTC+0) This revision is now accepted and ready to land.Jun 23 2015, 7:14 AM2015-06-23 07:14:07 (UTC+0) Comment Actions tomorrow..
Comment Actions This particular piece of code actually expects a zeroed struct. In particular, you can see that neither mtx_init nor knlist_init initialize the whole struct, leaving e.g.vpi_events and vpi_revents indeterminate. Then vn_pollrecord immediately examines vpi_revents of a newly added object and we are in trouble. In other words, while it was mtx_init which complained about junk-filled memory, the issue is bigger. initialisation here needs to either be done with M_ZERO or extended to cover missed fields. Uninitialised parts also include something from struct knlist, so it's more than zeroing 2 shorts, but I'm too lazy to check how to do deal with that knlist. This revision now requires changes to proceed.Jun 23 2015, 1:30 PM2015-06-23 13:30:30 (UTC+0) Comment Actions
umm... knlist_init fully initializes the whole struct, where do you get this info?
Agreed, testing patch w/ M_ZERO now. I assume you mean selinfo isn't fully initialized? I verified that knlist_init fully initializes it's part... The problem is that selinfo doesn't have an initializer, and really, we should create an API that combines selinfo and knlist together, but that's another review/time. jmg edited edge metadata. Comment Actionsswitch to zero'ing all of memory, as selinfo and other fields aren't mjg edited edge metadata. Comment Actions
yeah, that's what I meant. And yeah, I'm too lazy to come up with a solution and then do a sweep over the tree. M_ZERO looks fine as a temporary (right) solution. This revision is now accepted and ready to land.Jun 23 2015, 6:36 PM2015-06-23 18:36:36 (UTC+0) Closed by commit rS284733: zero this struct as it depends upon it... (authored by jmg). · Explain WhyJun 23 2015, 6:40 PM2015-06-23 18:40:28 (UTC+0) This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 6404 head/sys/kern/vfs_subr.c
|
this change looks like it is inadvertent