lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 24 Oct 2016 09:05:18 -0600
From:   "Jan Beulich" <JBeulich@...e.com>
To:     <david.vrabel@...rix.com>, <boris.ostrovsky@...cle.com>,
        "Juergen Gross" <JGross@...e.com>
Cc:     <xen-devel@...ts.xenproject.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH RESEND] xenbus: check return value of xenbus_scanf()

Don't ignore errors here: Set backend state to unknown when
unsuccessful.

Signed-off-by: Jan Beulich <jbeulich@...e.com>
---
 drivers/xen/xenbus/xenbus_probe_frontend.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- 4.9-rc2/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ 4.9-rc2-xenbus-xenbus_scanf/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -335,7 +335,9 @@ static int backend_state;
 static void xenbus_reset_backend_state_changed(struct xenbus_watch *w,
 					const char **v, unsigned int l)
 {
-	xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i", &backend_state);
+	if (xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i",
+			 &backend_state) != 1)
+		backend_state = XenbusStateUnknown;
 	printk(KERN_DEBUG "XENBUS: backend %s %s\n",
 			v[XS_WATCH_PATH], xenbus_strstate(backend_state));
 	wake_up(&backend_state_wq);



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ