[LU-15184] LBUG: ASSERTION( buf_size == strlen(secctx_name) + 1 ) failed Created: 01/Nov/21  Updated: 05/Feb/22  Resolved: 30/Nov/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.0
Fix Version/s: Lustre 2.12.8, Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: Jian Yu Assignee: Sebastien Buisson
Resolution: Fixed Votes: 0
Labels: SELinux, security
Environment:

RHEL 8.5


Attachments: Text File config.log    
Issue Links:
Related
is related to LU-15126 RHEL 8.5 support Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

While running runtests on RHEL 8.5 client and server with SELinux disabled, the following LBUG occurred:

Lustre: DEBUG MARKER: -----============= acceptance-small: runtests ============----- Wed Oct 20 10:15:59 PDT 2021
Lustre: DEBUG MARKER: vm85: executing check_config_client /mnt/lustre
Lustre: DEBUG MARKER: Using TIMEOUT=20
Lustre: Modifying parameter general.*.*.lbug_on_grant_miscount in log params
Lustre: DEBUG MARKER: == runtests test 1: All Runtests ========================= 10:16:00 (1634750160)
Lustre: DEBUG MARKER: touching /mnt/lustre at Wed Oct 20 10:16:05 PDT 2021 (@1634750165)
Lustre: DEBUG MARKER: create an empty file /mnt/lustre/hosts.7841
Lustre: DEBUG MARKER: copying /etc/hosts to /mnt/lustre/hosts.7841
Lustre: DEBUG MARKER: comparing /etc/hosts and /mnt/lustre/hosts.7841
Lustre: DEBUG MARKER: renaming /mnt/lustre/hosts.7841 to /mnt/lustre/hosts.7841.ren
Lustre: DEBUG MARKER: copying /etc/hosts to /mnt/lustre/hosts.7841 again
LustreError: 8831:0:(pack_generic.c:805:lustre_msg_string()) can't unpack non-NULL terminated string in msg 000000008f1ca60d buffer[8] len 0
LustreError: 8831:0:(layout.c:2165:__req_capsule_get()) @@@ Wrong buffer for field 'file_secctx_name' (8 of 12) in format 'LDLM_INTENT_OPEN', 0 vs. 0 (client)  req@00000000fd326d4b x1714159751286720/t0(0) o101->lustre-MDT0000-mdc-ffff9ab7ea66e000@0@lo:12/10 lens 656/0 e 0 to 0 dl 0 ref 1 fl New:PQU/0/ffffffff rc 0/-1 job:''
LustreError: 8831:0:(mdc_lib.c:137:mdc_file_secctx_pack()) ASSERTION( buf_size == strlen(secctx_name) + 1 ) failed:
LustreError: 8831:0:(mdc_lib.c:137:mdc_file_secctx_pack()) LBUG
Pid: 8831, comm: cp 4.18.0-339.el8_lustre.x86_64 #1 SMP Tue Oct 19 12:47:57 PDT 2021
Call Trace TBD:
[<0>] libcfs_call_trace+0x6f/0x90 [libcfs]
[<0>] lbug_with_loc+0x43/0x80 [libcfs]
[<0>] mdc_file_secctx_pack.part.4+0xcb/0x100 [mdc]
[<0>] mdc_open_pack+0x22d/0x2f0 [mdc]
[<0>] mdc_intent_open_pack+0x2b6/0x900 [mdc]
[<0>] mdc_enqueue_base+0x503/0x1420 [mdc]
[<0>] mdc_intent_lock+0x219/0x560 [mdc]
[<0>] lmv_intent_open+0x29e/0xb70 [lmv]
[<0>] lmv_intent_lock+0x19c/0x390 [lmv]
[<0>] ll_lookup_it+0x6fc/0x1c90 [lustre]
[<0>] ll_atomic_open+0x256/0x1960 [lustre]
[<0>] path_openat+0xeff/0x14f0
[<0>] do_filp_open+0x93/0x100
[<0>] do_sys_open+0x184/0x220
[<0>] do_syscall_64+0x5b/0x1a0
[<0>] entry_SYSCALL_64_after_hwframe+0x65/0xca
Kernel panic - not syncing: LBUG
# sestatus
SELinux status:                 disabled
# getenforce
Disabled
# find /usr/include -name selinux.h
/usr/include/selinux/selinux.h
# rpm -qf /usr/include/selinux/selinux.h
libselinux-devel-2.9-5.el8.x86_64

Attached is the config.log while configuring the Lustre codes.
The issue can be reproduced by just touching a file after the filesystem is mounted.
After enabling SELinux, the failure didn't occur.



 Comments   
Comment by Peter Jones [ 01/Nov/21 ]

Sébastien

Could you please advise!

Thanks

Peter

Comment by Gerrit Updater [ 09/Nov/21 ]

"Sebastien Buisson <sbuisson@ddn.com>" uploaded a new patch: https://review.whamcloud.com/45501
Subject: LU-15184 llite: properly detect SELinux disabled case
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 63aaafad88e65dda8d01ce61aa25b1ec1ba25a71

Comment by Bob Glossman [ 10/Nov/21 ]

Using the RHEL 8.5 release available on 11/9 I was able to reproduce the failure and verify the fix. With selinux disabled runtests crashes exactly as reported.  Adding just the fix in https://review.whamcloud.com/45501 makes the problem disappear.

 

kernel version 4.18.0-348.el8

 

Comment by Gerrit Updater [ 10/Nov/21 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45524
Subject: LU-15184 llite: properly detect SELinux disabled case
Project: fs/lustre-release
Branch: b2_14
Current Patch Set: 1
Commit: 4dc8face582f1b2c0d4ea3a5df22f743add39098

Comment by Gerrit Updater [ 10/Nov/21 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45527
Subject: LU-15184 llite: properly detect SELinux disabled case
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: c1a4bf3da5fe90cd111eadb9afa473a46ca16980

Comment by Gerrit Updater [ 17/Nov/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45527/
Subject: LU-15184 llite: properly detect SELinux disabled case
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: bce5c5a9e38c41fa4c1ca4edc615380c4d3f453c

Comment by Gerrit Updater [ 30/Nov/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45501/
Subject: LU-15184 llite: properly detect SELinux disabled case
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 42661f7ba106b7d2e02f85a65880061585ca6ccb

Comment by Peter Jones [ 30/Nov/21 ]

Landed for 2.15

Comment by Gerrit Updater [ 05/Feb/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45524/
Subject: LU-15184 llite: properly detect SELinux disabled case
Project: fs/lustre-release
Branch: b2_14
Current Patch Set:
Commit: 7904abf2ac28c11345954c6aad0546ee5776860b

Generated at Sat Feb 10 03:16:10 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.