Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp957324lql; Tue, 12 Mar 2024 03:16:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmaD6htFopRdq+ONavHIKSGo8kslqL4Lo0ZhhUG1tPxWPUEiFLbEk2oiZ+b36dM+AdSNfD+VbfwpvwV8BY1TUox7ka/dPwHB+9yWsbfg== X-Google-Smtp-Source: AGHT+IHdMhpKOme2mX/krQ0ciNFNDWYuy8g8vxD8D7wiN4wVWy6GR0lThartHjwgBdYyVNx2LsGr X-Received: by 2002:a05:6830:1193:b0:6e4:dc62:4639 with SMTP id u19-20020a056830119300b006e4dc624639mr9328695otq.23.1710238610262; Tue, 12 Mar 2024 03:16:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710238610; cv=pass; d=google.com; s=arc-20160816; b=Wa4XL/X8/OQWvwYDq3namoqS/A7B1dNzZ98qgl3kPovx2JrQuDIdtLPgww57XjHSqd ZJQoeqTDT7Tb6HGUaulyO9zgkxM7s1D/wYX1otew9BvAtzKcOmB0bT3bZlXcGU2ATTfE Yfqz/7tiJS9vrbA177tx1HqLmmtPEDbXMtrJ4LXq/dUZpT/D9n9PtgFWwoiIT8vAy9Ev Xie4CUF2E9w1ciKv2Q2z6x92BNd6tooqE+BIF2KYZcXpKPIvBPaQ+tOTyOrzU8aNls3R nEw/NWm4Qr+vzSgx79lj3D8//gIT9yUjpOGO/NByWky3fhqJUYDMntJ+6vldP3NQPKs/ Le3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=7y/H/HIsIFiYNltUYEfOm9hpUvI6ACr/C0+IdA066dA=; fh=SEF9KW4A6fz277xV65sCNcQosP9PiQXpNReEYVoLQIE=; b=dom0YQUEFe931TtuhCUsVl9ff5pWpRPHTDQTHqfZqP/BxbwY69BY+3FUlUlYLxBrXv 7PuANSjKLbB4R/NdDQEdOKKe2PLTrAkYftxUcuzI8JbkVg2KXqmafjeiPcnzYPB6trcE wmfOC8YgHoltaFS1kwv6WjeZYdLr9ufwXLPB4tJacxtHCIyZ4T+BfqlrQoq7q+VSB4l6 5WsTI2hveEssWgp0RliEkpP9s5aslFDn8RNom5zvCk1WxRptczZZ02Ao1Kkj7mpjqCid UBW3VWc49Uq2sbGeAweOTafED/QjEohBgNQouoQP6H8u8S2giQKzyTD0iXxyCuLcFCB8 NKEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-kernel+bounces-100097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100097-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wi17-20020a05620a571100b007882ad62398si7157247qkn.346.2024.03.12.03.16.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 03:16:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-kernel+bounces-100097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100097-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F3A691C222D1 for ; Tue, 12 Mar 2024 10:16:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 706E17866D; Tue, 12 Mar 2024 10:16:42 +0000 (UTC) Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7086F33994; Tue, 12 Mar 2024 10:16:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710238601; cv=none; b=RBBtTWVBPmBmMaSzOCxXPDFk4JI1go7oyFHl7LriGg4R6YRrYaDM+uUwtGNAZTxrJdnNHr5TjgaF2pSEtvztp5vRILCXI41LolHotYFXZZYlvZQNMn5noVjKrZj1pWhbEgYP0ibOZnPPMhO8oaqGrQ6LGSipLPYSNnmS9ESTDHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710238601; c=relaxed/simple; bh=V8fgbGcwYwbcwGV97uvR0GW9obhuumcbfnTf1wMuuKk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cVXVv7GHPTQMOVw2YK1607NQY+fVNq4+1LwM2V2lWcJRSrFYdDnUMYitczXEgi+u999eKsi96JEyNXj6bCk+r/xFzgQ5XZuwhK/F1tP2pWQuNDmYgbh+SGD4f0nCnd4RjzieSHIEPfRXCdu+3HRSjJjJx75NqTI/YHjyxGW3BIk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id D653372C8F5; Tue, 12 Mar 2024 13:16:30 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id C79B87CCB3A; Tue, 12 Mar 2024 12:16:30 +0200 (IST) Date: Tue, 12 Mar 2024 12:16:30 +0200 From: "Dmitry V. Levin" To: Casey Schaufler Cc: paul@paul-moore.com, linux-security-module@vger.kernel.org, jmorris@namei.org, serge@hallyn.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, mic@digikod.net Subject: Re: [PATCH v15 05/11] LSM: Create lsm_list_modules system call Message-ID: <20240312101630.GA903@altlinux.org> References: <20230912205658.3432-1-casey@schaufler-ca.com> <20230912205658.3432-6-casey@schaufler-ca.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912205658.3432-6-casey@schaufler-ca.com> Hi, On Tue, Sep 12, 2023 at 01:56:50PM -0700, Casey Schaufler wrote: [...] > --- a/security/lsm_syscalls.c > +++ b/security/lsm_syscalls.c > @@ -55,3 +55,42 @@ SYSCALL_DEFINE4(lsm_get_self_attr, unsigned int, attr, struct lsm_ctx __user *, > { > return security_getselfattr(attr, ctx, size, flags); > } > + > +/** > + * sys_lsm_list_modules - Return a list of the active security modules > + * @ids: the LSM module ids > + * @size: pointer to size of @ids, updated on return > + * @flags: reserved for future use, must be zero > + * > + * Returns a list of the active LSM ids. On success this function > + * returns the number of @ids array elements. This value may be zero > + * if there are no LSMs active. If @size is insufficient to contain > + * the return data -E2BIG is returned and @size is set to the minimum > + * required size. In all other cases a negative value indicating the > + * error is returned. > + */ > +SYSCALL_DEFINE3(lsm_list_modules, u64 __user *, ids, size_t __user *, size, > + u32, flags) I'm sorry but the size of userspace size_t is different from the kernel one on 32-bit compat architectures. Looks like there has to be a COMPAT_SYSCALL_DEFINE3(lsm_list_modules, ...) now. Other two added lsm syscalls also have this issue. -- ldv