Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp644600pxu; Tue, 6 Oct 2020 15:40:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxol3jmbQw4dRFnHBFQ/E63GQ86cQGQuTfEXIKb5IX0ApcTy3iUuDJCVoLvqSHhvrdo317W X-Received: by 2002:a17:906:8545:: with SMTP id h5mr280230ejy.384.1602024024924; Tue, 06 Oct 2020 15:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602024024; cv=none; d=google.com; s=arc-20160816; b=kYKsLTDkFeIZfisL9KJYgLf/YLqCmtS1MFTVHAFdW0nLq6Ip4Le1YFKqnrNzGYD+wZ OM/RzVqoc0DDqB/PZEuizZLjFl6578SANO7fq1lT05B+EJ+qfMo1TL29w23qOFpo9bTX 5TU4jo7wpMxjiSysNPg3MRSWH09+1nsJZWoeJf11qz05PQ+lNXJnlLKLZXoB6f3hQQy7 A+2Ltf155Od0SDST8Z6pmuTnUmBgtas/njkHf1x3W0yFqYQMQWEiPT8400Kakn6sFfHc gUfFDynnBIZ+VMOBZiriJUJcDrmDwJ7OkryfARqhl8yPRTk4dvv5WClQcjwoJvk90z2O iZLw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=C9Kgi1FQskOa5rSl0SoHJY6w4fOZRjsIxfeDIa/Yl5g=; b=yuqylq93yrSzpEtOwa7TxIMrGpHsyzvX1nUcLXOvOF/oBMIwvNmYVMmQhrwe5wgD5d 9UNi1WesNdKm8lwMxyzbNkY3F/RW406LfONJwgwxpCbVRV2r5z0vdaxLDu/A7dQ65gcq /mb2mmosBl72udmbxfY9xlA/Jk9K+0Ej5SIOoY5O07Bo28cQrKzNnJyLq72TFm5X98hi 4SFwgnN/jtJhPfly0C24pMv3nLEZwT1ZFiB9O5pTJ74D9RES2iT/0okDjjmFtsGE3uUJ kIuAveHmDoHlnDC9Ric9UmHiSx6Ta4axXb0XHJh6WP/gARoHQWSpcxzxKFmoe0kuaTo8 NtZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bngJdOed; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rk25si103766ejb.310.2020.10.06.15.39.27; Tue, 06 Oct 2020 15:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bngJdOed; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbgJFULb (ORCPT + 99 others); Tue, 6 Oct 2020 16:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbgJFULb (ORCPT ); Tue, 6 Oct 2020 16:11:31 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CC2C061755 for ; Tue, 6 Oct 2020 13:11:31 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a1so2157598pjd.1 for ; Tue, 06 Oct 2020 13:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C9Kgi1FQskOa5rSl0SoHJY6w4fOZRjsIxfeDIa/Yl5g=; b=bngJdOednPPuqfXzuTJ3Dna0ddWYu8EHGAsghPWNLqJ86xkIxlVYD3DaouvgHlvfr1 tsbrpAorqyu87ogKgW7Kzqb20vTlFInPzWyEde1ZEN3f73TuSOgtc3TiI3BrvhbpOTip qsQQ3OcXdR1wmhVUyWYbqAWOu9INTKEK7EdaU6G4trqmG7SwMjrb8yIu+F3PK8n26F01 3kLgcXPtzfSQpb8HCdi7h0JgfRs8xUHSQ8myifYJ5K8Yp0iY8j0qOldzO9qa+eKj0vCe NfXCRjiDklhO2TGhN1UQLb64yfHgFSoTUAJtc8WLmhZayGufgO3I5sHK+Mw30JNry16E zh8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C9Kgi1FQskOa5rSl0SoHJY6w4fOZRjsIxfeDIa/Yl5g=; b=F9OfvDCJ+7Ggt9sStWocur+alO0p9l/151ckixavkKxsB0y98eGkdISzbkX5xujqrX cDVNbHS0WwrI1aFFEJ9pdCq/aIeZb9nqzTOkg7ajSQV415xIMSMPYVNLMxjf/csGdoF/ u12x81fy98V9qkqeH1NUuFpxexqcVwmSKBuUUr0ylWzTJlS0GN5w7HeH8DeI3ozogNK0 36hKQyHFdpEVCHtoY3cvzpe9M+HhsP8dwEGSt/757dsZOY8eM2jntqP6sD+3XHPrRHKy 4vBQSwkGaINfhgR0DWZ9/ATxzjKO2FcDnFeeNcFQlYgenCgbSOP3J2duayzDtR8mYwB2 ugmQ== X-Gm-Message-State: AOAM532LFVtg+AoVLrbpbCif7/fLwWqIEl/U+2pVIJxYpgcN2EFKcvLP XQkfkzVAuuA2YLxJPQi3z/E= X-Received: by 2002:a17:902:7896:b029:d3:7768:1eb with SMTP id q22-20020a1709027896b02900d3776801ebmr4632386pll.17.1602015090360; Tue, 06 Oct 2020 13:11:30 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:45e1:2200::1]) by smtp.gmail.com with ESMTPSA id e27sm13504pfj.62.2020.10.06.13.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 13:11:29 -0700 (PDT) From: Nathan Chancellor To: Greg Kroah-Hartman , Kees Cook Cc: James Morris , KP Singh , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] LSM: Fix type of id parameter in kernel_post_load_data prototype Date: Tue, 6 Oct 2020 13:11:15 -0700 Message-Id: <20201006201115.716550-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.29.0.rc0 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: security/security.c:1716:59: warning: implicit conversion from enumeration type 'enum kernel_load_data_id' to different enumeration type 'enum kernel_read_file_id' [-Wenum-conversion] ret = call_int_hook(kernel_post_load_data, 0, buf, size, id, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ security/security.c:715:22: note: expanded from macro 'call_int_hook' RC = P->hook.FUNC(__VA_ARGS__); \ ~ ^~~~~~~~~~~ 1 warning generated. There is a mismatch between the id parameter type in security_kernel_post_load_data and the function pointer prototype that is created by the LSM_HOOK macro in the security_list_options union. Fix the type in the LSM_HOOK macro as 'enum kernel_load_data_id' is what is expected. Fixes: b64fcae74b6d ("LSM: Introduce kernel_post_load_data() hook") Link: https://github.com/ClangBuiltLinux/linux/issues/1172 Signed-off-by: Nathan Chancellor --- include/linux/lsm_hook_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h index d67cb3502310..32a940117e7a 100644 --- a/include/linux/lsm_hook_defs.h +++ b/include/linux/lsm_hook_defs.h @@ -186,7 +186,7 @@ LSM_HOOK(int, 0, kernel_create_files_as, struct cred *new, struct inode *inode) LSM_HOOK(int, 0, kernel_module_request, char *kmod_name) LSM_HOOK(int, 0, kernel_load_data, enum kernel_load_data_id id, bool contents) LSM_HOOK(int, 0, kernel_post_load_data, char *buf, loff_t size, - enum kernel_read_file_id id, char *description) + enum kernel_load_data_id id, char *description) LSM_HOOK(int, 0, kernel_read_file, struct file *file, enum kernel_read_file_id id, bool contents) LSM_HOOK(int, 0, kernel_post_read_file, struct file *file, char *buf, base-commit: dba8648dcab90564b8a11c952c06a9e1153506fb -- 2.29.0.rc0