Re: [PATCH v7 1/1] landlock.7: Explain the best-effort fallback mechanism in the example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 18, 2023 at 04:24:49PM +0200, Alejandro Colomar wrote:
> Hi Mickaël,
> 
> On 4/17/23 22:45, Mickaël Salaün wrote:
> 
> [...]
> 
> >> +int abi = landlock_create_ruleset(NULL, 0,
> >> +                                  LANDLOCK_CREATE_RULESET_VERSION);
> >> +if (abi <= 0) {
> >> +    /*
> >> +     * Kernel too old, not compiled with Landlock,
> >> +     * or Landlock was not enabled at boot time.
> >> +     */
> >> +    perror("Giving up \- No Landlock support");
> 
> [...]
> 
> > As a side note, this syscall and this flag should never return 0, but if 
> > it does (e.g. because of weird seccomp filter), the errno value might be 
> > unspecified.
> 
> Hmm, good catch, we should test for `== -1`, rather than `< 0`.
> Michael Kerrisk explicitly wanted this, and I agree with him, as it makes
> the code slightly more readable (explicit).

Ack, I'll send a small follow-up.

–Günther




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux