From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92F2B1B4140 for ; Wed, 4 Dec 2024 00:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733270415; cv=none; b=cehXCyZIzjrLrvmu3frA09JI8yFXii0z6s/No2PAKggj4xB//CMGmmAVk4RP+mwVH5kJfFOL2bry3+D+yVSOjt87HvSBfinzB6Z+cxBHdp08qtrZNp6J/dVBlKbz7uhkQnR3VUxwE1J+eqOHBJZ1qXrID3hztoFniNGobr+AfTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733270415; c=relaxed/simple; bh=4C3zy/3Xtoq5FHcNAlmFgia243qYTIlXnb/820E1Fi4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IkfjyopYPimngvsJTEHTL2SOivI8gWeIa7VelEeuo6tJgT8Tcy8kPOOskGWzhNu53Dw4rTqO0xszwS6SvC4XSFZRjvLNglYHabE+D1C19++A3PBWkGUjiXEsbJlyXeJAHh40ib3pHeTQA4M9BEOf4FM7zYUeVp2J+Nd/lsfdaJs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gqCsoTJ/; arc=none smtp.client-ip=209.85.166.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gqCsoTJ/" Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-3a7ff5c85cfso1097415ab.1 for ; Tue, 03 Dec 2024 16:00:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1733270412; x=1733875212; darn=lists.linux.dev; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Mc1ZGS9lQ0b/EeRQlcxev0IXuC4T041+iJYm/1vazoI=; b=gqCsoTJ/K7Tt9D3OWGefD+v10bFfcqAhMVdW7GIvgFmlvwZ7uTPslLGnaaBznz7a76 vJ+dYsDtxy7bVkJnIRGiGjr2i+PoSGjKzXiPnuo24UFjqTNfTc2JjoT99ijHn+YJEIig nA1MUeeGmcBLQjjXZ/wfBelNXTSCitQ1xXA18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733270412; x=1733875212; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Mc1ZGS9lQ0b/EeRQlcxev0IXuC4T041+iJYm/1vazoI=; b=G7K15uXE9Nge0Spo1b69F/HIgG6k/Q8w+/nRwFBNvvHORYCSQZZGg2H1pMVA4O3vWP HweqqiCPzt9l2hjG8VwFVZ/mW8heSCXs0P5dWkGeWdGG6nfpxWl0D6kSHVnAXbyZwlAN 8I5TLYIh5cGMj/sfJ8ygQpq0Uf5guID1UYYV3NvbhKvvR/UdnfU7WcmPsPiQCP6xwnMV ha/uXsHutqyq2MAHXnRZs4GbusjkDowyX+cpV9NMSF+y7vJVXKQ7vrtYIUk8fx5vpGav CnBLed/EJLKnOdX/rbU22tjNwEqtARugRCeN3F5fnKIj7uxvDvvo9xh5rFhWHxiUhxZW S23A== X-Forwarded-Encrypted: i=1; AJvYcCVEHGormvepYcReqJq3tyRjuIoRBiyhsQQDzxXLfgZ63Whz3BSI5y1lFq+iUHSSLTAQ/kcPq4xCVuMpKEGt9p+/a4HN9Q==@lists.linux.dev X-Gm-Message-State: AOJu0Yx87Rm2sLOwEjA6oR1dL4aT1lFolVtkk1m9bWZJF9d/OpA4X2BS UoEewsdjMGGa5qd8qdTKnBIQrGMYWnC6NjpKtmazV6q9kthcVp8Jz6eX+F6TMBE= X-Gm-Gg: ASbGncsVx0wS0q5NCaN+va/0wmInpbjk3VMxR9akoqsTYXLXMWL/8FtwQ5LQz32AXgg bk7peMWCYTYOooBeXcI5BWaEoke1cINKq2ElhieyIM48l2w/BB8ZFQ177oAfVnoFNA3UDGUXPHF t82y4WqQDeDVNor+XPw0Nwfh9lxLybTpU3uIBL671lG9KB8b2qp6fOXGQOdF6ipQvTdY/vSljFy ycNIStFz5ukSudebBvChxos0kttKS+qy+Wf1qHXO+SL9V7bQ1JpOgRvONq0rA== X-Google-Smtp-Source: AGHT+IEgl8XCJT5Pb5WmR2bg9AoPfQLC2H0rmjg7RtKpc6R4ckuWbh6gosnC/HaecwtdaxRcwGAf2A== X-Received: by 2002:a05:6e02:1c24:b0:3a7:ccb2:e438 with SMTP id e9e14a558f8ab-3a7f9d82b53mr35356965ab.11.1733270411617; Tue, 03 Dec 2024 16:00:11 -0800 (PST) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a7dd1c55d8sm23394655ab.64.2024.12.03.16.00.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 16:00:11 -0800 (PST) Message-ID: Date: Tue, 3 Dec 2024 17:00:10 -0700 Precedence: bulk X-Mailing-List: linux-kernel-mentees@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests: lsm: Refactor `flags_overset_lsm_set_self_attr` test To: Paul Moore Cc: Amit Vadhavana , jmorris@namei.org, serge@hallyn.com, casey@schaufler-ca.com, shuah@kernel.org, ricardo@marliere.net, linux-kernel-mentees@lists.linux.dev, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20241112182810.24761-1-av2082000@gmail.com> <52cc8e51-9e85-465b-8ee3-63a7a0a42951@linuxfoundation.org> Content-Language: en-US From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/26/24 20:38, Paul Moore wrote: > On Thu, Nov 14, 2024 at 11:25 AM Shuah Khan wrote: >> On 11/12/24 11:28, Amit Vadhavana wrote: >>> - Remove unnecessary `tctx` variable, use `ctx` directly. >>> - Simplified code with no functional changes. >>> >> >> I would rephrase the short to simply say Remove unused variable, >> as refactor implies more extensive changes than what this patch >> is actually doing. >> >> Please write complete sentences instead of bullet points in the >> change log. >> >> How did you find this problem? Do include the details on how >> in the change log. >> >>> Signed-off-by: Amit Vadhavana >>> --- >>> tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 7 +++---- >>> 1 file changed, 3 insertions(+), 4 deletions(-) >>> >>> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c >>> index 66dec47e3ca3..732e89fe99c0 100644 >>> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c >>> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c >>> @@ -56,16 +56,15 @@ TEST(flags_zero_lsm_set_self_attr) >>> TEST(flags_overset_lsm_set_self_attr) >>> { >>> const long page_size = sysconf(_SC_PAGESIZE); >>> - char *ctx = calloc(page_size, 1); >>> + struct lsm_ctx *ctx = calloc(page_size, 1); >> >> Why not name this tctx and avoid changes to the ASSERT_EQs >> below? >> >>> __u32 size = page_size; >>> - struct lsm_ctx *tctx = (struct lsm_ctx *)ctx; >>> >>> ASSERT_NE(NULL, ctx); >>> if (attr_lsm_count()) { >>> - ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, tctx, &size, >>> + ASSERT_LE(1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size, >>> 0)); >>> } >>> - ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, tctx, >>> + ASSERT_EQ(-1, lsm_set_self_attr(LSM_ATTR_CURRENT | LSM_ATTR_PREV, ctx, >>> size, 0)); >>> >>> free(ctx); >> >> You have to change this tctx for sure. >> >> With these changes: >> >> Reviewed-by: Shuah Khan >> >> Paul, James, >> >> Please do let me know if you would me to take this through >> kselftest tree. > > Amit has already posted a v2 with the requested changes, but I wanted > to get back to you on this even if this patch is outdated ... Shuah, > what is your preference for things like this? My general policy is > that patches only affecting one subsystem tree should be taken by the > associated subsystem to minimize merge headaches and other ugliness, > however, the kselftest is an interesting subsystem in that it relies > so heavily on others that I'm not sure my policy makes as much sense > here :) > kselftest patches usually go through subsystem trees because of the merge problems you mentioned. I take them through kselftest tree if subsystem maintainers want me to. Some do and I pick them up. I pick up patches if I don't see response from subsystem maintainers. thanks, -- Shuah