From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 969DA3AB29D for ; Mon, 3 Aug 2026 20:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785787438; cv=none; b=pZex5XRY5C7t5FzxhtkMOjR5bNAjyijHh/bUq3GlfyuFsg1hVAPHdaiISggF4j5clfQFe8AaBYpfSCbF+Yct6LF2BZSfndgDGD5s4RlXDwKxlJWc+Uw71fakdfZXY/WtOsDxMzjgYoWVyvDJA1T8yYTazkt3SQtqI8+5+Zw8oHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785787438; c=relaxed/simple; bh=UocPPSy64iVBry4L1IRP5elr7tlVgUQYhuZ5TiyZ0QA=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=jLxx7PzUbKYVhNKGL15vtzEw5E/HBtAbAbSnIk5bjDRer2TkvudQQnnIEqg1JZPoQTmJbJWvTmXD5a9E694v5b6ffmx7y8eDx+2ovCR50TWuoZthmLYLin7JyohYXh12x2jgTjp7MNPfYbvl0Bf/D68XIOQZ8fo6rQmkIFzFelU= 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=fshmK3fa; arc=none smtp.client-ip=209.85.160.180 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="fshmK3fa" Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-51c05dcdf49so40482371cf.0 for ; Mon, 03 Aug 2026 13:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1785787435; x=1786392235; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-type:mime-version:message-id:date:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jQnkkq3ZYIQjsF1ZWL94ik6EYBuBLNxIxpOXmwtwvfo=; b=fshmK3faAenUBezq4tOxI6yZR5eZHGB3P8inhRRoGsVQmWTfR3dW2szHlHP3/uStX4 xQc3+COQDmKhPDzLZ+vNw8lUjNu7WSnJXwGTpFUbzbJNfztcsCz+0t8suu7e2/NpAzNt 6GPPsS6P6NWRKkDpE7AWMzJ9ynixjczrROgFN3rJ62x3vKQRblyvQvjRPqrVkcQOjo3F /APOTro8aqak7+4gQWpbqRWxmLQ6qvMNVd93f7uENmgKIQu7Q31QWM0eCwXyyK2Xr4NB xpEkO+PZ0Kveq0uIMq6ymKCq4gZiVNw4sMlSI3GlMdsNfXbp0Qh97H/FnvAqEXTqoCl9 AoWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785787435; x=1786392235; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-type:mime-version:message-id:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jQnkkq3ZYIQjsF1ZWL94ik6EYBuBLNxIxpOXmwtwvfo=; b=DBWWCffD2xYjnyMjSKx3ECFITDsnA6xZ5bjg7gVTIWKXPmtjP5VwJGLHZEb7XuayfJ odDf9agvypts/9vkgsXC8zO8Kd3cTGuEQDISjMAW+UN/d4vNd94v1s/yqnCWcpXyE5Rd GYCJTmtx/WBLGqdkzKNnr/Wu5e4rbN1jpeJXMtWuWIPw7X8dPCra0CvaDxWx6SZfO/kH KGH9m57cA1vM5GDWPJlwpWRd3LnAdc36ulZg6prLc5m0+MZ4E0v0l0FFLYP6xti7XO6+ ZwDgx/a9iiaZAEVGICJE/kERLSdfcjcbPXdvBvcjh/4LYNLu9j6O0yH03Bqpgy3zVq4e NOoA== X-Gm-Message-State: AOJu0YyZYCa+e6lsitj1J6u1aWvrBYTe958NdO79SJKot8dsNTS9U/L+ HpUh6afv/bt2sxtpoRaYJvf97QfxICuhM0RlASmFRoiQUUomE7E4clZEo/ZNfBKONg== X-Gm-Gg: AR+sD12q4n0HKv+kQ+Xu15cBKDHbZ+tpsj23Ys8sN8it/rnNivkfF+1Vmi9cygj+ZM5 bohA9ZQUhW5Cy+xFeEksgiKu390wd4hXCUHm0pcvOtC0VmKcRGOEAJY+1l5LuVb7hO97W5Js1Le u7YNoGHXuAucVhqSRE8H9E8+scErcaRaeSlcJwQR7S0JMpo/rAtHBHd1XvkCuJvOfzbQeJsywG8 fANtGxLtnVo7HBrBQRat8InOMQVystfHfcP9WhIk9WCJoUlJ4Zg1lf8HJch7IeEPo5rwuagNjvy 0/D3Bz/yXjrEINpoCbjHeOOgD0ZLJtP0YUTGMn8b33qIkuV9GQX4DYsNZgdMm5AKSCkrxm1lfEO JGHZIBW+0N5xNM3xK0VV6IWiillHtYMFZmLWVm1BkoJZ5FFhOFb9d+sSYxywWBAYu7TWsbdyrVF FFJG+fMgEKpgb2a4DR5L0uzB6Bef3KocwPePlTgxjLFKzDSsrhZ+n9eHFD+BLhSYzUm4qU5NR5L SZ9JqvO+fLajxj35wtpgTBtNfDlaipO9Q== X-Received: by 2002:a05:622a:103:b0:51a:6feb:dc8a with SMTP id d75a77b69052e-52b566ae942mr216625471cf.18.1785787435406; Mon, 03 Aug 2026 13:03:55 -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 d75a77b69052e-52b4ebe0c1fsm67016781cf.28.2026.08.03.13.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 13:03:54 -0700 (PDT) Date: Mon, 03 Aug 2026 16:03:52 -0400 Message-ID: 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:20260803_1511/pstg-lib:20260803_1500/pstg-pwork:20260803_1511 From: Paul Moore To: Bryam Vargas , Stephen Smalley Cc: linux-kernel@vger.kernel.org, Ondrej Mosnacek , Kees Cook , selinux@vger.kernel.org, =?utf-8?q?Christian_G=C3=B6ttsche?= Subject: Re: [PATCH 4/4] selinux: require every boolean value to be defined References: <20260731-b4-disp-d32e997b-v1-4-0341d038ee47@proton.me> In-Reply-To: <20260731-b4-disp-d32e997b-v1-4-0341d038ee47@proton.me> On Jul 31, 2026 Bryam Vargas wrote: > > p_bools.nprim comes from the policy image independently of how many > booleans follow it, and cond_index_bool() fills bool_val_to_struct[] at > value - 1, so a count larger than the values present leaves NULL entries. > Every user of that array then walks it by index and dereferences each > entry: cond_evaluate_expr() on the access-vector path, > security_get_bools() and security_get_bool_value() behind selinuxfs, and > security_set_bools(). A sparse class value is absorbed by > policydb_class_isvalid() and its siblings; booleans have no such > predicate, and no consumer that could use one. > > Reject a boolean value that no boolean defines, once, where the array is > built. Conforming policies define every boolean they declare and are > unaffected. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: stable@vger.kernel.org > Signed-off-by: Bryam Vargas > Acked-by: Stephen Smalley > --- > security/selinux/ss/policydb.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) Merged into selinux/stable-7.2, thanks! -- paul-moore.com