Bug 842175 - Building certain kernel modules fails with the error Illegal char '['
Building certain kernel modules fails with the error Illegal char '['
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: redhat-rpm-config (Show other bugs)
6.3
Unspecified Linux
medium Severity medium
: rc
: 6.5
Assigned To: Minfei Huang
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-22 15:04 EDT by Akemi Yagi
Modified: 2015-03-10 09:26 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-10 09:26:56 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)
Replace brackets in the value of modver in modalias.prov with acceptable char (486 bytes, application/octet-stream)
2012-07-22 15:04 EDT, Akemi Yagi
no flags Details
rpmbuild think "[" and "]" are illegal in version field (357 bytes, text/x-rpm-spec)
2013-08-23 04:15 EDT, Weiping Pan
no flags Details
fix aacraid version (712 bytes, patch)
2013-08-23 04:16 EDT, Weiping Pan
no flags Details | Diff

  None (edit)
Description Akemi Yagi 2012-07-22 15:04:06 EDT
Created attachment 599636 [details]
Replace brackets in the value of modver in modalias.prov with acceptable char

Description of problem:
Attempt to build kmod-aacraid fails with the following error:

Processing files: kmod-aacraid-1.1.7-4.el6.elrepo.x86_64
Finding  Provides: /usr/lib/rpm/redhat/find-provides
error: line 86: Illegal char '[' in: - Initial el6 build of the kmod package.

The error does not occur if redhat-rom-config is downgraded to an earlier version (e.g. 9.0.3-34.el6).

Version-Release number of selected component (if applicable):
redhat-rpm-config-9.0.3-39.el6

How reproducible:
Always

Steps to Reproduce:
1. Build the aacraid kernel module using redhat-rpm-config-9.0.3-39.el6
2.
3.
  
Actual results:
Build fails.

Expected results:
Build succeeds without an error

Additional info:

This error occurs if the module version contains the "[" or "]" chararacter. In this case,

$ modinfo aacraid | grep ^version
version:        1.1-7[28000]-ms

I compared redhat-rpm-config between -39 and -34 and found the source of the issue to be this change:

RHEL6.3-fix-find-provides-modalias-permissions.patch

+      chmod +x $(DESTDIR)/usr/lib/rpm/redhat/find-provides.d/modalias.prov

When the permission bits were changed back to 644, the error did not happen.

A workaround is to replace the "[" and "]" in modver with some acceptable char. For example:

modver=$(/sbin/modinfo -F version "$module"| head -n1 | tr "\[\]" "__" )

A patch file has been attached.
Comment 2 RHEL Product and Program Management 2012-12-14 03:32:01 EST
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 5 Weiping Pan 2013-08-22 04:15:19 EDT
Hi, Akemi,

I can not reproduce your bug.
Can you attach your srpm ? Then I can check it.

thanks
Weiping Pan
Comment 6 Akemi Yagi 2013-08-22 12:00:26 EDT
Hi Weiping,

You can get the srpm from ELRepo:

http://elrepo.org/linux/elrepo/el6/SRPMS/aacraid-kmod-1.2.1-2.el6.elrepo.src.rpm

This one produces the error:

error: line 92: Illegal char '[' in: - Initial el6 build of the kmod package.
Comment 7 Weiping Pan 2013-08-23 04:13:16 EDT
(In reply to Akemi Yagi from comment #6)
> Hi Weiping,
> 
> You can get the srpm from ELRepo:
> 
> http://elrepo.org/linux/elrepo/el6/SRPMS/aacraid-kmod-1.2.1-2.el6.elrepo.src.
> rpm
> 
> This one produces the error:
> 
> error: line 92: Illegal char '[' in: - Initial el6 build of the kmod package.

Hi, Akemi Yagi,

Yes I can reproduce your bug now.
The root cause is that rpmbuild think "[" and "]" are illegal character in the version.
I will attach a simple spec, and if you add "[" or "]" in Version, it can not be built.

Yes your patch for /usr/lib/rpm/redhat/find-provides.d/modalias.prov is good.

But how about just chaning AAC_DRIVER_FULL_VERSION in your source file ?
I will attach another patch, too.

So there are two methods to fix this problem now.
1 replace "[" and "]" in AAC_DRIVER_FULL_VERSION in the source file
2 modify modalias.prov and replace "[" and "]" with maybe "_"

Any ideas which one is better or do you have other methods ?

thanks
Weiping Pan
Comment 8 Weiping Pan 2013-08-23 04:15:20 EDT
Created attachment 789497 [details]
rpmbuild think "[" and "]" are illegal in version field

rpmbuild think "[" and "]" are illegal in version field.
Comment 9 Weiping Pan 2013-08-23 04:16:10 EDT
Created attachment 789498 [details]
fix aacraid version

patch to fix aacraid version.
Comment 10 Akemi Yagi 2013-08-23 12:47:00 EDT
(In reply to Weiping Pan from comment #7)

> So there are two methods to fix this problem now.
> 1 replace "[" and "]" in AAC_DRIVER_FULL_VERSION in the source file
> 2 modify modalias.prov and replace "[" and "]" with maybe "_"
> 
> Any ideas which one is better or do you have other methods ?

Hi Weiping,

I think that your number 2 is a preferred solution. Modifying modalias.prov is a universal solution whereas patching the source is good only for that particular package. If/when other manufacturers choose to use "[" or "]", they'd have to be fixed too. Your solution 2 is "fix once and for all".

Akemi
Comment 11 Weiping Pan 2013-08-25 22:49:22 EDT
(In reply to Akemi Yagi from comment #10)
> (In reply to Weiping Pan from comment #7)
> 
> > So there are two methods to fix this problem now.
> > 1 replace "[" and "]" in AAC_DRIVER_FULL_VERSION in the source file
> > 2 modify modalias.prov and replace "[" and "]" with maybe "_"
> > 
> > Any ideas which one is better or do you have other methods ?
> 
> Hi Weiping,
> 
> I think that your number 2 is a preferred solution. Modifying modalias.prov
> is a universal solution whereas patching the source is good only for that
> particular package. If/when other manufacturers choose to use "[" or "]",
> they'd have to be fixed too. Your solution 2 is "fix once and for all".
> 
> Akemi

Hi, Akemi,

Ok, then let me implemet in the second method.

thanks
Weiping Pan
Comment 12 Weiping Pan 2013-08-25 22:50:53 EDT
Hi, Chun,

Can you give QA ACK for this bug ?

thanks
Weiping Pan
Comment 13 Cui Chun 2013-08-25 23:20:58 EDT
(In reply to Weiping Pan from comment #12)
> Hi, Chun,
> 
> Can you give QA ACK for this bug ?
> 
> thanks
> Weiping Pan

Reassign to BaseOS QE for reviewing of redhat-rpm-config package.
Comment 14 RHEL Product and Program Management 2013-10-14 00:52:28 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 15 Akemi Yagi 2013-10-14 13:54:48 EDT
Hi Weiping,

I thought this bug fix was already in QA. If it is indeed necessary to file a request through the support channel, I can do it.

Akemi
Comment 16 Weiping Pan 2013-10-15 03:15:48 EDT
Hi, Akemi,

I am sorry that for RHEL6.5, redhat-rpm-config is not on ACL, then we can not modify this package, so this bug has not been fixed for RHEL6.5.

And since it is RHEL6.5 snap5 now, it is very late to try to fix it, how about deferring it to RHEL6.6 ?

If you do want this bug to be fixed in RHEL6.5 and have strong reason,
I will ask my manager and PM evaluate your request.

thanks
Weiping Pan
Comment 17 Akemi Yagi 2013-10-15 13:58:46 EDT
Because this is not an urgent matter, I suppose we can wait for RHEL6.6.

Akemi
Comment 18 Weiping Pan 2013-12-10 02:44:54 EST
Hi, PM,

Please help me set rhel 6.6 flag if you want to fix this bug in rhel 6.6.

thanks
Weiping Pan
Comment 20 Akemi Yagi 2014-06-15 23:29:37 EDT
This bug exists in RHEL 7.0 as well. Could you please apply the patch there?

Thanks,
Akemi
Comment 21 Weiping Pan 2014-06-16 21:23:46 EDT
Hi, Akemi,

Can you cork a patch to modify the driver version in upstream ?
In my opinion, it is odd to have such a version format, and it does not deserve the efforts to fix it in redhat-rpm-config package.

thanks
Weiping Pan
Comment 22 Akemi Yagi 2014-06-16 21:54:06 EDT
Hi Weiping,

According to the upstream driver page at:

http://www.adaptec.com/en-us/speed/raid/aac/linux/aacraid_linux_rpms_v1_2_1-30300_tgz.htm

their version is :

Version:   1.2.1-30300

I don't see the '[' character upstream. So, I suspect it was introduced to RHEL at some point. 

Therefore, an appropriate fix seems to be either 1) to update the RH version to 1.2.1-30300 or 2) fix redhat-rpm-config.

Akemi
Comment 23 Weiping Pan 2014-06-30 23:07:58 EDT
Hi, Akemi, 

In upstream,
drivers/scsi/aacraid/linit.c
  65 #ifdef AAC_DRIVER_BUILD
  66 #define _str(x) #x
  67 #define str(x) _str(x)
  68 #define AAC_DRIVER_FULL_VERSION AAC_DRIVER_VERSION "[" str(AAC_DRIVER_BUILD) "]" AAC_DRIVER_BRANCH
  69 #else
  70 #define AAC_DRIVER_FULL_VERSION AAC_DRIVER_VERSION AAC_DRIVER_BRANCH
  71 #endif

Line 68 introduces the illegal character "[" and "]",
and REHL version is the same as upstream version.

So in my opinion, when you build this kmod, can you cork a patch like in comment 9, fix the version ?
I think it does not deserve the efforts to fix it in redhat-rpm-config.


thanks
Weiping Pan
Comment 24 Akemi Yagi 2014-07-01 13:55:59 EDT
Hi Weiping,

Thank you for your note. 

Well, if patching redhat-rpm-config does not seem to justify the effort involved, we can give it up. But updating the driver to the current version might be worthwhile (and it fixes the current problem). Guess that is for another day ...

Akemi
Comment 25 Weiping Pan 2014-07-07 04:02:54 EDT
Hi, Akemi,

I recommend that you can cork a patch to fix the version problem in upstream,
then next time when you request a driver sync, our developer will pick up this fix into RHEL.

thanks
Weiping Pan
Comment 29 Ľuboš Kardoš 2015-01-06 08:23:52 EST
Assigned to ffesti by mistake, assigning back to wpan.

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