umax: initialize reader_pid early in sane_start() (#853667)

This commit is contained in:
Nils Philippsen 2013-02-01 16:52:28 +01:00
parent 3b29dba498
commit 8ec0611bd3
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From b7ee97acddee63c5991d901b0c9ea506fb33f611 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Fri, 1 Feb 2013 16:47:30 +0100
Subject: [PATCH] patch: umax-init-error
Squashed commit of the following:
commit 13fb7a94adfa786b81a11755f22e8ab647cfac69
Author: Nils Philippsen <nils@redhat.com>
Date: Wed Jan 16 11:57:37 2013 +0100
umax: initialize reader_pid early in sane_start()
This avoids that subsequent errors followed by do_cancel() attempt to
phtread_cancel() an invalid thread (which may cause a crash).
(cherry picked from commit defdc1ab5c365735ac85e347d463a01cf96fc72d)
---
backend/umax.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/backend/umax.c b/backend/umax.c
index a9d1723..b2ceb00 100644
--- a/backend/umax.c
+++ b/backend/umax.c
@@ -7285,6 +7285,10 @@ SANE_Status sane_start(SANE_Handle handle)
DBG(DBG_sane_init,"sane_start\n");
+ /* Initialize reader_pid to invalid so a subsequent error and following call
+ * to do_cancel() won't trip over it. */
+ scanner->reader_pid = -1;
+
mode = scanner->val[OPT_MODE].s;
if (scanner->device->sfd == -1) /* first call, don`t run this routine again on multi frame or multi image scan */
--
1.8.1

View File

@ -41,6 +41,8 @@ Patch2: sane-backends-1.0.21-SCX4500W.patch
Patch3: sane-backends-1.0.23-soname.patch Patch3: sane-backends-1.0.23-soname.patch
# Fedora-specific (for now): make installed sane-config multi-lib aware again # Fedora-specific (for now): make installed sane-config multi-lib aware again
Patch4: sane-backends-1.0.23-sane-config-multilib.patch Patch4: sane-backends-1.0.23-sane-config-multilib.patch
# Submitted upstream: don't barf on umax init errors
Patch5: sane-backends-1.0.23-umax-init-error.patch
URL: http://www.sane-project.org URL: http://www.sane-project.org
@ -131,6 +133,7 @@ This package contains backend drivers to access digital cameras through SANE.
%patch2 -p1 -b .SCX4500W %patch2 -p1 -b .SCX4500W
%patch3 -p1 -b .soname %patch3 -p1 -b .soname
%patch4 -p1 -b .sane-config-multilib %patch4 -p1 -b .sane-config-multilib
%patch5 -p1 -b .umax-init-error
%build %build
%if ! 0%{?_hardened_build} %if ! 0%{?_hardened_build}
@ -216,6 +219,7 @@ install -m 0644 tools/sane-backends.pc %{buildroot}%{_libdir}/pkgconfig/
* Fri Feb 01 2013 Nils Philippsen <nils@redhat.com> * Fri Feb 01 2013 Nils Philippsen <nils@redhat.com>
- filter out backend driver provides/requires - filter out backend driver provides/requires
- update latex build dep - update latex build dep
- umax: initialize reader_pid early in sane_start() (#853667)
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.0.23-6 * Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.0.23-6
- rebuild due to "jpeg8-ABI" feature drop - rebuild due to "jpeg8-ABI" feature drop