[LU-16012] RHEL 9.0 LBUG: ASSERTION( buf_size == strlen(secctx_name) + 1 ) failed Created: 14/Jul/22  Updated: 24/Mar/23  Resolved: 01/Sep/22

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

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

RHEL 9.0 client with kernel 5.14.0-70.17.1.el9_0


Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

RHEL 9.0 client build: https://build.whamcloud.com/job/lustre-reviews/88442/arch=x86_64,build_type=client,distro=el9.0,ib_stack=inkernel/
RHEL 8.6 server build: https://build.whamcloud.com/job/lustre-reviews/88442/arch=x86_64,build_type=server,distro=el8.6,ib_stack=inkernel/

While touching a file on RHEL 9.0 client and RHEL 8.6 server with SELinux disabled, the following LBUG occurred:

[  244.887851] Lustre: Mounted lustre-client
[  262.185517] LustreError: 3160:0:(pack_generic.c:806:lustre_msg_string()) can't unpack non-NULL terminated string in msg 000000007f1ce61d buffer[8] len 0
[  262.189477] LustreError: 3160:0:(layout.c:2162:__req_capsule_get()) @@@ Wrong buffer for field 'file_secctx_name' (8 of 12) in format 'LDLM_INTENT_OPEN', 0 vs. 0 (client)  req@00000000edb3137f x1738309845911936/t0(0) o101->lustre-MDT0000-mdc-ffff8da3054a1000@192.168.0.166@tcp:12/10 lens 664/0 e 0 to 0 dl 0 ref 1 fl New:PQU/0/ffffffff rc 0/-1 job:''
[  262.196650] LustreError: 3160:0:(mdc_lib.c:137:mdc_file_secctx_pack()) ASSERTION( buf_size == strlen(secctx_name) + 1 ) failed: 
[  262.199072] LustreError: 3160:0:(mdc_lib.c:137:mdc_file_secctx_pack()) LBUG
[  262.200321] Pid: 3160, comm: touch 5.14.0-70.17.1.el9_0.x86_64 #1 SMP PREEMPT Tue Jun 14 11:32:10 EDT 2022
[  262.201931] Call Trace TBD:
[  262.202400] Kernel panic - not syncing: LBUG
[  262.203138] CPU: 0 PID: 3160 Comm: touch Kdump: loaded Tainted: G           OE    --------- ---  5.14.0-70.17.1.el9_0.x86_64 #1

The similar failure was reported in LU-15184, and the build contained the fix.
 



 Comments   
Comment by Jian Yu [ 14/Jul/22 ]

After enabling SELinux on RHEL 9.0 client, touching a file passed.
runtests also passed:
https://testing.whamcloud.com/test_sessions/71ba98e6-cb79-4d58-90ac-398c1a965e8c

Comment by Gerrit Updater [ 21/Jul/22 ]

"Yingjin Qian <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48006
Subject: LU-16012 llite: null secctx name when selinux disabled
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 3a2f1fd4b0808f2b42e53b3c306be6820cb89efb

Comment by Gerrit Updater [ 27/Jul/22 ]

"Sebastien Buisson <sbuisson@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48049
Subject: LU-16012 sec: fix detection of SELinux enforcement
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c02b22aa2385ee8c9d7f26c1abbf34eb4cb3ccff

Comment by Gerrit Updater [ 11/Aug/22 ]

"Sebastien Buisson <sbuisson@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48193
Subject: LU-16012 sec: fix detection of SELinux enforcement
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: a7425e80f885d60b5de0f9824a99a3cbec42f7ef

Comment by Gerrit Updater [ 01/Sep/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/48049/
Subject: LU-16012 sec: fix detection of SELinux enforcement
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 155cbc22ba4f758cf9eec415f36f940ca2b23de9

Comment by Peter Jones [ 01/Sep/22 ]

Landed for 2.16

Comment by Gerrit Updater [ 24/Mar/23 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50403
Subject: LU-16012 sec: fix detection of SELinux enforcement
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: a56d1c67c035e9c7c3d12aebd9b5771d301a1d6d

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