From patchwork Tue Oct 31 12:32:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 160103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp201965vqg; Tue, 31 Oct 2023 05:34:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2gRyfAilQT5IZETv5wOgC7FEjo5h4LTvmvGrVxUDT3my0NUA0tvvVvebteDx0rEjtvxNn X-Received: by 2002:a05:6a00:853:b0:6bb:6d30:fc4e with SMTP id q19-20020a056a00085300b006bb6d30fc4emr14409682pfk.17.1698755642604; Tue, 31 Oct 2023 05:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698755642; cv=none; d=google.com; s=arc-20160816; b=mlbwmlzOisrxf0dv/VAmxWFJh0Dqk9FJQhku07IfpoYc3dDoEnMvO2gNGiB5JV+kUf tqUkrvJrb459P2afzlJeAE547KO3Bx30PCfI0bpDvDK72wTTUZn+XN61J9rL3Sm5kwbr QaeaWkcd1NYutODga4EseJN0aJraSjD6lfgkpGQDswRl36jjQk4k4hM5vzpMh1Lkg1tX +hp9K8d43PypNsRrETKnBhzZSR/e3ynuhoTE3AktGtvMTK6ggFRnHGXMPRssSdG8KHBr MZasKR4/JyGd3w+mADRBfNh07x+LXjxLZ7apkUNQTAqeVnetrJxacY3JO5FmbenW5Vhv TgKQ== 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=01Cuhkq/fZzHdIhk7dn370LtT6qVzQS52GEFoCa52Y8=; fh=3AN7ORKc66AQYSTl23VmdYm3vXIU7gdmsvq6+mhfy+0=; b=TnTMYfp30VtTG0fMWQecbZpCQDgJnST1IUbb/FNcHlEeknj7Di8XyXIHMpW1IudmWi xDUNjVwOiYqReZnC/jvmghtD8ucLeTltxcYcbETb87LQfL6Iv8bYE9aVOG75zYn98FKv ur+ZshS+qZgODf3Qv8hSavFGLMuYq1sjNVPBwzgmx+xz4GM8J9B+LrcT84zGnQ33cIBS qMlJF36JC2tF7WTGS+brEobITU4yXlpq6qOg6laovgIK3ZQzZQQiJC0yajW6e0evojDx mMIF38zNDZzDlQGfdNcb+3Z1A6/gEqZLfxAShOyd4ydUF3ol1N5pnRhfhDVrArWDnzru M4sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g9EDNq0p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id c8-20020a056a00248800b006be30258e4asi959731pfv.307.2023.10.31.05.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 05:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g9EDNq0p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3DE89802C910; Tue, 31 Oct 2023 05:33:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344275AbjJaMdn (ORCPT + 33 others); Tue, 31 Oct 2023 08:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344263AbjJaMdm (ORCPT ); Tue, 31 Oct 2023 08:33:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAD81102 for ; Tue, 31 Oct 2023 05:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698755544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=01Cuhkq/fZzHdIhk7dn370LtT6qVzQS52GEFoCa52Y8=; b=g9EDNq0p5I6e4STfF/hfFVyVnMBLOA3/PAJgABTuK1bo98rQuEclcYgr0N1qMZA8WBq+lp bX4jEtosG2+Knvm+U3g19kvMOgkVzZ95yjsKwoOjmAPdobw3rYHxpawsfC7/wGlu2y+DsA gXjGDPtruBIFq5+CvNbVLsl2fkFsSlg= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-347-GPbkU0mVPGquLN_4LYkHGA-1; Tue, 31 Oct 2023 08:32:12 -0400 X-MC-Unique: GPbkU0mVPGquLN_4LYkHGA-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7788fa5f1b0so686956785a.2 for ; Tue, 31 Oct 2023 05:32:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698755532; x=1699360332; 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=01Cuhkq/fZzHdIhk7dn370LtT6qVzQS52GEFoCa52Y8=; b=Oaige/1IuMnZSwoK3/8Mp0TP4coZ5syerq9DjXnaYHa8VhqUe43lCILq6pUF4/DEV+ hVylOES7mxxGLb9/x9b1IbfpD5qXBVr1wpGZCXRp6DbchVv/us+NDcNrZup4+mIVaHFe PWcOfSp5KrRerdGKuWaVJVP7J+yGW+lpgAEy3LaKW9ybk5j/FtDZuAQLdP+qloBk4Jq2 fOnEr4SD8t/A5E2UBhz37/pd2ycYE6dcOxNH5D+1zhxHlB9+xy2QExwCYvr8J+x6QUxP 4vxu3Q3K8/kIpe6elkmtGnJE4i5/PZI1E+jJDwrCE/ks/BQ31WbqvjArj7tk0HO9uwea aOMA== X-Gm-Message-State: AOJu0YzXU1CIpyhwqF2cGsBAAlDjQp8942RuZGWAqsBQQxM1rHGVry8J UfwZEGsw0UMPcsmNMDF4wshplFEkHrselHbtzH9dfA8uPF8kzJDVa2pzSTy6Zu8Y2h+GKDJ+Ba1 GbszX4hYEmNh+rvKVNy5DHamaMMEhwtG8 X-Received: by 2002:a05:620a:4109:b0:775:681d:dc06 with SMTP id j9-20020a05620a410900b00775681ddc06mr15146858qko.63.1698755532027; Tue, 31 Oct 2023 05:32:12 -0700 (PDT) X-Received: by 2002:a05:620a:4109:b0:775:681d:dc06 with SMTP id j9-20020a05620a410900b00775681ddc06mr15146835qko.63.1698755531737; Tue, 31 Oct 2023 05:32:11 -0700 (PDT) Received: from localhost.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g23-20020a05620a13d700b00777063b89casm457697qkl.5.2023.10.31.05.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 05:32:11 -0700 (PDT) From: Ondrej Mosnacek To: Paul Moore Cc: linux-security-module@vger.kernel.org, Benjamin Coddington , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] lsm: fix default return value for vm_enough_memory Date: Tue, 31 Oct 2023 13:32:06 +0100 Message-ID: <20231031123207.758655-2-omosnace@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231031123207.758655-1-omosnace@redhat.com> References: <20231031123207.758655-1-omosnace@redhat.com> MIME-Version: 1.0 X-Spam-Status: No, score=0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 31 Oct 2023 05:33:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781274396690213422 X-GMAIL-MSGID: 1781274396690213422 1 is the return value that implements a "no-op" hook, not 0. Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks") Signed-off-by: Ondrej Mosnacek --- 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 99b8176c3738d..4dd55fdfec267 100644 --- a/include/linux/lsm_hook_defs.h +++ b/include/linux/lsm_hook_defs.h @@ -48,7 +48,7 @@ LSM_HOOK(int, 0, quota_on, struct dentry *dentry) LSM_HOOK(int, 0, syslog, int type) LSM_HOOK(int, 0, settime, const struct timespec64 *ts, const struct timezone *tz) -LSM_HOOK(int, 0, vm_enough_memory, struct mm_struct *mm, long pages) +LSM_HOOK(int, 1, vm_enough_memory, struct mm_struct *mm, long pages) LSM_HOOK(int, 0, bprm_creds_for_exec, struct linux_binprm *bprm) LSM_HOOK(int, 0, bprm_creds_from_file, struct linux_binprm *bprm, const struct file *file) LSM_HOOK(int, 0, bprm_check_security, struct linux_binprm *bprm)