svn commit: r363023 - in releng: 11.3/sys/compat/linuxkpi/common/src 12.1/sys/compat/linuxkpi/common/src

Gordon Tetlow gordon at FreeBSD.org
Wed Jul 8 19:57:25 UTC 2020


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);


More information about the svn-src-all mailing list