@@ -110,13 +110,6 @@ static inline int groups_search(const struct group_info *group_info, kgid_t grp)
110110 */
111111struct cred {
112112 atomic_long_t usage ;
113- #ifdef CONFIG_DEBUG_CREDENTIALS
114- atomic_t subscribers ; /* number of processes subscribed */
115- void * put_addr ;
116- unsigned magic ;
117- #define CRED_MAGIC 0x43736564
118- #define CRED_MAGIC_DEAD 0x44656144
119- #endif
120113 kuid_t uid ; /* real UID of the task */
121114 kgid_t gid ; /* real GID of the task */
122115 kuid_t suid ; /* saved UID of the task */
@@ -172,46 +165,6 @@ extern int cred_fscmp(const struct cred *, const struct cred *);
172165extern void __init cred_init (void );
173166extern int set_cred_ucounts (struct cred * );
174167
175- /*
176- * check for validity of credentials
177- */
178- #ifdef CONFIG_DEBUG_CREDENTIALS
179- extern void __noreturn __invalid_creds (const struct cred * , const char * , unsigned );
180- extern void __validate_process_creds (struct task_struct * ,
181- const char * , unsigned );
182-
183- extern bool creds_are_invalid (const struct cred * cred );
184-
185- static inline void __validate_creds (const struct cred * cred ,
186- const char * file , unsigned line )
187- {
188- if (unlikely (creds_are_invalid (cred )))
189- __invalid_creds (cred , file , line );
190- }
191-
192- #define validate_creds (cred ) \
193- do { \
194- __validate_creds((cred), __FILE__, __LINE__); \
195- } while(0)
196-
197- #define validate_process_creds () \
198- do { \
199- __validate_process_creds(current, __FILE__, __LINE__); \
200- } while(0)
201-
202- extern void validate_creds_for_do_exit (struct task_struct * );
203- #else
204- static inline void validate_creds (const struct cred * cred )
205- {
206- }
207- static inline void validate_creds_for_do_exit (struct task_struct * tsk )
208- {
209- }
210- static inline void validate_process_creds (void )
211- {
212- }
213- #endif
214-
215168static inline bool cap_ambient_invariant_ok (const struct cred * cred )
216169{
217170 return cap_issubset (cred -> cap_ambient ,
@@ -264,7 +217,6 @@ static inline const struct cred *get_cred_many(const struct cred *cred, int nr)
264217 struct cred * nonconst_cred = (struct cred * ) cred ;
265218 if (!cred )
266219 return cred ;
267- validate_creds (cred );
268220 nonconst_cred -> non_rcu = 0 ;
269221 return get_new_cred_many (nonconst_cred , nr );
270222}
@@ -290,7 +242,6 @@ static inline const struct cred *get_cred_rcu(const struct cred *cred)
290242 return NULL ;
291243 if (!atomic_long_inc_not_zero (& nonconst_cred -> usage ))
292244 return NULL ;
293- validate_creds (cred );
294245 nonconst_cred -> non_rcu = 0 ;
295246 return cred ;
296247}
@@ -312,7 +263,6 @@ static inline void put_cred_many(const struct cred *_cred, int nr)
312263 struct cred * cred = (struct cred * ) _cred ;
313264
314265 if (cred ) {
315- validate_creds (cred );
316266 if (atomic_long_sub_and_test (nr , & cred -> usage ))
317267 __put_cred (cred );
318268 }
0 commit comments