From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754296AbdEICI5 (ORCPT ); Mon, 8 May 2017 22:08:57 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:17429 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbdEICI4 (ORCPT ); Mon, 8 May 2017 22:08:56 -0400 To: Kees Cook Cc: linux-scsi@vger.kernel.org, QLogic-Storage-Upstream@cavium.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-kernel@vger.kernel.org, Daniel Micay Subject: Re: [PATCH] scsi: qedf: Avoid reading past end of buffer From: "Martin K. Petersen" Organization: Oracle Corporation References: <20170505224255.GA21521@beast> Date: Mon, 08 May 2017 22:08:44 -0400 In-Reply-To: <20170505224255.GA21521@beast> (Kees Cook's message of "Fri, 5 May 2017 15:42:55 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kees, > Using memcpy() from a string that is shorter than the length copied > means the destination buffer is being filled with arbitrary data from > the kernel rodata segment. Instead, use strncpy() which will fill the > trailing bytes with zeros. Applied to 4.12/scsi-fixes, thanks! -- Martin K. Petersen Oracle Linux Engineering