From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 92C561B0F33 for ; Wed, 4 Dec 2024 00:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733270414; cv=none; b=ofsxu4hONB67siu7Yeizhd+eoYDIGftL25JlEf6h3BDvviI13sgJtW6udg5EDZjFvbM6HDnQo+PfYjUejVD4cIs95EK4XkcABAlduxC7jLy/V9IHqpoLU60m1lUZl4pqn76yG9BUXI078o0PM8Zsb4OI1xqNL3q2nj4kg68m7uU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733270414; c=relaxed/simple; bh=4C3zy/3Xtoq5FHcNAlmFgia243qYTIlXnb/820E1Fi4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AlQkHS7QE8qa4T6rp03UTRXFTmZXRQSjW+8KgBMV3kRJRBQX6VMCrhPXPpzJAUSz1HLfC8wEDYz0K/O84F8x9oaIfezVih+B89Jnv/WGvVCP20Nci+CAH4w6RLsNIJPZAUfLt44AlNTGJ3h5WpG5raBtVmO8/6MgWrICeiqVzjY= 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=K2MZ+iJn; arc=none smtp.client-ip=209.85.166.169 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="K2MZ+iJn" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3a77980fe3aso1431565ab.0 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=vger.kernel.org; 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=K2MZ+iJndRFX05a5zRFim9M4zrplqvZS2TK1lgpy05mEXtMav+hZrnkK5osr2kRlhi K2yiP0whlO/JzKBbQplaVBBrbMJ/XpAXvjkl0dtdiA5qIjmEp8ItZFXkOtM+C0YYj+HM 2Oq5soZm5SJYzPJ9joz7D5req07bNT1Y2+krM= 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=qu7q3W4oP87wbbGizH11nZtBV7y6yoetGnkeKDL2aNOO8VOVhE5j2/wwtpoSMhqgOG uCOtyyk8t7TpC/+kdlXoceMG8yBy0VI2+iy9IX2kVTUJNmSGZKuNRUzZGIUnIuhQl74o rXbEmu272bZWkBtB5ion7KDGr5Rd2w2RMoUdWam2voxpVsU3d7d3M/z5ePZ4E6stdoe5 pAtydBAiBqZv/IQnHi1BZEymESPBaJT3/8JuJTezREWTxTeS+NtwqsgpqKBgyDoa2G1T 5FBWEde1I4mXdHUyKLdW3VQtBoxLGwRWa501GKzQap1DeR8O/eSKh4KGHF/e32+WkpgX ldyw== X-Forwarded-Encrypted: i=1; AJvYcCVb4Xo42qKbutKc+VBMR2/Hyg4mrjycgDaK28HSxgiaJXRKO3PqcLCH7AeiKwRCXkqJ7MkRieUHdJl3POs=@vger.kernel.org X-Gm-Message-State: AOJu0YzU1jMwDv4xB7AByuDfqVgZoM/uBQTHxlovfWjGsI5YKbALYL1P XXhax8ICwA6tKNw+/CR7ZnF21G84LGkzjL+gqxC5a5Tps5JIDp3nupt30Yemy2I= X-Gm-Gg: ASbGncvaxTDBB9TVwxp3SXAHYAqOnaSoDO6BBsoOLsbtnXacvc7IxXmKrtBuqZOOqfB wTZQjtunsWu6Z2KyWTeRNg/fz4NP+BMv5NIEC/Eaiwm9J8bWatFGUeHJ+JQqXqrkfQjR3D6ox29 EEz4qz2/tdKV6vVWx+kOjDYd6NpIOy8tumhqTPfokMm1bb9RnUAyEG49xnSPxyEBWqLTB2E2y23 KSXAQQCPNtk5dd5JU7WVkEdFzA4KQFJMps0yYpoDGQTBNs6IPB+9YKeWZsY0g== 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@vger.kernel.org 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