diff --git a/0008-tty-fix-the-null-pointer-of-get_tty_driver.patch b/0008-tty-fix-the-null-pointer-of-get_tty_driver.patch new file mode 100644 index 0000000000000000000000000000000000000000..7917512f3ecdd92d11930313a243382f7d012074 --- /dev/null +++ b/0008-tty-fix-the-null-pointer-of-get_tty_driver.patch @@ -0,0 +1,34 @@ +From 485a83c110bef1b2700acec0bd63bad4518aa62f Mon Sep 17 00:00:00 2001 +From: "fu.lin" +Date: Fri, 17 Sep 2021 17:16:48 +0800 +Subject: [PATCH] tty: fix the null pointer of get_tty_driver + +v2: split error checking from index variable initialization +v3: use PRIx64 for printing dev_t + +Signed-off-by: fu.lin +Signed-off-by: Pavel Tikhomirov +--- + criu/tty.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/criu/tty.c b/criu/tty.c +index 1598ad956..1462193c5 100644 +--- a/criu/tty.c ++++ b/criu/tty.c +@@ -1977,6 +1977,12 @@ static int dump_one_tty(int lfd, u32 id, const struct fd_parms *p) + pr_info("Dumping tty %d with id %#x\n", lfd, id); + + driver = get_tty_driver(p->stat.st_rdev, p->stat.st_dev); ++ if (driver == NULL) { ++ pr_err("Unable to find a tty driver (rdev %#" PRIx64 " dev %#" PRIx64 ")\n", p->stat.st_rdev, ++ p->stat.st_dev); ++ return -1; ++ } ++ + if (driver->fd_get_index) + index = driver->fd_get_index(lfd, p); + else +-- +2.43.0 + diff --git a/criu.spec b/criu.spec index 11ef92799b7d791b9e3b4b34d4c783505ec338ad..8010b5a7f3d8ea9b499d9ee8870ea71153092825 100644 --- a/criu.spec +++ b/criu.spec @@ -1,6 +1,6 @@ Name: criu Version: 3.15 -Release: 3 +Release: 4 Provides: crtools = %{version}-%{release} Obsoletes: crtools <= 1.0-2 Summary: A tool of Checkpoint/Restore in User-space @@ -22,6 +22,7 @@ Patch0004: 0004-criu-dump-and-restore-cpu-affinity-of-each-thread.patch Patch0005: 0005-vdso-fix-segmentation-fault-caused-by-char-pointer-a.patch Patch0006: 0006-criu-add-pin-memory-method.patch Patch0007: 0007-criu-add-pid-recover-method-for-criu.patch +Patch0008: 0008-tty-fix-the-null-pointer-of-get_tty_driver.patch %description Checkpoint/Restore in Userspace(CRIU),is a software tool for the linux operating system. @@ -95,6 +96,9 @@ chmod 0755 %{buildroot}/run/%{name}/ %doc %{_mandir}/man1/{compel.1*,crit.1*} %changelog +* Wed Jun 25 2025 snoweay - 3.15-4 +- Fix NULL pointer bug of get tty driver. + * Fri Jul 23 2021 snoweay - 3.15-3 - Add pid recover method for criu