Bug 1022496 - Exceeding an arbitrary limit on number of SOL IPMI consoles causes conmand to crash on start
Exceeding an arbitrary limit on number of SOL IPMI consoles causes conmand to...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: conman (Show other bugs)
6.4
Unspecified Unspecified
medium Severity medium
: rc
: 6.8
Assigned To: Ondrej Vasik
Miroslav Hradílek
:
Depends On:
Blocks: 1172231 1269194 1318711 1400664 1405173 1356036 1359264
  Show dependency treegraph
 
Reported: 2013-10-23 08:19 EDT by Miroslav Hradílek
Modified: 2017-03-21 07:35 EDT (History)
9 users (show)

See Also:
Fixed In Version: conman-0.2.7-3.el6
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1244189 (view as bug list)
Environment:
Last Closed: 2017-03-21 07:35:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The patch which fixes this (2.41 KB, patch)
2016-02-01 12:18 EST, Denys Vlasenko
no flags Details | Diff

  None (edit)
Description Miroslav Hradílek 2013-10-23 08:19:43 EDT
Clone of the upstream issue https://code.google.com/p/conman/issues/detail?id=15


> Reported by markkawi...@gmail.com, Nov 27, 2012
> 
> What steps will reproduce the problem?
> 
> Create a conman.conf file with 4,096 or more "console" entries, all using IPMI SOL, and try to run conmand. It will crash.
> 
> What is the expected output? What do you see instead?
> 
> 
> What version of the software are you using? On what operating system?
> 
> ConMan 0.2.7, CentOS 5.5 (kernel 2.6.18)
> 
> Please provide any additional information below.
> 
> The relevant defines:
> 
> #define IPMI_ENGINE_CONSOLES_PER_THREAD 128
> #define IPMICONSOLE_THREAD_COUNT_MAX 32
> 
> When there are 4,096 or more consoles using IPMI SOL, the following line is run:
> 
> num_threads = ((num_consoles - 1) / IPMI_ENGINE_CONSOLES_PER_THREAD) + 1;
> 
> (this is on line 96 of the file server-ipmi.c. The math works out to: ((4096 - 1) / 128) + 1. That goes to 33 when num_consoles is >= 4096. But 33 is greater than IPMICONSOLE_THREAD_COUNT_MAX, and libipmiconsole refuses to initialize the engine.
> 
> The workaround is to make sure that num_threads never exceeds IPMICONSOLE_THREAD_COUNT_MAX:
> 
> Mark-Pettits-Twitter-Laptop:~/conman/conman$ git diff
> diff --git a/server-ipmi.c b/server-ipmi.c
> index ba2ec65..2b7775a 100644
> --- a/server-ipmi.c
> +++ b/server-ipmi.c
> @@ -93,6 +93,7 @@ void ipmi_init(int num_consoles)
> return;
> }
> num_threads = ((num_consoles - 1) / IPMI_ENGINE_CONSOLES_PER_THREAD) + 1;
> +    num_threads = MIN(num_threads, IPMICONSOLE_THREAD_COUNT_MAX);
> 
> if (ipmiconsole_engine_init(num_threads, 0) < 0) {
> log_err(0, "Unable to start IPMI SOL engine");
Comment 3 Denys Vlasenko 2013-10-23 08:55:02 EDT
From devel side, it is trivially easy to do this.
Comment 16 Denys Vlasenko 2014-10-20 12:36:06 EDT
I have a working patch for this, but can't commit it:

$ rhpkg commit --clog -p
...
remote: *** Resolves:
remote: ***   Unapproved:
remote: ***     rhbz#1022496 (pm_ack+, rhel-6.5.0-, rhel-6.6.0+, rhel-6.5.z?)
remote: *** No approved Bugzilla IDs referenced in log message or changelog for ecb7e7702661689c7bbbaa38c69067de80772299
remote: *** Unapproved Bugzilla IDs referenced in log message or changelog for ecb7e7702661689c7bbbaa38c69067de80772299
remote: *** Commit ecb7e7702661689c7bbbaa38c69067de80772299 denied
remote: *** Current checkin policy requires:
remote:     (rhel-6.6.z == + or (rhel-6.6.0 == + and blocker == +))

Please set required flags (blocker+, or rhel-6.7.0+), and I will commit the change.
Comment 25 Denys Vlasenko 2016-02-01 12:18 EST
Created attachment 1120192 [details]
The patch which fixes this
Comment 32 errata-xmlrpc 2017-03-21 07:35:08 EDT
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.

https://rhn.redhat.com/errata/RHBA-2017-0761.html

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