From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Cox Subject: [PATCH] cumana: Fix a long standing bogon Date: Mon, 23 Mar 2009 10:37:57 +0000 Message-ID: <20090323103740.32478.26228.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from earthlight.etchedpixels.co.uk ([81.2.110.250]:46754 "EHLO www.etchedpixels.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754771AbZCWKhI (ORCPT ); Mon, 23 Mar 2009 06:37:08 -0400 Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: linux-scsi@vger.kernel.org, rmk@arm.linux.org.uk Should be using strncmp as the data from user space may be unterminated (Bug #8004) Signed-off-by: Alan Cox = 11 && strcmp(buffer, "CUMANASCSI2") == 0) { + if (length >= 11 && strncmp(buffer, "CUMANASCSI2", 11) == 0) { buffer += 11; length -= 11;