KTD LSM: BuildKit LSM setxattr handling

Add counter to track the number of setxattr invocations.
Do not unilaterally block setxattr operations for the 'csm' attribute.

Kernel internal calls to setxattr can occur during some FS operations.
In particular, overlayfs copy-up operations. Blocking the write causes
the operation to fail and that will cause legitimate user programs
to break, e.g. 'docker build' with BuildKit enabled.

BUG=b/227623354
SOURCE=KTD

cos-patch: bug

Signed-off-by: Ken Hofsass <hofsass@google.com>
Change-Id: Ic5ca0d96983abd70c3a405655f29ed4258582687
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/33122
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Main-Branch-Verified: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Oleksandr Tymoshenko <ovt@google.com>
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/33230
Reviewed-by: Roy Yang <royyang@google.com>
2 files changed