Re: [PATCH 6.18.y 3/3] selinux: require a class's permission values to cover its permission count

Wentao Guan <[email protected]>
Newsgroups org.kernel.vger.stable
Message-ID <[email protected]>
Hi,

Thanks for your effort to take the backport series, but it can goes better.
What happened in my side is Github Copliot review point out the issue:
"This validation runs after symtab_insert(), so the table already owns key 
and perdatum. On an out-of-range value, the bad path frees both while leaving 
dangling pointers in the hash table, and rc is still 0, so malformed policy 
data is accepted and later accesses can use freed memory. 
Validate the value before inserting it and return -EINVAL."

In continues review, there LLM point out the mainline don`t had the issuse,
for correct sequence is that git log --oneline 
(v6.18.46-1) selinux: require a class's permission values to cover its permission count
selinux: reject a class permission count below its inherited common
selinux: reject a permission value exceeding the class permission count
selinux: more strict policy parsing
selinux: use u16 for security classes
Revert "selinux: reject a class permission count below its inherited common"
Revert "selinux: reject a permission value exceeding the class permission count"
(tag: v6.18.46, stable-gh/linux-6.18.y) Linux 6.18.46

You can try to revert 9b46fba7528f58ca09eac67ec7d474ff1e9af066 and 
next revert acd5b09be98fd38b7392307880156fb0452a7276, then pick
1.fa79a596848fe38c55ccab8832ac35dac07fb00c
2.18fa21f10d008a0fc22565109c7d38f304295912
3.d14b5d0e97fccd27974fedc03b903408872907fd
4.9a82dcd98b6e6e11cfd162410967951f12152528
5.b98a8ac50775540f3804397ed08f61ef9910bcab

I will send the patches in my side to show it, note these problem may existed
in other branch I don`t seen before.

BRs
Wentao Guan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.