Bug 645287
| Summary: | [PATCH] fix size checks for mmap() on /proc/bus/pci files | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Martin Wilck <martin.wilck> |
| Component: | kernel | Assignee: | Prarit Bhargava <prarit> |
| Status: | CLOSED ERRATA | QA Contact: | Boris Ranto <branto> |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 6.0 | CC: | arozansk, branto, gasmith, ltroan |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | kernel-2.6.32-112.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-05-23 20:26:49 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Attachments: | |||
Created attachment 454748 [details]
system tap script used for analyzing this problem. Use together with attached test program.
Created attachment 454749 [details]
Test program for mmap(). run like this: "pci /proc/bus/pci/04/00.0 1024 91c20000"
This problem has been reported earlier (without patch), see e.g. http://bugs.gentoo.org/show_bug.cgi?id=335666 Upstream submission: http://lkml.org/lkml/2010/10/21/62 Made a retest: The problem described above is indeed solved by the attached patch. Accepted in "for-linus" branch of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git. Commit ID is 3b519e4ea618b6943a82931630872907f9ac2c2b. (In reply to comment #7) > Accepted in "for-linus" branch of > git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git. Commit ID is > 3b519e4ea618b6943a82931630872907f9ac2c2b. Clearing the conditional nak for upstream. I'll push this for RHEL6.1. Thanks for the update Martin! P. 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. Martin, do you know of a system on which this can be reproduced on? Thanks, P. (In reply to comment #10) > Martin, do you know of a system on which this can be reproduced on? > > Thanks, > > P. Oops -- I see there is a reproducer attached to this BZ. P. Note that my committed patch contains a bug. You need to apply http://lkml.org/lkml/2010/11/16/52 on top of it. (In reply to comment #12) > Note that my committed patch contains a bug. You need to apply > http://lkml.org/lkml/2010/11/16/52 on top of it. Heh :) I found that patch after I got the exact warning the reporter found :) P. Patch(es) available on kernel-2.6.32-112.el6 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-0542.html |
Created attachment 454747 [details] Suggested patch sent to LKML (against RHEL6 kernel, code hasn't changed upstream). Description of problem: Running certain tools (e.g. the config tool "lsiutil" for mpt based controllers) prints bogus warnings in syslog. This is caused by wrong consitency checks on mmap() calls on files under /proc/bus/pci. Version-Release number of selected component (if applicable): 2.6.32-71.el6 (RHEL6 RC) How reproducible: always Steps to Reproduce: 1. try mmap on a valid memory resource on a /proc/bus/pci filewith attached test program pci.c Actual results: WARNING: at drivers/pci/pci-sysfs.c:688 pci_mmap_fits+0xad/0xe0() (Tainted: G W ---------------- ) Hardware name: PRIMERGY RX600 S5 process "pci1" tried to map 0x00091c20-0x00091c21 on 0000:04:00.0 BAR 0 (size 0x00000020) Modules linked in: [...] mod [last unloaded: stap_da9f117f8e592d256081a352c344e54d_6815] Pid: 13427, comm: pci1 Tainted: G W ---------------- 2.6.32-71.el6.x86_64 #1 Call Trace: [<ffffffff8106b857>] warn_slowpath_common+0x87/0xc0 [<ffffffff8106b946>] warn_slowpath_fmt+0x46/0x50 [<ffffffff8127951d>] pci_mmap_fits+0xad/0xe0 [<ffffffff81077fd3>] ? capable+0x13/0x50 [<ffffffff814cc3f9>] kretprobe_trampoline+0x0/0x57 [<ffffffff811cf1ad>] proc_reg_mmap+0x6d/0xb0 [<ffffffff8113bd30>] mmap_region+0x410/0x5a0 [<ffffffff8113c1fa>] do_mmap_pgoff+0x33a/0x380 [<ffffffff8112c1af>] sys_mmap_pgoff+0x1cf/0x2a0 [<ffffffff81018129>] sys_mmap+0x29/0x30 [<ffffffff81013172>] system_call_fastpath+0x16/0x1b Expected results: No warning Additional info: I sent a suggested patch for this problem to upstream today (2010-10-21), subject "[PATCH] fix size checks for mmap() on /proc/bus/pci files".