Date: Wed, 8 Jul 2020 19:57:24 +0000 (UTC) From: Gordon Tetlow <gordon@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r363023 - in releng: 11.3/sys/compat/linuxkpi/common/src 12.1/sys/compat/linuxkpi/common/src Message-ID: <202007081957.068JvOBY018153@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gordon Date: Wed Jul 8 19:57:24 2020 New Revision: 363023 URL: https://svnweb.freebsd.org/changeset/base/363023 Log: Fix kernel panic in LinuxKPI subsystem. Approved by: so Security: FreeBSD-EN-20:14.linuxpki Modified: releng/11.3/sys/compat/linuxkpi/common/src/linux_compat.c releng/12.1/sys/compat/linuxkpi/common/src/linux_compat.c Modified: releng/11.3/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- releng/11.3/sys/compat/linuxkpi/common/src/linux_compat.c Wed Jul 8 19:56:34 2020 (r363022) +++ releng/11.3/sys/compat/linuxkpi/common/src/linux_compat.c Wed Jul 8 19:57:24 2020 (r363023) @@ -1502,6 +1502,9 @@ linux_file_close(struct file *file, struct thread *td) KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + if (td == NULL) + td = curthread; + error = 0; filp->f_flags = file->f_flag; linux_set_current(td); Modified: releng/12.1/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- releng/12.1/sys/compat/linuxkpi/common/src/linux_compat.c Wed Jul 8 19:56:34 2020 (r363022) +++ releng/12.1/sys/compat/linuxkpi/common/src/linux_compat.c Wed Jul 8 19:57:24 2020 (r363023) @@ -1502,6 +1502,9 @@ linux_file_close(struct file *file, struct thread *td) KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + if (td == NULL) + td = curthread; + error = 0; filp->f_flags = file->f_flag; linux_set_current(td);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007081957.068JvOBY018153>