From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] isdn: eicon: fix a missing-check bug Date: Fri, 11 May 2018 15:50:46 -0400 (EDT) Message-ID: <20180511.155046.122041869811590666.davem@davemloft.net> References: <1525548766-13017-1-git-send-email-wang6495@umn.edu> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: kjlu@umn.edu, mac@melware.de, isdn@linux-pingi.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: wang6495@umn.edu Return-path: In-Reply-To: <1525548766-13017-1-git-send-email-wang6495@umn.edu> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Wenwen Wang Date: Sat, 5 May 2018 14:32:46 -0500 > To avoid such issues, this patch adds a check after the second copy in the > function diva_xdi_write(). If the adapter number is not equal to the one > obtained in the first copy, (-4) will be returned to divas_write(), which > will then return an error code -EINVAL. Better fix is to copy the msg header once into an on-stack buffer supplied by diva_write() to diva_xdi_open_adapter(), which is then passed on to diva_xdi_write() with an adjusted src pointer and length.