Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9c24466 authored by Kees Cook's avatar Kees Cook Committed by James Bottomley
Browse files

[SCSI] esas2r: fix potential format string flaw



This makes sure format strings cannot leak into the printk call via the
constructed buffer.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarBradley Grove <bgrove@attotech.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 2e706377
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -165,13 +165,9 @@ static int esas2r_log_master(const long level,


		/*
		/*
		 * Put a line break at the end of the formatted string so that
		 * Put a line break at the end of the formatted string so that
		 * we don't wind up with run-on messages.  only append if there
		 * we don't wind up with run-on messages.
		 * is enough space in the buffer.
		 */
		 */
		if (strlen(event_buffer) < buflen)
		printk("%s\n", event_buffer);
			strcat(buffer, "\n");

		printk(event_buffer);


		spin_unlock_irqrestore(&event_buffer_lock, flags);
		spin_unlock_irqrestore(&event_buffer_lock, flags);
	}
	}