Messages in this thread | | | Date | Wed, 27 Oct 2004 08:21:34 -0700 | From | Greg KH <> | Subject | Re: [Patch] 2.6.10.rc1.bk6 /lib/kobject_uevent.c buffer issues |
| |
On Wed, Oct 27, 2004 at 10:29:25AM -0400, Andrew Duggan wrote: > Hi, > > In the lastest code I've seen 2.6.10 rc1 bk6 for lib/kobject_uevent.c > the incrementing of the sequence number is held off until the call to > hotplug_ops->hotplug (). That function can consume addtional buffer > and use addtional pointers in the envp array. The problem is that the > new value for i and the new logical end of buffer (held in scratch) do > not get updated. When the sequnce number is then processed the first > item generated by hotplug_ops->hotplug () gets overwriten, and can > potentially corrupt any env vars created by hotplug_ops->hotplug.
Ah, good catch. Sorry about adding that bug.
> Here is a patch to handle that. An element in envp is reserved for > the seq num and a different buffer is sent to hotplug_ops->hotplug > altogether. Using a different buffer there is OK since send_uevent > wasn't seeing the part of the buffer filled in by hotplug_ops->hotplug > anyway, and the older call_usermodehelper gets passed envp and not > buffer.
Why not just use the same buffer? We should be able to do that.
> I used the same size for the buffer_pt2 as buffer for simplicity, > since I didn't know if saving the memory was THAT important. If need > be the kmalloc for buffer_pt2 could be held off until just before the > call to hotplug_ops->hotplug so that it could be allocated only > (BUFFERSIZE - (scratch - buffer)).
I'd prefer we use the same buffer. Care to respin your patch?
thanks,
greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |