Whamcloud - gitweb
LU-13525 sec: better struct sepol_downcall_data 80/38580/7
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 12 May 2020 15:58:15 +0000 (00:58 +0900)
committerOleg Drokin <green@whamcloud.com>
Sun, 28 Jun 2020 02:47:16 +0000 (02:47 +0000)
commit82b8cb5528f489e9ceb7a1899722fc4108e85739
treecec8ea46e9a5ab102267c9e322e9bec40b25a91e
parent3116b9e19dc09a4a8b73c2c4733df5fe4596e041
LU-13525 sec: better struct sepol_downcall_data

struct sepol_downcall_data is badly formed for several reasons:
- it uses a __kernel_time_t field, which can be variably sized,
  depending on the size of __kernel_long_t. Replace it with a
  fixed-size __s64 type;
- it has __u32 sdd_magic that is immediately before a potentially
  64-bit field, whereas the 64-bit fields in a structure should
  always be naturally aligned on 64-bit boundaries to avoid potential
  incompatibility in the structure definition;
- it has __u16 sdd_sepol_len which may be followed by padding.

So create a better struct sepol_downcall_data, while maintaining
compatibility with 2.12 by keeping a struct sepol_downcall_data_old.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I07c573c2eef64fb0c796d8af4acdc3428e0761a8
Reviewed-on: https://review.whamcloud.com/38580
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/ptlrpc/sec_lproc.c
lustre/utils/l_getsepol.c