Skip to content

Commit e9fd729

Browse files
committed
selinux: fix all of the W=1 build warnings
There were a number of places in the code where the function definition did not match the associated comment block as well at least one file where the appropriate header files were not included (missing function declaration/prototype); this patch fixes all of these issue such that building the SELinux code with "W=1" is now warning free. % make W=1 security/selinux/ Signed-off-by: Paul Moore <[email protected]>
1 parent 1d1e1de commit e9fd729

File tree

6 files changed

+33
-8
lines changed

6 files changed

+33
-8
lines changed

security/selinux/avc.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ static inline struct avc_node *avc_search_node(struct selinux_avc *avc,
547547

548548
/**
549549
* avc_lookup - Look up an AVC entry.
550+
* @avc: the access vector cache
550551
* @ssid: source security identifier
551552
* @tsid: target security identifier
552553
* @tclass: target security class
@@ -597,6 +598,7 @@ static int avc_latest_notif_update(struct selinux_avc *avc,
597598

598599
/**
599600
* avc_insert - Insert an AVC entry.
601+
* @avc: the access vector cache
600602
* @ssid: source security identifier
601603
* @tsid: target security identifier
602604
* @tclass: target security class
@@ -825,9 +827,14 @@ int __init avc_add_callback(int (*callback)(u32 event), u32 events)
825827

826828
/**
827829
* avc_update_node - Update an AVC entry
830+
* @avc: the access vector cache
828831
* @event : Updating event
829832
* @perms : Permission mask bits
830-
* @ssid,@tsid,@tclass : identifier of an AVC entry
833+
* @driver: xperm driver information
834+
* @xperm: xperm permissions
835+
* @ssid: AVC entry source sid
836+
* @tsid: AVC entry target sid
837+
* @tclass : AVC entry target object class
831838
* @seqno : sequence number when decision was made
832839
* @xpd: extended_perms_decision to be added to the node
833840
* @flags: the AVC_* flags, e.g. AVC_EXTENDED_PERMS, or 0.
@@ -928,6 +935,7 @@ static int avc_update_node(struct selinux_avc *avc,
928935

929936
/**
930937
* avc_flush - Flush the cache
938+
* @avc: the access vector cache
931939
*/
932940
static void avc_flush(struct selinux_avc *avc)
933941
{
@@ -956,6 +964,7 @@ static void avc_flush(struct selinux_avc *avc)
956964

957965
/**
958966
* avc_ss_reset - Flush the cache and revalidate migrated permissions.
967+
* @avc: the access vector cache
959968
* @seqno: policy sequence number
960969
*/
961970
int avc_ss_reset(struct selinux_avc *avc, u32 seqno)
@@ -1105,6 +1114,7 @@ int avc_has_extended_perms(struct selinux_state *state,
11051114

11061115
/**
11071116
* avc_has_perm_noaudit - Check permissions but perform no auditing.
1117+
* @state: SELinux state
11081118
* @ssid: source security identifier
11091119
* @tsid: target security identifier
11101120
* @tclass: target security class
@@ -1156,6 +1166,7 @@ inline int avc_has_perm_noaudit(struct selinux_state *state,
11561166

11571167
/**
11581168
* avc_has_perm - Check permissions and perform any appropriate auditing.
1169+
* @state: SELinux state
11591170
* @ssid: source security identifier
11601171
* @tsid: target security identifier
11611172
* @tclass: target security class

security/selinux/netlabel.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
/**
3030
* selinux_netlbl_sidlookup_cached - Cache a SID lookup
3131
* @skb: the packet
32+
* @family: the packet's address family
3233
* @secattr: the NetLabel security attributes
3334
* @sid: the SID
3435
*
@@ -128,6 +129,7 @@ void selinux_netlbl_cache_invalidate(void)
128129
/**
129130
* selinux_netlbl_err - Handle a NetLabel packet error
130131
* @skb: the packet
132+
* @family: the packet's address family
131133
* @error: the error code
132134
* @gateway: true if host is acting as a gateway, false otherwise
133135
*
@@ -160,7 +162,6 @@ void selinux_netlbl_sk_security_free(struct sk_security_struct *sksec)
160162
/**
161163
* selinux_netlbl_sk_security_reset - Reset the NetLabel fields
162164
* @sksec: the sk_security_struct
163-
* @family: the socket family
164165
*
165166
* Description:
166167
* Called when the NetLabel state of a sk_security_struct needs to be reset.
@@ -313,6 +314,7 @@ int selinux_netlbl_sctp_assoc_request(struct sctp_endpoint *ep,
313314
/**
314315
* selinux_netlbl_inet_conn_request - Label an incoming stream connection
315316
* @req: incoming connection request socket
317+
* @family: the request socket's address family
316318
*
317319
* Description:
318320
* A new incoming connection request is represented by @req, we need to label
@@ -343,6 +345,7 @@ int selinux_netlbl_inet_conn_request(struct request_sock *req, u16 family)
343345
/**
344346
* selinux_netlbl_inet_csk_clone - Initialize the newly created sock
345347
* @sk: the new sock
348+
* @family: the sock's address family
346349
*
347350
* Description:
348351
* A new connection has been established using @sk, we've already labeled the
@@ -378,7 +381,7 @@ void selinux_netlbl_sctp_sk_clone(struct sock *sk, struct sock *newsk)
378381

379382
/**
380383
* selinux_netlbl_socket_post_create - Label a socket using NetLabel
381-
* @sock: the socket to label
384+
* @sk: the sock to label
382385
* @family: protocol family
383386
*
384387
* Description:

security/selinux/netport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static unsigned int sel_netport_hashfn(u16 pnum)
7373
/**
7474
* sel_netport_find - Search for a port record
7575
* @protocol: protocol
76-
* @port: pnum
76+
* @pnum: port
7777
*
7878
* Description:
7979
* Search the network port table and return the matching record. If an entry

security/selinux/ss/hashtab.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/slab.h>
99
#include <linux/errno.h>
1010
#include "hashtab.h"
11+
#include "security.h"
1112

1213
static struct kmem_cache *hashtab_node_cachep __ro_after_init;
1314

security/selinux/ss/mls.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ int mls_compute_sid(struct policydb *p,
553553
#ifdef CONFIG_NETLABEL
554554
/**
555555
* mls_export_netlbl_lvl - Export the MLS sensitivity levels to NetLabel
556+
* @p: the policy
556557
* @context: the security context
557558
* @secattr: the NetLabel security attributes
558559
*
@@ -574,6 +575,7 @@ void mls_export_netlbl_lvl(struct policydb *p,
574575

575576
/**
576577
* mls_import_netlbl_lvl - Import the NetLabel MLS sensitivity levels
578+
* @p: the policy
577579
* @context: the security context
578580
* @secattr: the NetLabel security attributes
579581
*
@@ -595,6 +597,7 @@ void mls_import_netlbl_lvl(struct policydb *p,
595597

596598
/**
597599
* mls_export_netlbl_cat - Export the MLS categories to NetLabel
600+
* @p: the policy
598601
* @context: the security context
599602
* @secattr: the NetLabel security attributes
600603
*
@@ -622,6 +625,7 @@ int mls_export_netlbl_cat(struct policydb *p,
622625

623626
/**
624627
* mls_import_netlbl_cat - Import the MLS categories from NetLabel
628+
* @p: the policy
625629
* @context: the security context
626630
* @secattr: the NetLabel security attributes
627631
*

security/selinux/ss/services.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ void security_compute_xperms_decision(struct selinux_state *state,
11021102
* @state: SELinux state
11031103
* @ssid: source security identifier
11041104
* @tsid: target security identifier
1105-
* @tclass: target security class
1105+
* @orig_tclass: target security class
11061106
* @avd: access vector decisions
11071107
* @xperms: extended permissions
11081108
*
@@ -1626,6 +1626,7 @@ int security_context_str_to_sid(struct selinux_state *state,
16261626
* @scontext_len: length in bytes
16271627
* @sid: security identifier, SID
16281628
* @def_sid: default SID to assign on error
1629+
* @gfp_flags: the allocator get-free-page (GFP) flags
16291630
*
16301631
* Obtains a SID associated with the security context that
16311632
* has the string representation specified by @scontext.
@@ -1919,6 +1920,7 @@ static int security_compute_sid(struct selinux_state *state,
19191920
* @ssid: source security identifier
19201921
* @tsid: target security identifier
19211922
* @tclass: target security class
1923+
* @qstr: object name
19221924
* @out_sid: security identifier for new subject/object
19231925
*
19241926
* Compute a SID to use for labeling a new subject or object in the
@@ -1947,6 +1949,7 @@ int security_transition_sid_user(struct selinux_state *state,
19471949

19481950
/**
19491951
* security_member_sid - Compute the SID for member selection.
1952+
* @state: SELinux state
19501953
* @ssid: source security identifier
19511954
* @tsid: target security identifier
19521955
* @tclass: target security class
@@ -2273,6 +2276,7 @@ void selinux_policy_commit(struct selinux_state *state,
22732276
* @state: SELinux state
22742277
* @data: binary policy data
22752278
* @len: length of data in bytes
2279+
* @load_state: policy load state
22762280
*
22772281
* Load a new set of security policy configuration data,
22782282
* validate it and convert the SID table as necessary.
@@ -2525,7 +2529,7 @@ int security_ib_pkey_sid(struct selinux_state *state,
25252529
* security_ib_endport_sid - Obtain the SID for a subnet management interface.
25262530
* @state: SELinux state
25272531
* @dev_name: device name
2528-
* @port: port number
2532+
* @port_num: port number
25292533
* @out_sid: security identifier
25302534
*/
25312535
int security_ib_endport_sid(struct selinux_state *state,
@@ -2856,9 +2860,10 @@ int security_get_user_sids(struct selinux_state *state,
28562860

28572861
/**
28582862
* __security_genfs_sid - Helper to obtain a SID for a file in a filesystem
2863+
* @policy: policy
28592864
* @fstype: filesystem type
28602865
* @path: path from root of mount
2861-
* @sclass: file security class
2866+
* @orig_sclass: file security class
28622867
* @sid: SID for path
28632868
*
28642869
* Obtain a SID to use for a file in a filesystem that
@@ -2915,7 +2920,7 @@ static inline int __security_genfs_sid(struct selinux_policy *policy,
29152920
* @state: SELinux state
29162921
* @fstype: filesystem type
29172922
* @path: path from root of mount
2918-
* @sclass: file security class
2923+
* @orig_sclass: file security class
29192924
* @sid: SID for path
29202925
*
29212926
* Acquire policy_rwlock before calling __security_genfs_sid() and release
@@ -3297,6 +3302,7 @@ int security_sid_mls_copy(struct selinux_state *state,
32973302
* @nlbl_sid: NetLabel SID
32983303
* @nlbl_type: NetLabel labeling protocol type
32993304
* @xfrm_sid: XFRM SID
3305+
* @peer_sid: network peer sid
33003306
*
33013307
* Description:
33023308
* Compare the @nlbl_sid and @xfrm_sid values and if the two SIDs can be

0 commit comments

Comments
 (0)