Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp229503imd; Fri, 26 Oct 2018 07:42:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5dBnbPe1D7cK0dkvapqV8H0lqlqWdBt5bi78LwhRTal1VoJQ0TcX0fwgOOHzVmG5xr/I6mP X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr3734340plk.16.1540564973913; Fri, 26 Oct 2018 07:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540564973; cv=none; d=google.com; s=arc-20160816; b=iVcLPJXmW044RQPTaAjk81j1pHSqey0VT78qF2BEOACWzRqgHcJJLAKThHUU4E3g6r jqjsjsp8qZCdMgfvLFACQ4q3NgITmmFBjZfd6CEOp0uXFwFJYg0OMwFaLJEEAAMTyqsM HC0hD9AVMM23doDC0JrPQcOw3v7DnIu96XXRsB6R47MRnFSyyGnGCPRIL/MTG3qgwT/1 MTe7zNHgz/nUNEX2QTplSXafzJS2MC3P/tWwyybWYUlGUPulIn7EZYwnarWov/4+HsSO aMU8OFEu2WfS8S8kXX62kXPMqgKRdgZSsvRWhkH7EZcri72DqsfNutbSAs9VAQ7zEZwy hzow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=lTTlVOKUqEWUWN0NJFwN4d1EyUVtWGuanq+hea96pDc=; b=ZEqnz3EUO8MAfvmPgogacLlEEeSaoLbTg9IBiv9VhTpfBvBqaNCfbaT7pMmwOh5dK8 O154SaUhN2gC+J1mj0irY1eg1buza1mnwCzp9wFuuluNrQ54hjPst8bRdc/6aAYT32m2 MSgwCDgd0rMpleUIuw+z9eYI2xp1Xt1B2ljmSLTFkylWZDijfU1nFmA5+9U6XF5SAM02 YFXXnz9EzRoQWvuRs8S5ZnVTwK0E0nkBwGM1CgdxIrxh5GBXKTqqkcjg8RgPonBdrWLF NlT162Mu3F271ALkMGkWFrOB2c3ql9GTweP9wf/Shzf7PZAiN3L5iIwjRVPJCE/BNWli ovjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=o+l0FuZt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r28-v6si6066656pgm.300.2018.10.26.07.42.38; Fri, 26 Oct 2018 07:42:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=o+l0FuZt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727597AbeJZXSr (ORCPT + 99 others); Fri, 26 Oct 2018 19:18:47 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:40449 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726815AbeJZXSr (ORCPT ); Fri, 26 Oct 2018 19:18:47 -0400 Received: by mail-io1-f65.google.com with SMTP id a23-v6so846013iod.7 for ; Fri, 26 Oct 2018 07:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=lTTlVOKUqEWUWN0NJFwN4d1EyUVtWGuanq+hea96pDc=; b=o+l0FuZt8Em5+p0ffj9VCdSv0chigXVGTNKxAMBQV+SQlJ+WBb9kpoWviKGiebrfMn uXdkMFD2G7oUcVaNwL7qKKmG+DELLF5hFKwogZMI7UeZYDG6aHtNL+z3r5TVctpEvkgp K2wvDr93V5mHr0yxxK1r9XvrMI2748vL6n9OWUusnmdWNDChVyEXoGohmFgh6M8N663t IZMmXzY+kNEz9lh1mRyRiU4MtxIcA5UgDAv87+/pC219sdB/RExKDjKSH9sh1qUBVY6q RtKWHI3rAqYWYjwb9OEdENOsPSLw64QnIiSS1emEhneRVUwTgQ9L12+WnReIbAqxHHUx /HBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lTTlVOKUqEWUWN0NJFwN4d1EyUVtWGuanq+hea96pDc=; b=h4ksxjQPxkzNcOBB3QR/KK7zxac3GLkQ6Y0cQjeSx8UYXK21miYJMe0trPsOi5uTFY u/VOAvqRYH4GRzTNPJVtr85ajXHfxdWp7IUXhMwY8qS6JQWkS5jUmF3YTP/dwL3Y6Qs6 M74TYtQSVj/Vvu3sU5DIghzWIxxhgaWXVqbzSDsiOVeefNtZptgSxAdPuVbtsDFf7LFS tRZ6aamFZYEXG07CPRnYZA1UHgtW6pxq2UeAb4+1lftsaC2X8pG0ptTCtbJvgExXkVm4 04lWG3pAkKPt77KywOqkWqB/m3GMla4vFc3IkjK83sYu/IAcMHgZTP/gMU3ZY+QJT7GF 06IQ== X-Gm-Message-State: AGRZ1gLn4qOngyrALcRZmgUNtJ0POAmX06hKL3i7g6yVHFyQctkcx37R fLD8csiMTWnJsT3Nm70RRA3nkLvG8JU= X-Received: by 2002:a6b:3707:: with SMTP id e7-v6mr2425032ioa.60.1540564886778; Fri, 26 Oct 2018 07:41:26 -0700 (PDT) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id j19-v6sm2376444itj.31.2018.10.26.07.41.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:41:25 -0700 (PDT) Subject: Re: [PATCH] floppy: Avoid memory access beyond the array bounds in setup_rw_floppy() To: Kyungtae Kim Cc: jikos@kernel.org, Byoungyoung Lee , DaeRyong Jeong , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Jens Axboe Message-ID: <46e927f8-268c-866c-75f7-d1406252759a@kernel.dk> Date: Fri, 26 Oct 2018 08:41:23 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/18 8:39 AM, Kyungtae Kim wrote: > diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c > index a8cfa01..41160a1 100644 > --- a/drivers/block/floppy.c > +++ b/drivers/block/floppy.c > @@ -3146,6 +3146,9 @@ static int raw_cmd_copyin(int cmd, void __user *param, > */ > return -EINVAL; > > + if (ptr->cmd_count > ARRAY_SIZE(ptr->cmd)) > + return -EINVAL; > + > for (i = 0; i < 16; i++) > ptr->reply[i] = 0; > ptr->resultcode = 0; Almost there, the tabs have been turned into spaces. This could be a mailer issue, what are you using to send out the patch? -- Jens Axboe