Date: Mon, 7 Oct 2019 14:46:23 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353276 - stable/12/sys/kern Message-ID: <201910071446.x97EkNZr081525@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Oct 7 14:46:23 2019 New Revision: 353276 URL: https://svnweb.freebsd.org/changeset/base/353276 Log: MFC r353010: Disallow fcntl(F_READAHEAD) when the vnode is not a regular file. Modified: stable/12/sys/kern/kern_descrip.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_descrip.c ============================================================================== --- stable/12/sys/kern/kern_descrip.c Mon Oct 7 14:24:59 2019 (r353275) +++ stable/12/sys/kern/kern_descrip.c Mon Oct 7 14:46:23 2019 (r353276) @@ -770,6 +770,12 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ break; } vp = fp->f_vnode; + if (vp->v_type != VREG) { + fdrop(fp, td); + error = ENOTTY; + break; + } + /* * Exclusive lock synchronizes against f_seqcount reads and * writes in sequential_heuristic().
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910071446.x97EkNZr081525>