From patchwork Thu Jul 6 13:23:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 116707 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2559256vqx; Thu, 6 Jul 2023 06:25:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSIHvrfz+DWSn9EdVuBw/ZWMH8pHQcQpZgbdLELabYIg+SiYlIMLKRxBd1CoCunqam/esW X-Received: by 2002:a05:6a00:1a12:b0:676:ad06:29d7 with SMTP id g18-20020a056a001a1200b00676ad0629d7mr2441633pfv.15.1688649945180; Thu, 06 Jul 2023 06:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688649945; cv=none; d=google.com; s=arc-20160816; b=Bxx7RvpBtwsTMK9qPuydzTjLVU0quJWJgHFmmwd7m2DW/WOu7nggG0c25ZY4HpKbMv PbSK6ABj+BDTWZRzbKnpjWqemry6akkjrwW/8NQ1WclUNNKClL5/lPMGdybx9+NvdwvS LUyOo80m4ERcLPrg20oItgOmeyzNsvr4ApGNoPsr42TRVDqlqTQn7p1dgCkLKOuG7X3R soFOAMFq5LMSjxUQIpgu0b3CucjC/OxzrPTw0booG5jCvAyBZcDVY2vJrL9hUrj2VPUW SYljx6rt+waMBN2uxqv/liRt3MjvEHDxJmjXDyFlPmOg31KWPMtpnIBdvL/rny4R72Z3 CtDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6TDtptIkENs/tayg9WHiP7fNFieO7oHOt3lCGHjPhK8=; fh=QKur2PFwoLuCt27JzfZM4LabS9ldoGoSAJNPH9t/KWI=; b=EGOO7l2p9JIhu2EojMaJrRh5c9M/eoI5EXKmZUelzF8KgFBm8VhZN3rsOTqeAU3rLi +jK5dkknyLGUD3o3xwpibnaah9lUp1KPpMFxJWW6WnorjKrw/DUhi1ixrglWv/N++/Gu a+OFawG/W9QJPt0LORYDuiHS3nwtkJrDj13lm6zH9ZX3w+X6UdbpX2+yEusZQh6PEnQ8 yg0XusQQf5uG4clmiDegYgBHpksHfqXr+OqD7RduHIkxItZV7OlAdF8wsAFmbIBxzKkV gYctpbwgkupzWSpjASCATXGRp+i/Qkb5E2V07j44EZ1l5jTiCt3ZGKxOo1c5kcFqm8hW sbpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=ZAoK9O9B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x37-20020a056a0018a500b006687ed7b4a5si1516027pfh.140.2023.07.06.06.25.30; Thu, 06 Jul 2023 06:25:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=ZAoK9O9B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232555AbjGFNYa (ORCPT + 99 others); Thu, 6 Jul 2023 09:24:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232469AbjGFNYB (ORCPT ); Thu, 6 Jul 2023 09:24:01 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DAA1BF9; Thu, 6 Jul 2023 06:23:57 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2b708e49059so5879961fa.3; Thu, 06 Jul 2023 06:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1688649836; x=1691241836; 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=6TDtptIkENs/tayg9WHiP7fNFieO7oHOt3lCGHjPhK8=; b=ZAoK9O9BsmPWDXZjxjcM8oa0QntCJDAE7guqGhxXlzF+kt3m+4JohijYM3ygC12aGe d9mBu5JTrg/vscq5p463NvtcB0ft8ZikB4ziomPVVNbk801szMlGrWwLtuZ6u+McO5JP kE8kWqvzVJALFxdkZ99/9VkntGl45qvuhIJqPzfpfWIhpt1fefccAqFJEiwj3hw82fsi H1fZHOWCRvrpXjdHtK9vBY6PLxLiLVWeSb9ggwGCjMW9EyJI0BjtZ6YgESVKHNkoHNgb ijR1dSBMJGnE6YXGR5xdCrRJxTMzH+lOvRImwMTxr4Gdj681Hszgctt4jbrwzivx1jvh 3UqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688649836; x=1691241836; 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=6TDtptIkENs/tayg9WHiP7fNFieO7oHOt3lCGHjPhK8=; b=GPShHcwlPzhG3cDL4BPUAoj6MI0m95NBgEeE7R00+fsDxUbTmJyjUpTptQyyOUPem7 /++YAOE0neJ3h6Q05B0OPZBPndegF6+XTJkkq/iCm5NFxuxTI0HB52LpHlBDul17pDjq /uk1Pwib/1O65DluUX6UgFoYZlHOACF42msmCiL9P4ngrMEinRImCioY7mIuMaGRImvw lNv5t8+TJ8lOMFV/b6RCcHnrbhgHB5WGQA6DWfxxiP9Z0i8EuYUfpBFPJjuMiAWaghyX Aw0O54/n6nTURP2a9n8fEazgYa5ZrUjeJU2jqnAKnMpWxy10Z7o6WwPnSHOQN+PcvETU ZixA== X-Gm-Message-State: ABy/qLZGF5p6FuIiQRN8ZEvmvCj5QKETo5WCLiFS+WuIO0B9ICWn1HfE vbXICZI0R4EGW1Co+yO5hAtL9g3Sk2eBlFyI X-Received: by 2002:a2e:7a16:0:b0:2b5:7a87:a85a with SMTP id v22-20020a2e7a16000000b002b57a87a85amr1351695ljc.13.1688649835875; Thu, 06 Jul 2023 06:23:55 -0700 (PDT) Received: from debian_development.DebianHome (dynamic-077-008-088-179.77.8.pool.telefonica.de. [77.8.88.179]) by smtp.gmail.com with ESMTPSA id r2-20020a170906364200b00988dbbd1f7esm808024ejb.213.2023.07.06.06.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 06:23:55 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Cc: Paul Moore , Stephen Smalley , Eric Paris , linux-kernel@vger.kernel.org Subject: [RFC PATCH 13/20] selinux: selinuxfs: avoid implicit conversions Date: Thu, 6 Jul 2023 15:23:28 +0200 Message-Id: <20230706132337.15924-13-cgzones@googlemail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230706132337.15924-1-cgzones@googlemail.com> References: <20230706132337.15924-1-cgzones@googlemail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770677804925393678?= X-GMAIL-MSGID: =?utf-8?q?1770677804925393678?= Use umode_t as parameter type for sel_make_inode(), which assigns the value to the member i_mode of struct inode. Use identical type for loop iterator. Signed-off-by: Christian Göttsche --- security/selinux/selinuxfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 16036633ddd3..c3ac0468f698 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -97,10 +97,9 @@ static int selinux_fs_info_create(struct super_block *sb) static void selinux_fs_info_free(struct super_block *sb) { struct selinux_fs_info *fsi = sb->s_fs_info; - int i; if (fsi) { - for (i = 0; i < fsi->bool_num; i++) + for (unsigned int i = 0; i < fsi->bool_num; i++) kfree(fsi->bool_pending_names[i]); kfree(fsi->bool_pending_names); kfree(fsi->bool_pending_values); @@ -1191,7 +1190,7 @@ static ssize_t sel_write_member(struct file *file, char *buf, size_t size) return length; } -static struct inode *sel_make_inode(struct super_block *sb, int mode) +static struct inode *sel_make_inode(struct super_block *sb, umode_t mode) { struct inode *ret = new_inode(sb);