From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765858AbdEXBqc (ORCPT ); Tue, 23 May 2017 21:46:32 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:31675 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759177AbdEXBqb (ORCPT ); Tue, 23 May 2017 21:46:31 -0400 To: Kees Cook Cc: linux-kernel@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Daniel Micay Subject: Re: [PATCH] csiostor: Avoid content leaks and casts From: "Martin K. Petersen" Organization: Oracle Corporation References: <20170509223444.GA51314@beast> Date: Tue, 23 May 2017 21:46:22 -0400 In-Reply-To: <20170509223444.GA51314@beast> (Kees Cook's message of "Tue, 9 May 2017 15:34:44 -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, > When copying attributes, the len argument was padded out and the > resulting memcpy() would copy beyond the end of the source buffer. > Avoid this, and use size_t for val_len to avoid all the > casts. Similarly, avoid source buffer casts and use void *. > > Additionally enforces val_len can be represented by u16 and that the > DMA buffer was not overflowed. Fixes the size of mfa, which is not > FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN (but it will be padded up to > 4). This was noticed by the future CONFIG_FORTIFY_SOURCE checks. Applied to 4.13/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering