Hey Daniel,

You may have already picked this up out of that other longer thread on
-users but I decided to be safe and repost it here as an attachment.
This is the patch applied to both Serge's patch and your subsequent
patch to fix the lxc-info breakage by spotting and avoiding a NULL
pointer deref in cgroups.c around line 326.

Serge already acked it in that other thread but he may wish to ack this
one here as well.

Currently running the complete set of 3 patches in 3 environments.

On Sat, 2011-06-25 at 21:44 +0200, Daniel Lezcano wrote: 
> Hi Serge,

> your patch was doing a nested call to the setmntent which is not reentrant.

> Fixed with the patch in attachment. Some other nits fixed too.

> -- Daniel

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  m...@wittsend.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
diff -urN lxc-0.7.4.2git2/src/lxc/cgroup.c lxc-0.7.4.2git3/src/lxc/cgroup.c
--- lxc-0.7.4.2git2/src/lxc/cgroup.c	2011-06-26 14:05:43.212612575 -0400
+++ lxc-0.7.4.2git3/src/lxc/cgroup.c	2011-06-26 14:06:54.815612754 -0400
@@ -323,7 +323,9 @@
        if (subsystem) {
                snprintf(retbuf, MAXPATHLEN, "%s", subsystem);
                char *s = index(retbuf, '.');
-               *s = '\0';
+               if (s) {
+                      *s = '\0';
+               }
                DEBUG("%s: called for subsys %s name %s\n", __func__, retbuf, name);
 	}
        if (get_cgroup_mount(MTAB, subsystem ? retbuf : NULL, buf)) {

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to