From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933138AbdESBfo (ORCPT ); Thu, 18 May 2017 21:35:44 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:45747 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932489AbdESBfi (ORCPT ); Thu, 18 May 2017 21:35:38 -0400 To: Varun Prakash Cc: linux-kernel@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Daniel Micay , Kees Cook Subject: Re: [PATCH] csiostor: Avoid content leaks and casts From: "Martin K. Petersen" Organization: Oracle Corporation References: <20170509223444.GA51314@beast> Date: Thu, 18 May 2017 21:35:27 -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: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Varun, You weren't CC:ed on this patch. Please review. Thanks! > 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. https://patchwork.kernel.org/patch/9718995/ -- Martin K. Petersen Oracle Linux Engineering