Remove __exit attribute from selopt functions
PATCH 1/1 Remove __exit attribute from selopt functions
The attached patch, also committed to the sourceforge CVS tree, removes the __exit attribute from several selopt functions that can also be called on the error exit path from selopt_init. Otherwise, gcc 3.2 omits these functions, leading to undefined reference errors when linking the kernel (previously noted in
http://marc.theaimsgroup.com/?l=selinux&m=103288158813142&w=2 and
http://marc.theaimsgroup.com/?l=selinux&m=103485225602431&w=2). We weren't seeing this problem on RH7.x with gcc 2.96, but Chris Vance encountered the error while building on RH8.0 and made these changes to correct the problem.
--
Stephen D. Smalley, NAI Labs
[email protected]
Index: lsm-2.4/security/selinux/selopt/cache.c
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/selopt/cache.c,v retrieving revision 1.1.1.3
security/selinux/selopt/cache.c +1 -1
@@ -619,7 +619,7 @@return 0 ; } -__exit void selopt_cache_exit(void) +void selopt_cache_exit (void ) {selopt_cache_flush ();return ;
Index: lsm-2.4/security/selinux/selopt/cache.h
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/selopt/cache.h,v retrieving revision 1.1.1.1
security/selinux/selopt/cache.h +1 -1
@@ -51,6 +51,6 @@void selopt_cache_flush (void );int selopt_cache_init (void )__init ; -void selopt_cache_exit(void) __exit; +void selopt_cache_exit (void );#endif /* _SELOPT_CACHE_H_ */
Index: lsm-2.4/security/selinux/selopt/flnetlink.c
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/selopt/flnetlink.c,v retrieving revision 1.1.1.2
security/selinux/selopt/flnetlink.c +1 -1
@@ -296,7 +296,7 @@return 0 ; } -__exit void flnetlink_exit(void) +void flnetlink_exit (void ) {sock_release (flnl->socket);down (&flnl_sem);
Index: lsm-2.4/security/selinux/selopt/perimtab.c
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/selopt/perimtab.c,v retrieving revision 1.1.1.1
security/selinux/selopt/perimtab.c +1 -1
@@ -273,7 +273,7 @@return 0 ; } -__exit void selopt_perimtab_exit(void) +void selopt_perimtab_exit (void ) {selopt_perimtab_flush (); }
Index: lsm-2.4/security/selinux/selopt/perimtab.h
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/selopt/perimtab.h,v retrieving revision 1.1.1.1
security/selinux/selopt/perimtab.h +1 -1
@@ -19,7 +19,7 @@void selopt_perimtab_flush (void );int selopt_perimtab_init (void )__init ; -void selopt_perimtab_exit(void) __exit; +void selopt_perimtab_exit (void );#include <linux/skbuff.h> #include <linux/netlink.h>
Index: lsm-2.4/security/selinux/selopt/queue.c
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/selopt/queue.c,v retrieving revision 1.1.1.1
security/selinux/selopt/queue.c +1 -1
@@ -424,7 +424,7 @@return 0 ; } -__exit void selopt_queue_exit(void) +void selopt_queue_exit (void ) {nf_unregister_queue_handler (PF_INET );unregister_netdevice_notifier (&selopt_queue_notifier);
Index: lsm-2.4/security/selinux/selopt/queue.h
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/selopt/queue.h,v retrieving revision 1.1.1.1
security/selinux/selopt/queue.h +1 -1
@@ -20,6 +20,6 @@int selopt_queue_dump (struct sk_buff *skb,struct netlink_callback *cb);int selopt_queue_init (void )__init ; -void selopt_queue_exit(void) __exit; +void selopt_queue_exit (void );#endif /* _SELOPT_QUEUE_H_ */