From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 0E52D343D63 for ; Wed, 6 May 2026 23:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778110991; cv=none; b=NRMZB1UYu/nX6N2IuAQwnWZBdkBR9yWxna9iTgmC6BN9aoAzjRnXbTEeoHmIPYciYzgF8HzHW8VILKO0ahQB9icqdBsdy7F38nqTcBj8c1gC/m1jefuLFzs+aHVEdkwSSypNKX2IQSJqd0WYuVgYT9FLVGqaAPY4CDdU0tY68ow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778110991; c=relaxed/simple; bh=ko0FE6HN3JOBBmuOOUgRR1lm2/IqV6g59OTO56IiY6w=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=ilNKZsFcwOpkt8MW2TEIrGtJcDa1I+LYo4228tRC6RBqYt7myd1qvWnSToo2TSgBksArDFbCVR+EoL+PGNN+JPbap1OoMZ+RxaEzpW97VawJBRw9f+wi6DzHdWM6N7eeDHJ4d5Uz8B092nm8xMToy4Wvtu+tJx3UAyH27EMVrCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=TlntH8Ue; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="TlntH8Ue" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-8b701756684so14806656d6.1 for ; Wed, 06 May 2026 16:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1778110989; x=1778715789; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=1Vx1BzAfJicIj4c2bHfx83kwqOK78RnIoPZQfJ0g0KI=; b=TlntH8Ue5R0J0sxOkIbXY0zg2ijgwV4wDQjK4g9JZAFRNrYxxN3rajCnLK53jQD6SI LarPvtNhnhV7Wu/DroSsmKeSvQdLyNDL+UIkUYrzas0+eHDgHqByELvXRuNB1d6nuh8I 6sp+BGEBmJPPawyo5jAJ1xGXAbENbxu3P0W2zTMBhvDl/weMasdC7W86syNY4VQ1ajoh dmyQsHH6RcBtYgWT7l3IcqJ+2bTGx8uh+5LxTUjgLbZ1rj/El6uRUZPYMQy/1YP/zh7F yjlleAg8CBmd9A+HgoQJp7nN0+mlZA6Wzlsk0x2C4aHXGH/0up30/vTokwd7Eu0esgEV Imeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778110989; x=1778715789; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Vx1BzAfJicIj4c2bHfx83kwqOK78RnIoPZQfJ0g0KI=; b=Jxob69nNEzFLtL8zrYzEs9j2gXrw7YdlO47rrfnsRa57Uh928lwSQY462OvMCzTAMd gnAQHFG/9VrHoOt+uCBT+snv2gSUbaSi8T/EqAlV4bXmiPfXoArB8U1R53iyO7cSBXQv OO/Q/oL7BUVitlhQywjbKWhZyvAxdtZjSWzYsgNzFCGmJQxseksJPwZZLvaaVKKzTRIe 7wDRV71upOX0FAAp+kFgG+e5U2bSBBGqXKNT3/DGIzxy5IaTbLFfXV4wD5jJBXttpMW1 k1b+DqMx1t4lNEL7xDHmVP45ON4BYD/ZWc/eMGwuxFejPpjPj2NNUlwMOLGvOrVWLkYW EWkA== X-Forwarded-Encrypted: i=1; AFNElJ9Ppemxsr6uhNqxhgl0LJ1Pd4VN+6ePQ4TLp2xdZTUcckvJmiARIZwYd0ObpGCNq7qbbiFM1nQe2VXScAA=@vger.kernel.org X-Gm-Message-State: AOJu0YxKeCajSVjRKUtYOv3jfXE0XL7tSbkaEm9Q6xhE0k/uLo47s7em g9a0mlmbDsBXkFgAxEuYeoZAhdo/1dNeCfA9X4+xXeh/OxgWhE3DXFsEtD/nIrRvXg== X-Gm-Gg: AeBDieuSBXla64QFaVwwHkFmq8E22U6hAkIfCBUYzibShAOqr5OD+jGZ1Vfw3xj2el2 JU9kYkkWMQLjSPi10RpIS+pqzLjUz2YKR7TOPH1ZXnFDJwwzq/SU4VXz9WYussCcUk95IAx81Kv 8gDDM87EYNQKekM7QvQhNeiIP8CcqAuAtLQ1mrNLhZUqvxXpMcDyWOv5MpVX7fiWqB9HeCtBCZM 6K0PFAsQzfPUds8kU7IhSqzvxr05ac6NkJ/Y5dRbSOz2Bd5OhnI3rnPrytSUXXGiqC/WgVqJTVY aOaymW4hTR23niWf/zQGnlwCeBAsMlReKz1cTw2aBl+0l9Y4Ar9n1GSDmp/b7tMxOM+SbRU1kYm 10wr8+JRISuz0/L2kXDEtbBxbV1r7NfDbAKT2tkPVq0Xboja4RRHNIUvMBqmUqI57EZhkV95qLr gemNI5Xno7+wooXeU8ONitG0NE/fMLVh1jn71qo2naJh2tjsmlIl6c64HvX3+Ld/ChdWA/Q7f1r JuoFq8= X-Received: by 2002:a05:6214:1947:b0:89c:4b37:7106 with SMTP id 6a1803df08f44-8bdba9e69e9mr9178906d6.34.1778110988799; Wed, 06 May 2026 16:43:08 -0700 (PDT) Received: from localhost (pool-71-126-255-178.bstnma.fios.verizon.net. [71.126.255.178]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8b53c0e6d72sm213636626d6.26.2026.05.06.16.43.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 16:43:07 -0700 (PDT) Date: Wed, 06 May 2026 19:43:07 -0400 Message-ID: <3fa2020d427f18f9c34c9651f1a5496f@paul-moore.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=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: pstg-pwork:20260506_1600/pstg-lib:20260506_1556/pstg-pwork:20260506_1600 From: Paul Moore To: =?UTF-8?q?Christian=20G=C3=B6ttsche?= , selinux@vger.kernel.org Cc: =?UTF-8?q?Christian=20G=C3=B6ttsche?= , Stephen Smalley , Ondrej Mosnacek , linux-kernel@vger.kernel.org, =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= , =?UTF-8?q?Bram=20Bonn=C3=A9?= , Eric Suen , Casey Schaufler , Canfeng Guo , Takaya Saeki Subject: Re: [PATCH v3 3/14] selinux: more strict policy parsing References: <20250511173055.406906-3-cgoettsche@seltendoof.de> In-Reply-To: <20250511173055.406906-3-cgoettsche@seltendoof.de> On May 11, 2025 =?UTF-8?q?Christian=20G=C3=B6ttsche?= wrote: > > Be more strict during parsing of policies and reject invalid values. > > Add some error messages in the case of policy parse failures, to > enhance debugging, either on a malformed policy or a too strict check. > > Signed-off-by: Christian Göttsche > Acked-by: Stephen Smalley > --- > v3: > - incorporate the overflow checks on security classes from the > previous patch, and permit U16_MAX as class ID > - minimize the usage of magic values, by using macros or trivial > helper functions > v2: > accept unknown xperm specifiers to support backwards compatibility for > future ones, suggested by Thiébaud > --- > security/selinux/include/security.h | 1 + > security/selinux/ss/avtab.c | 35 ++++- > security/selinux/ss/avtab.h | 13 ++ > security/selinux/ss/conditional.c | 18 +-- > security/selinux/ss/constraint.h | 1 + > security/selinux/ss/policydb.c | 196 +++++++++++++++++++++++----- > security/selinux/ss/policydb.h | 23 +++- > security/selinux/ss/services.c | 6 +- > 8 files changed, 233 insertions(+), 60 deletions(-) I fixed the checkpatch.pl warning in pr_warn_once_policyload() but otherwise this looks good to me, merged into selinux/dev. Thanks! -- paul-moore.com