Skip to contentSkip to conversation

bcache: defensively handle format strings

PATCH New Kees Cook 1 participant 1 message Sep 11, 2013

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 bcache: defensively handle format strings

Just to be safe, call the error reporting function with "%s" to avoid any possible future format string leak.

---
 drivers/md/bcache/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/super.c +1 -1
index 547c4c5..5be1de4 100644
@@ -1644,7 +1644,7 @@ err_unlock_gc:
 err:
 	closure_sync(&op.cl);
 	/* XXX: test this, it's broken */
-	bch_cache_set_error(c, err);
+	bch_cache_set_error(c, "%s", err);
 }
 
 static bool can_attach_cache(struct cache *ca, struct cache_set *c)
Signature · 6 lines
1.7.9.5


-- 
Kees Cook
Chrome OS Security