On Sat, May 08, 2021 at 01:13:08PM -0400, [email protected] wrote:
> I'm well out of my depth here, but I've run across
> https://outflux.net/blog/archives/2021/02/08/security-things-in-linux-v5-8/
> which says that READ_IMPLIES_EXEC "is no more" in kernel 5.8. Assuming it is
> true, that will stop your patch to c_core.c having its intended effect.

No, READ_IMPLIES_EXEC is still there.  But it is cleared on exec.
 
> Looking at c_core.c, where a comment says that if changing the personality
> failed, "we might as well continue", it appears that the logic of the code
> leads to the infinite loop that I experience.

>From trace is seems that READ_IMPLIES_EXEC is correctly set.  But
it is cleared on exec which causes the loop.  I have now a different
patch which have some chance of working.  It sets READ_IMPLIES_EXEC
for current process.  At least on my machine the opposite seem
to "work": when I clear READ_IMPLIES_EXEC, then I get errors.

-- 
                              Waldek Hebisch
--- ../trunk/pop/extern/lib/c_core.c    2020-02-07 18:23:46.000000000 +0000
+++ pop/extern/lib/c_core.c     2021-05-12 18:04:32.386478615 +0000
@@ -2188,6 +2188,10 @@
                 write(2, err_mess, sizeof(err_mess)-1);
             }
         }
+        /* 0x0400000 is READ_IMPLIES_EXEC */
+        if (!(pers & 0x0400000)) {
+            personality(pers|= 0x0400000);
+        }
     }
 #endif
 }

Reply via email to