RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1057676 - Cgroup templates not getting applied because of bad struct copy
Summary: Cgroup templates not getting applied because of bad struct copy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libcgroup
Version: 6.6
Hardware: All
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jan Chaloupka
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-24 15:26 UTC by Josko Plazonic
Modified: 2014-10-14 06:44 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 06:44:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1480 0 normal SHIPPED_LIVE libcgroup bug fix and enhancement update 2014-10-14 01:10:34 UTC

Description Josko Plazonic 2014-01-24 15:26:25 UTC
Description of problem:
With the latest libcgroup-0.40.rc1-5.el6_5.1 in our testing we had template limits (like template users/%u in cgconfig.conf) not getting applied to users.  We tracked it down to:
cgroup_copy_cgroup(&config_template_table[i], &template_table[i]);
line 1533 of src/config.c - which has the wrong order (should be DEST,SRC) so the just parsed config_template_table is getting overwritten with an empty one.  Also template name and other params are not getting copied. Indeed 0.41 version of libcgroup has that fixed.

Version-Release number of selected component (if applicable):
libcgroup-0.40.rc1-5.el6_5.1

How reproducible:
every time

Steps to Reproduce:
1. add to /etc/cgconfig.conf template like:
group everyone {
        cpu {
                cpu.shares = 100;
        }
        memory {
                memory.limit_in_bytes = 61G;
                memory.memsw.limit_in_bytes = 65G;
                memory.use_hierarchy = 1;
        }
}
template everyone/%u {
        cpu {
                cpu.shares = 10;
        }
        memory {
                memory.limit_in_bytes = 30G;
                memory.memsw.limit_in_bytes = 32G;
        }
}
2. and add to /etc/cgrules.conf:
*               cpu,memory      everyone/%u
3. Start cgconfig and cgred services, login as a user

Actual results:
Check /cgroups/everyone/username/memory.limits_in_bytes and notice that there are no limits imposed.

Expected results:
Expecting limits as specified.

Additional info:
This is fixed in libcgroup-0.41 - this is the relevant excerpt from diff on src/config.c:
@@ -1483,7 +1483,24 @@
        }
 
        for (i = 0; i < template_table_index; i++) {
-               cgroup_copy_cgroup(&config_template_table[i], &template_table[i]);
+               cgroup_copy_cgroup(&template_table[i],
+                       &config_template_table[i]);
+               strcpy((template_table[i]).name,
+                       (config_template_table[i]).name);
+               template_table[i].tasks_uid =
+                       config_template_table[i].tasks_uid;
+               template_table[i].tasks_gid =
+                       config_template_table[i].tasks_gid;
+               template_table[i].task_fperm =
+                       config_template_table[i].task_fperm;
+               template_table[i].control_uid =
+                       config_template_table[i].control_uid;
+               template_table[i].control_gid =
+                       config_template_table[i].control_gid;
+               template_table[i].control_fperm =
+                       config_template_table[i].control_fperm;
+               template_table[i].control_dperm =
+                       config_template_table[i].control_dperm;
        }
 
        return ret;
@@ -1530,7 +1547,24 @@
        }
 
        for (i = 0; i < template_table_index; i++) {
-               cgroup_copy_cgroup(&config_template_table[i], &template_table[i]);
+               cgroup_copy_cgroup(&template_table[i],
+                       &config_template_table[i]);
+               strcpy((template_table[i]).name,
+                       (config_template_table[i]).name);
+               template_table[i].tasks_uid =
+                       config_template_table[i].tasks_uid;
+               template_table[i].tasks_gid =
+                       config_template_table[i].tasks_gid;
+               template_table[i].task_fperm =
+                       config_template_table[i].task_fperm;
+               template_table[i].control_uid =
+                       config_template_table[i].control_uid;
+               template_table[i].control_gid =
+                       config_template_table[i].control_gid;
+               template_table[i].control_fperm =
+                       config_template_table[i].control_fperm;
+               template_table[i].control_dperm =
+                       config_template_table[i].control_dperm;
        }
 
        return ret;

Comment 5 errata-xmlrpc 2014-10-14 06:44:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1480.html


Note You need to log in before you can comment on or make changes to this bug.