smack.h (1fb057dcde11b355fc9acde95cee3b2caa5dafb0) smack.h (1aea7808372eee4ad01f98e064c88c57f1e94855)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2007 Casey Schaufler <casey@schaufler-ca.com>
4 *
5 * Author:
6 * Casey Schaufler <casey@schaufler-ca.com>
7 */
8

--- 343 unchanged lines hidden (view full) ---

352 return msg->security + smack_blob_sizes.lbs_msg_msg;
353}
354
355static inline struct smack_known **smack_ipc(const struct kern_ipc_perm *ipc)
356{
357 return ipc->security + smack_blob_sizes.lbs_ipc;
358}
359
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2007 Casey Schaufler <casey@schaufler-ca.com>
4 *
5 * Author:
6 * Casey Schaufler <casey@schaufler-ca.com>
7 */
8

--- 343 unchanged lines hidden (view full) ---

352 return msg->security + smack_blob_sizes.lbs_msg_msg;
353}
354
355static inline struct smack_known **smack_ipc(const struct kern_ipc_perm *ipc)
356{
357 return ipc->security + smack_blob_sizes.lbs_ipc;
358}
359
360static inline struct superblock_smack *smack_superblock(
361 const struct super_block *superblock)
362{
363 return superblock->s_security + smack_blob_sizes.lbs_superblock;
364}
365
360/*
361 * Is the directory transmuting?
362 */
363static inline int smk_inode_transmutable(const struct inode *isp)
364{
365 struct inode_smack *sip = smack_inode(isp);
366 return (sip->smk_flags & SMK_INODE_TRANSMUTE) != 0;
367}

--- 10 unchanged lines hidden (view full) ---

378/*
379 * Present a pointer to the smack label entry in an task blob.
380 */
381static inline struct smack_known *smk_of_task(const struct task_smack *tsp)
382{
383 return tsp->smk_task;
384}
385
366/*
367 * Is the directory transmuting?
368 */
369static inline int smk_inode_transmutable(const struct inode *isp)
370{
371 struct inode_smack *sip = smack_inode(isp);
372 return (sip->smk_flags & SMK_INODE_TRANSMUTE) != 0;
373}

--- 10 unchanged lines hidden (view full) ---

384/*
385 * Present a pointer to the smack label entry in an task blob.
386 */
387static inline struct smack_known *smk_of_task(const struct task_smack *tsp)
388{
389 return tsp->smk_task;
390}
391
386static inline struct smack_known *smk_of_task_struct_subj(
392static inline struct smack_known *smk_of_task_struct(
387 const struct task_struct *t)
388{
389 struct smack_known *skp;
390 const struct cred *cred;
391
392 rcu_read_lock();
393
393 const struct task_struct *t)
394{
395 struct smack_known *skp;
396 const struct cred *cred;
397
398 rcu_read_lock();
399
394 cred = rcu_dereference(t->cred);
395 skp = smk_of_task(smack_cred(cred));
396
397 rcu_read_unlock();
398
399 return skp;
400}
401
402static inline struct smack_known *smk_of_task_struct_obj(
403 const struct task_struct *t)
404{
405 struct smack_known *skp;
406 const struct cred *cred;
407
408 rcu_read_lock();
409
410 cred = __task_cred(t);
411 skp = smk_of_task(smack_cred(cred));
412
413 rcu_read_unlock();
414
415 return skp;
416}
417

--- 106 unchanged lines hidden ---
400 cred = __task_cred(t);
401 skp = smk_of_task(smack_cred(cred));
402
403 rcu_read_unlock();
404
405 return skp;
406}
407

--- 106 unchanged lines hidden ---