On Tue, 25 Jun 2019 23:57:24 +0200, Sebastian Benoit wrote:

> Well, if you do that, i think some callers need a look, for example

That change was specific to F_SETLK so the callers you reference
are not affected.  However, I did miss F_GETLK, which needs the
same treatment.

 -  todd

Index: sys/kern/kern_descrip.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_descrip.c,v
retrieving revision 1.186
diff -u -p -U6 -u -r1.186 kern_descrip.c
--- sys/kern/kern_descrip.c     25 Jun 2019 15:47:28 -0000      1.186
+++ sys/kern/kern_descrip.c     25 Jun 2019 22:03:01 -0000
@@ -589,13 +589,13 @@ restart:
        case F_GETLK:
                error = pledge_flock(p);
                if (error != 0)
                        break;
 
                if (fp->f_type != DTYPE_VNODE) {
-                       error = EBADF;
+                       error = EINVAL;
                        break;
                }
                vp = fp->f_data;
                /* Copy in the lock structure */
                error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&fl,
                    sizeof (fl));

Reply via email to