Bug 767992 - nfnetlink_log.h - missing definitions in userspace
Summary: nfnetlink_log.h - missing definitions in userspace
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Weiping Pan
QA Contact: Weibing Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-15 13:31 UTC by Neil Wilson
Modified: 2015-01-04 21:55 UTC (History)
3 users (show)

Fixed In Version: kernel-2.6.32-229.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 08:10:51 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0862 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Linux 6 kernel security, bug fix and enhancement update 2012-06-20 12:55:00 UTC

Description Neil Wilson 2011-12-15 13:31:14 UTC
Description of problem:

/usr/include/linux/netfilter/nfnetlink_log.h won't compile cleanly in userspace due to use of kernel type definitions.


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

2.6.32


How reproducible:

Create file 'test.c' containing

#include </usr/include/linux/netfilter/nfnetlink_log.h>

and compile with 

gcc -c test.c

 
Actual results:

Compile errors with 

In file included from test.c:7:
/usr/include/linux/netfilter/nfnetlink_log.h:31: error: expected specifier-qualifier-list before ‘aligned_be64’


Expected results:

Header file should compile cleanly in userspace.


Additional info:

Later kernels use a different typedef and define it in 'types.h'.

"nfnetlink_log.h"

struct nfulnl_msg_packet_timestamp {
	__aligned_be64	sec;
	__aligned_be64	usec;
};


"types.h"

/*
 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
 * common 32/64-bit compat problems.
 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
 * architectures) and to 8-byte boundaries on 64-bit architetures.  The new
 * aligned_64 type enforces 8-byte alignment so that structs containing
 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
 */
#define __aligned_u64 __u64 __attribute__((aligned(8)))
#define __aligned_be64 __be64 __attribute__((aligned(8)))
#define __aligned_le64 __le64 __attribute__((aligned(8)))

Comment 3 RHEL Program Management 2012-01-13 16:00:22 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 4 Weibing Zhang 2012-01-15 15:12:07 UTC
reproduced on kernel-2.6.32-131.0.105.el6

[atheism@localhost c]$ gcc log.c -o log
In file included from log.c:1:
/usr/include/linux/netfilter/nfnetlink_log.h:31: error: expected specifier-qualifier-list before ‘aligned_be64’
[atheism@localhost c]$ uname -a
Linux localhost 2.6.32-131.0.15.el6.i686 #1 SMP Tue May 10 15:42:28 EDT 2011 i686 i686 i386 GNU/Linux

Comment 5 Aristeu Rozanski 2012-02-10 19:33:33 UTC
Patch(es) available on kernel-2.6.32-229.el6

Comment 8 Weibing Zhang 2012-05-22 10:30:29 UTC
[root@hp-dl580g7-01 ~]# uname -a
Linux hp-dl580g7-01.rhts.eng.nay.redhat.com 2.6.32-271.el6.x86_64 #1 SMP Tue May 15 11:55:44 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
 
[root@hp-dl580g7-01 ~]# cat test.c 
#include </usr/include/linux/netfilter/nfnetlink_log.h>
int main()
{
}
[root@hp-dl580g7-01 ~]# gcc test.c -o test
[root@hp-dl580g7-01 ~]# 
Set Verified.

Comment 10 errata-xmlrpc 2012-06-20 08:10:51 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/RHSA-2012-0862.html


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