From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=113.46.200.221 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796023186; b=nFi228wFUlMbrdK7iVLUPd97k6YQLxSrRrfPsXQm9XIx7uxOVSUXEGN1F2t9A73T9mYP 0WpDhrOBKPWaaM6wihF8STJtNi/ZIlKXQWQS+/JCs2cTbqhO2GH2mk85GP57yHaP4O1x4 lhSiX9pFlwgAoWW+o+2dNQOLvGwgwbECoW30mb8HToEgvJ0KFlj5DtaPCFt9D2WbO1PwS lD/8TBTb0jNAdsaZowus44CD89k+a6mUARw2BUnGLbJVYCWrCMDwTtkg0KVaUz4Hp3eOl QG1R+ZbSTygI2qvkjBuqIv0v/U0iHah8Ic095iy7IWM1xuKUgKMn29j5XPEHW1Gca3w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796023186; h=DMARC-Filter:dkim-signature:Received:Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:CC:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; bh=WVTjusthUtUConniueOOXuJ+SucljDxqKbJCtOdb4gQ=; b=EJ6tqXwFtgZJTWn4x7FGyEkto4ifylul4u4kx8y3GPE1DaSj6Bd5I7TTqIgtGAJ52rAc Ed1G7rQxJr+OwZYiG9uh0/Yxd/dUpxOPBa3iPoQfUWqkYy2C/lOnpwdragD14T5U/sbuL 5jBfjHndia8FIW8LpaMlG5YR29z/fI9kk27gBVdRW154UOXPyNg4VX8VOP7AOvBUKn8bC 5PzRptnfKUsU/1gHVoq85oXqUYUQ1dgXDggu3WuHIiKcYFhzuXrzcbQn/4CZARpmn39ef 0b9cTpp0rrBaXlI+IDzNxQxUg4zdCizo9RjZcuNtgA/rtoMWt8ZmT7iuINLFqyXa6SQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b="aBl/U8QV"; arc=none smtp.remote-ip=113.46.200.221 Received: from canpmsgout06.his.huawei.com (canpmsgout06.his.huawei.com [113.46.200.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1469A606A325; Mon, 30 Nov 2026 07:19:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1469A606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=aBl/U8QV dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=WVTjusthUtUConniueOOXuJ+SucljDxqKbJCtOdb4gQ=; b=aBl/U8QVhCOXR1EPBx1xX8plax+2DeoaxWK9BEHVcD09YsW04wEkt7e4ZyvwQYY4DEFrZXjTQ TLYV+I1SAvtjJAJPYy5r2bxHHPyGTG4B5T7dS0w/q6vkNknSquLVLSrKX0cE7BwchwWGPO6mZFh TCkanAXyzRJCfYEERUCBvdE= Received: from mail.maildlp.com (unknown [172.19.163.104]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4jdFks6KLMzRhVC; Mon, 30 Nov 2026 15:19:17 +0800 (CST) Received: from whupemk100010.china.huawei.com (unknown [7.152.184.41]) by mail.maildlp.com (Postfix) with ESMTPS id 7480F4057F; Mon, 30 Nov 2026 15:19:39 +0800 (CST) Received: from [10.67.110.140] (10.67.110.140) by whupemk100010.china.huawei.com (7.152.184.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Mon, 30 Nov 2026 15:19:38 +0800 Message-ID: Date: Mon, 30 Nov 2026 15:19:36 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 8/8] selftests/lsm: add lockdown securityfs test To: Guicai Ma , , , , , , , CC: , , , , References: <20261126131315.1256553-1-caixinchen1@huawei.com> <20261126131315.1256553-9-caixinchen1@huawei.com> <20261127021029.2562038-1-maguicai@kylinos.cn> Content-Language: en-US From: Cai Xinchen In-Reply-To: <20261127021029.2562038-1-maguicai@kylinos.cn> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To whupemk100010.china.huawei.com (7.152.184.41) Thanks for your review. I will change $(call RUN_TESTS, lockdown_test) to $(call RUN_TESTS, $(OUTPUT)/lockdown_test) in v4. And I will add CAP_DAC_OVERRIDE check for non-root user and allow non-root user check read-format in v4. Thanks for your tests. On 11/27/2026 10:10 AM, Guicai Ma wrote: > On Thu, Nov 26, 2026 at 09:13:15PM +0800, Cai Xinchen wrote: >> +run_lockdown_test: all >> + $(call RUN_TESTS, lockdown_test) > As Sashiko noted, out-of-tree builds fail here because the binary lives > under $(OUTPUT). Running with OUTPUT= set produces: > > # Warning: file lockdown_test is missing! > not ok 1 selftests: lsm: lockdown_test > > Using $(OUTPUT)/lockdown_test here works both in-tree and out-of-tree. > >> + if (geteuid() != 0) >> + SKIP(return, "requires root"); >> + if (status_writable()) >> + SKIP(return, "cannot open %s for writing: %s", >> + LOCKDOWN_PATH, strerror(errno)); > Having both checks in FIXTURE_SETUP() makes non-root runs skip > read_format as well, leaving the 0644 / open(O_WRONLY) EACCES behavior > documented in 7/8 uncovered. Moving the write/root gate out of > read_format (or adding an unprivileged open() check) would cover that > part of the ABI too. > > I also ran the lockdown_test binary under QEMU/KVM on arm64 (mainline > 9437ee8b6cf6 with this series applied, KASAN + lockdep, > CONFIG_SECURITY_LOCKDOWN_LSM=y). Under lsm=lockdown, uid 65534 skipped > all 5 cases, while root runs passed none -> integrity (5/5), > integrity -> confidentiality (5/5), and confidentiality (4 pass, 1 skip > on upgrade). Booting with lsm=yama skipped all 5 cases on ENOENT, with > no KASAN or lockdep warnings. > > Thanks, > Guicai Ma