Bug 667810 - "modprobe ip_conntrack hashsize=NNNN" panics kernel if /etc/modprobe.conf has hashsize=MMMM
Summary: "modprobe ip_conntrack hashsize=NNNN" panics kernel if /etc/modprobe.conf has...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.5
Hardware: x86_64
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Neil Horman
QA Contact: Boris Ranto
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-06 20:37 UTC by John Hawkes
Modified: 2011-07-21 10:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 10:27:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to preent null derefeneces in set_hashsize module option parsing (2.36 KB, patch)
2011-01-19 21:06 UTC, Neil Horman
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1065 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.7 kernel security and bug fix update 2011-07-21 09:21:37 UTC

Description John Hawkes 2011-01-06 20:37:35 UTC
Description of problem:

Kernel panic when doing
    modprobe ip_conntrack hashsize=32768
when /etc/modprobe.conf already contains a different (lower?) value:
    options ip_conntrack hashsize=16384


Version-Release number of selected component (if applicable):

    kernel-2.6.18-194.32.1.el5


How reproducible:

    Every time.


Steps to Reproduce:

/etc/modprobe.conf contains an option for ip_conntrack:
    options ip_conntrack hashsize=16384

Boot the kernel (2.6.9-194.32.1.el5) and have various options turned off so that the ip_conntrack kernel module is not loaded.  Confirm this with:
    grep ip_conntrack /proc/modules
and don't see ip_conntrack.

Also confirm that /etc/modules.conf is set up:
    modprobe -nv ip_conntrack
should show you the "hashsize=16384".

Then attempt to manually load the ip_conntrack module specifying a different hashsize than is specified in /etc/modprobe.conf:
    modprobe ip_conntrack hashsize=32768

Panic!

I haven't been able to capture the printk output, but a summary of the stack dump on the console:
    alternatives_smp_module_add + 0xf2
    parse_args + 0x113
    load_module + 0x15fc

With a RHEL4 kernel (2.6.9-89.33.1.EL), the manual
    modprobe ip_conntrack hashsize=32768
ignores the attempt to override hashsize, and ip_conntrack only sees the value in /etc/modprobe.conf.

With both RHEL4 and RHEL5 kernels, if /etc/modprobe.conf contains no mention of ip_conntrack, then the manual modprobe uses the specified hashsize= arg value.

Comment 1 Neil Horman 2011-01-18 16:57:21 UTC
I've managed to reproduce this.  I have a feeling this is a stack overrun.  I'll do some digging and post results soon

Comment 2 Neil Horman 2011-01-18 21:09:47 UTC
Found the problem.  Turns out the set method for the hashtable size in the conntrack modules has some broken logic in it, and on the second set we try to deference the ip_conntrack_hash array before we've allocated it.  I'll have a patch together shortly

Comment 3 Neil Horman 2011-01-19 21:06:51 UTC
Created attachment 474359 [details]
patch to preent null derefeneces in set_hashsize module option parsing

Here, this patch fixes it.  Looks like a variant needs to go upstream as well.  I'll look into that shortly, and post this asap.

Comment 4 RHEL Program Management 2011-02-04 20:30:49 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 6 Jarod Wilson 2011-02-09 14:57:44 UTC
in kernel-2.6.18-243.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 10 errata-xmlrpc 2011-07-21 10:27:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1065.html


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