diff options
| author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2014-04-22 08:48:30 -0400 |
|---|---|---|
| committer | Steffen Klassert <steffen.klassert@secunet.com> | 2014-04-23 02:21:04 -0400 |
| commit | 2e71029e2c32ecd59a2e8f351517bfbbad42ac11 (patch) | |
| tree | b149f7d9be228544e36416dece87c2ab6ca28b7b /include | |
| parent | f1370cc4a01e61007ab3020c761cef6b88ae3729 (diff) | |
xfrm: Remove useless xfrm_audit struct.
Commit f1370cc4 "xfrm: Remove useless secid field from xfrm_audit." changed
"struct xfrm_audit" to have either
{ audit_get_loginuid(current) / audit_get_sessionid(current) } or
{ INVALID_UID / -1 } pair.
This means that we can represent "struct xfrm_audit" as "bool".
This patch replaces "struct xfrm_audit" argument with "bool".
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/xfrm.h | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 882889eb156b..721e9c3b11bd 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -691,12 +691,6 @@ struct xfrm_spi_skb_cb { | |||
| 691 | 691 | ||
| 692 | #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) | 692 | #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) |
| 693 | 693 | ||
| 694 | /* Audit Information */ | ||
| 695 | struct xfrm_audit { | ||
| 696 | kuid_t loginuid; | ||
| 697 | unsigned int sessionid; | ||
| 698 | }; | ||
| 699 | |||
| 700 | #ifdef CONFIG_AUDITSYSCALL | 694 | #ifdef CONFIG_AUDITSYSCALL |
| 701 | static inline struct audit_buffer *xfrm_audit_start(const char *op) | 695 | static inline struct audit_buffer *xfrm_audit_start(const char *op) |
| 702 | { | 696 | { |
| @@ -712,22 +706,24 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op) | |||
| 712 | return audit_buf; | 706 | return audit_buf; |
| 713 | } | 707 | } |
| 714 | 708 | ||
| 715 | static inline void xfrm_audit_helper_usrinfo(kuid_t auid, unsigned int ses, | 709 | static inline void xfrm_audit_helper_usrinfo(bool task_valid, |
| 716 | struct audit_buffer *audit_buf) | 710 | struct audit_buffer *audit_buf) |
| 717 | { | 711 | { |
| 718 | audit_log_format(audit_buf, " auid=%u ses=%u", | 712 | const unsigned int auid = from_kuid(&init_user_ns, task_valid ? |
| 719 | from_kuid(&init_user_ns, auid), ses); | 713 | audit_get_loginuid(current) : |
| 714 | INVALID_UID); | ||
| 715 | const unsigned int ses = task_valid ? audit_get_sessionid(current) : | ||
| 716 | (unsigned int) -1; | ||
| 717 | |||
| 718 | audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses); | ||
| 720 | audit_log_task_context(audit_buf); | 719 | audit_log_task_context(audit_buf); |
| 721 | } | 720 | } |
| 722 | 721 | ||
| 723 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, | 722 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, bool task_valid); |
| 724 | unsigned int ses); | 723 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
| 725 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, | 724 | bool task_valid); |
| 726 | unsigned int ses); | 725 | void xfrm_audit_state_add(struct xfrm_state *x, int result, bool task_valid); |
| 727 | void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, | 726 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, bool task_valid); |
| 728 | unsigned int ses); | ||
| 729 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, | ||
| 730 | unsigned int ses); | ||
| 731 | void xfrm_audit_state_replay_overflow(struct xfrm_state *x, | 727 | void xfrm_audit_state_replay_overflow(struct xfrm_state *x, |
| 732 | struct sk_buff *skb); | 728 | struct sk_buff *skb); |
| 733 | void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, | 729 | void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, |
| @@ -740,22 +736,22 @@ void xfrm_audit_state_icvfail(struct xfrm_state *x, struct sk_buff *skb, | |||
| 740 | #else | 736 | #else |
| 741 | 737 | ||
| 742 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 738 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
| 743 | kuid_t auid, unsigned int ses) | 739 | bool task_valid) |
| 744 | { | 740 | { |
| 745 | } | 741 | } |
| 746 | 742 | ||
| 747 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 743 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
| 748 | kuid_t auid, unsigned int ses) | 744 | bool task_valid) |
| 749 | { | 745 | { |
| 750 | } | 746 | } |
| 751 | 747 | ||
| 752 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, | 748 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, |
| 753 | kuid_t auid, unsigned int ses) | 749 | bool task_valid) |
| 754 | { | 750 | { |
| 755 | } | 751 | } |
| 756 | 752 | ||
| 757 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 753 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, |
| 758 | kuid_t auid, unsigned int ses) | 754 | bool task_valid) |
| 759 | { | 755 | { |
| 760 | } | 756 | } |
| 761 | 757 | ||
| @@ -1499,7 +1495,7 @@ struct xfrmk_spdinfo { | |||
| 1499 | 1495 | ||
| 1500 | struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark, u32 seq); | 1496 | struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark, u32 seq); |
| 1501 | int xfrm_state_delete(struct xfrm_state *x); | 1497 | int xfrm_state_delete(struct xfrm_state *x); |
| 1502 | int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); | 1498 | int xfrm_state_flush(struct net *net, u8 proto, bool task_valid); |
| 1503 | void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); | 1499 | void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); |
| 1504 | void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si); | 1500 | void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si); |
| 1505 | u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq); | 1501 | u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq); |
| @@ -1594,7 +1590,7 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, | |||
| 1594 | int *err); | 1590 | int *err); |
| 1595 | struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, | 1591 | struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, |
| 1596 | u32 id, int delete, int *err); | 1592 | u32 id, int delete, int *err); |
| 1597 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); | 1593 | int xfrm_policy_flush(struct net *net, u8 type, bool task_valid); |
| 1598 | u32 xfrm_get_acqseq(void); | 1594 | u32 xfrm_get_acqseq(void); |
| 1599 | int verify_spi_info(u8 proto, u32 min, u32 max); | 1595 | int verify_spi_info(u8 proto, u32 min, u32 max); |
| 1600 | int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); | 1596 | int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); |
