CVSROOT:        /cvs
Module name:    src
Changes by:     v...@cvs.openbsd.org    2022/06/01 08:18:43

Modified files:
        sys/kern       : vfs_lockf.c 

Log message:
Fix ambiguity with lock range end

When the user requests a lock range that ends at LLONG_MAX, replace
the end point with the special EOF value -1. This avoids ambiguity
with lf_end in lf_split(). The ambiguity could result in a broken
data structure.

This change is visible to userspace in a corner case. When a lock range
has been requested with an end point at absolute position LLONG_MAX,
fcntl(F_GETLK) returns l_len == 0, instead of a positive value, for that
range. This seems consistent with FreeBSD and Linux.

OK anton@

Reported-by: syzbot+c93afea6c27a3fa3a...@syzkaller.appspotmail.com

Reply via email to