Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp53624lqj; Thu, 11 Apr 2024 09:37:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSujcDRXQ/1JCyZWQiMRVhWdn4ZJgATrIcrdpE2NhJjQT1JVQaKJgAmyLGjdzTYOtl/S8SKyYN6JHOL55e0WOvieJqYMPLLJqWZnd3xw== X-Google-Smtp-Source: AGHT+IFyXFc+yYY+KJMDDuwgfxSGK487KjPPS8klZZR9P++NWIe2oJL3YRVPGO+44Y2xrIzG/pGM X-Received: by 2002:a05:6a21:33a5:b0:1a9:11e6:8e03 with SMTP id yy37-20020a056a2133a500b001a911e68e03mr381795pzb.40.1712853454016; Thu, 11 Apr 2024 09:37:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712853454; cv=pass; d=google.com; s=arc-20160816; b=TmSAurzJzFo/p2+tsuE72zVnpYQb+LwDjylmLfl4X/4wh5MfE+oZ/hBIQyKKxeWKNI K3Gm10X3bbIAR0gHIIchcZZdEOtwtmVJKPSb0oKiHyEh3c0ESuP8srB1vOZEPPNfkBsH pmvWvEkrnfpn/EZr6531uQ1w2FFQLvaenSwyDxeXgRbAbF56qWVgVXlu+0BqKDPcFBrc SlZUVJDcaEOJQswGmjU5QcIIR7BSUNjLJ0kVi92JPIUJ4P13OeW2A9oS1JwKFCvspTUP p0gQhsQYZcx3CdFDH+2kR6kYn4HwJFSscOtO+gmMPckLuuxxyJ7j7JlmiQgYBKsZQkFg CRYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TydMiuJzAnVI1Y/DgMFL+Q7ONv6WRnlP2/JlOY38Vuo=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=YPbyrvml6DI/39Ui/jQuxLQ/ZIwQEbA2Py/5AD83yF7m5LQ1v6ZFhS+fxj/gn/hRH1 2ns0fgW22/lt/MW1Y/MvIJmj7aWSv2ctmXLLngmJciR7mzIurxNL5C/+eeEXcBUl5Qws wlpQeMp2R0b3k2ubrQjj+hEJtplXyGltwmI92E5v+5K5cWuauN25GVsz7ibdP0JiRIdo wdp973MhGTDi11M7pJrpjpEkNvfJmfkY8c8GCBToCOceLD7fwfTVEWQ9AeFl3baFTg59 v/h+XUW2rtoszi+db69VeLTdwnj5CKDPqg9v94GlP1mcBfnTLvpOgnxd/9dleJJbfKwy ncnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=KEvoLLQP; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-140853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140853-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 20-20020a630114000000b005cee9117ef6si1512096pgb.810.2024.04.11.09.37.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:37:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=KEvoLLQP; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-140853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140853-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B614EB26F57 for ; Thu, 11 Apr 2024 15:59:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49FDB137C2D; Thu, 11 Apr 2024 15:34:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="KEvoLLQP" Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 27230137904 for ; Thu, 11 Apr 2024 15:34:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849659; cv=none; b=AGpirpwT5Aolzfzlvim4dk1lXdrIuFDsBt8H6dQEQL7WzwBilXFtsbthWSleLhhvsgCM+K6MeZ94QdfHowoFZNhyba+qCbSEMHKxUkKP6J00aCbm0Ez16HaAHHfsuzn6KniULKhVnia4p4ZQ3C7Z54vQAtyT5J0kXQhQ3+uI2y0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849659; c=relaxed/simple; bh=AP5RPz/E+pwYxNd2wwmdiHkuvAntphTgRIqwFpCJcS4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LbS6lG0oJRDPopJJVFMYl44H0k2y4PTpkDFa+Kt/Hq+wmzWm76ZOHNXKyUpwA6YDf8IEgQ1r8waEaROpyN3jbG6E5t7dD5X+VjRTax6vb7H4g6FFZPj18CNjMaOOflqwXAgGBb7/72ifbdF49gRGLUcotQw5RoRX3SlSlcEwPSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=KEvoLLQP; arc=none smtp.client-ip=209.85.166.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7d5ed700c2dso16136639f.0 for ; Thu, 11 Apr 2024 08:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712849657; x=1713454457; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TydMiuJzAnVI1Y/DgMFL+Q7ONv6WRnlP2/JlOY38Vuo=; b=KEvoLLQP3bfZyLmR7lh4490FtwqRVjd/ThtpS93FTyhpQzCInN8R9FLnM7XsTcHJjh QN6XliBOwu/4mDN6WQt0evBvBy4yZ3RWvLS7u6HLxyVAYAAYybr99uun/tFvVE1qs1tN ltlOVDlbfa7dnx4esq8Efg0WqwC+JGsz9iNXmIGqWdxmTVFiX5iLBep1r+6zItwawHEL CGbISC/oFWEh42z2Dka4QD9UHWA80q5hhkON58wXv47waz8US8q7VzhG8lu/Pkgnc5kM Ifi2TUAiJe8IhXlo8d7DRv2Jb+JWj49QwdDhmdQYkSIOZbTm2y+PYa0ITX3iTdbtUHwf jIaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712849657; x=1713454457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TydMiuJzAnVI1Y/DgMFL+Q7ONv6WRnlP2/JlOY38Vuo=; b=H22GH18rGekkZpnqfKm4JDAljHvKArd5hNjvQlK6fW8arNWkHfPvfivOATwgUcyhC1 CMJk6xj0wEc6VVYp+EmXsHWMNfWSg8wVzK+FIjavX9QrbQFVKFbqzEauAbPUJfWfb02u wGFLWfke2+kN/a22CaBItJRW1VModuplIyPHHapZYpyLH8pP7pcPuJ0FrYS4NhviGmWQ xtRun/2OVo6C/XC9sjZSgHVWaOPfIXf9dH3GBW5cepnx5OunBOOnTa4Tsn1NT7LPD668 RW7lYpvlO+htAbjB04tldeB3anGRsdeV+khXGnZDggKuiCkynz+7ALHNtTT1ULQv0Fbm wdXg== X-Gm-Message-State: AOJu0YwXuPcA2hcqFEjsjZqX2pndNlfc8gNPod1RqBp1OHJ68wcjJohA 3mkL+kj2fg+wy1r7AHHDjIqrW5gp9dTorFa7Mfrpu5cNgUpLgsHVso0QRIQaO04hW9QHQq/UVHK c X-Received: by 2002:a92:60b:0:b0:369:f53b:6c2 with SMTP id x11-20020a92060b000000b00369f53b06c2mr5337304ilg.1.1712849657076; Thu, 11 Apr 2024 08:34:17 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:34:15 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 091/437] lsm: convert to read/write iterators Date: Thu, 11 Apr 2024 09:13:51 -0600 Message-ID: <20240411153126.16201-92-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411153126.16201-1-axboe@kernel.dk> References: <20240411153126.16201-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Jens Axboe --- security/safesetid/securityfs.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/security/safesetid/securityfs.c b/security/safesetid/securityfs.c index 25310468bcdd..82e1e9c37db2 100644 --- a/security/safesetid/securityfs.c +++ b/security/safesetid/securityfs.c @@ -245,6 +245,7 @@ static ssize_t safesetid_uid_file_write(struct file *file, return handle_policy_update(file, buf, len, UID); } +FOPS_WRITE_ITER_HELPER(safesetid_uid_file_write); static ssize_t safesetid_gid_file_write(struct file *file, const char __user *buf, @@ -259,6 +260,7 @@ static ssize_t safesetid_gid_file_write(struct file *file, return handle_policy_update(file, buf, len, GID); } +FOPS_WRITE_ITER_HELPER(safesetid_gid_file_write); static ssize_t safesetid_file_read(struct file *file, char __user *buf, size_t len, loff_t *ppos, struct mutex *policy_update_lock, struct __rcu setid_ruleset* ruleset) @@ -285,6 +287,7 @@ static ssize_t safesetid_uid_file_read(struct file *file, char __user *buf, return safesetid_file_read(file, buf, len, ppos, &uid_policy_update_lock, safesetid_setuid_rules); } +FOPS_READ_ITER_HELPER(safesetid_uid_file_read); static ssize_t safesetid_gid_file_read(struct file *file, char __user *buf, size_t len, loff_t *ppos) @@ -292,17 +295,16 @@ static ssize_t safesetid_gid_file_read(struct file *file, char __user *buf, return safesetid_file_read(file, buf, len, ppos, &gid_policy_update_lock, safesetid_setgid_rules); } - - +FOPS_READ_ITER_HELPER(safesetid_gid_file_read); static const struct file_operations safesetid_uid_file_fops = { - .read = safesetid_uid_file_read, - .write = safesetid_uid_file_write, + .read_iter = safesetid_uid_file_read_iter, + .write_iter = safesetid_uid_file_write_iter, }; static const struct file_operations safesetid_gid_file_fops = { - .read = safesetid_gid_file_read, - .write = safesetid_gid_file_write, + .read_iter = safesetid_gid_file_read_iter, + .write_iter = safesetid_gid_file_write_iter, }; static int __init safesetid_init_securityfs(void) -- 2.43.0