Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4905461imm; Fri, 18 May 2018 12:43:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpOlStK4oa9z2+HrRZJdY4QKa7P9CYssAbycxADEwwHM6uBmq36Yn71dCjgoBG/LRWhJ18J X-Received: by 2002:a17:902:8f94:: with SMTP id z20-v6mr10870377plo.391.1526672638083; Fri, 18 May 2018 12:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526672638; cv=none; d=google.com; s=arc-20160816; b=dXAEWWChdIsmXZ0Bn/fmEbmUwJGfIJm+VQIhjKiKcIozQP0WlIv1hpTMaEvVvm3+nA ZPvxzCA6XNinaQDmb1SAwUCUBG/1eIFYra6SbNUbAmYO5MGWkV2DDahqsbY5o4CBQeHK WdOqJ16ogugOZmDabyCFWhWaDR5+1oMbZCiIkzYW1f90tTu6b9YqiQ3GunqNQRYBQzlG UaeNqk/wRlHEqmFSnRSzYxiuVnRLnP6LuS7W3iPDAfD9fVMLPdVeb28djq/cvlBgNzb6 nyG8jnjzho26NXX/ufG0dSsnCPzrGbXAxU5UgLBDmO3glbyyx2LTD/giTrnYkq9a9xJZ m79w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=JUFDuB2YwQKEI9VKUoT5pQU9gHJ40MOBXMLVjhO1RB8=; b=HxANWUemTI8M3jfw/rRwQRLPv92r4ET1+pT90TWTjg51o7mMF/ugwuYtPI/nx4hD67 ZnnT6xZ0k0BYWEFOpmBTDLVc9S8LOUzN73NjYSedeJL6i+8y0dTQHsWphokS35/MxNuz GswDTiI45/CIA2aH7877hq1a3vbJr82f0+jH8HMnY9BPfdIvptaGTJ6pNbIkr3bSl40o oliS4ClAF3wlFmyzNtcqiQSeXFcnHmSOq2Re9tKX8fY6JWqtnx/foJd/qciSVsBfSdKS 7fek/+hX4LE2hwc1uJLEeQ7JpSFAoTx8P5o1fvXrzwASl8oTSLphU64NDSTdlX4a7VIZ EinA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=20160920 header.b=h8ok1gv/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si6704567pgr.139.2018.05.18.12.43.43; Fri, 18 May 2018 12:43:58 -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=@umn.edu header.s=20160920 header.b=h8ok1gv/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbeERTmO (ORCPT + 99 others); Fri, 18 May 2018 15:42:14 -0400 Received: from mta-p3.oit.umn.edu ([134.84.196.203]:33904 "EHLO mta-p3.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbeERTmL (ORCPT ); Fri, 18 May 2018 15:42:11 -0400 Received: from localhost (localhost [127.0.0.1]) by mta-p3.oit.umn.edu (Postfix) with ESMTP id 553D76BA; Fri, 18 May 2018 19:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=umn.edu; h= content-type:content-type:subject:subject:message-id:date:date :from:from:references:in-reply-to:received:mime-version:received :received:received; s=20160920; t=1526672530; x=1528486931; bh=y 8yvXZDetWzCRFDNTQ912QTZTF7D+vINpbZfm1KJqJ4=; b=h8ok1gv/285DJ2na4 0s+4h2GPUp1/E0+YdfG03Ddr2JIck0WLTQNUFn2/jBv6tZFULE+AtdkjEz1kAWc8 u/Oh/t9A4mPsBizNiUjuJe0gMDdzlef3Aurwb9UxxQTzY+IradSjNg1YOkw7QosH bHTTkMoQPD0/MLzIanaClFmIA6rnzqI1L36014iRnpGh0eAHqN4b+kIdBninSbkO MjIMrrnFLhFg++EbTFNLarCy8y/gP9B24PpCg/Mga7xrqfJuXse+4TEYCfxMCbPz 6AqrNS2ujW/jvYflz6KHmgUkSLDYwN2RCO/fO8lVXULKpAoeuDVB/DmGzMjlPKgj Nav+A== X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p3.oit.umn.edu ([127.0.0.1]) by localhost (mta-p3.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I_tnBboGC7C3; Fri, 18 May 2018 14:42:10 -0500 (CDT) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: wang6495) by mta-p3.oit.umn.edu (Postfix) with ESMTPSA id 2AD0156D; Fri, 18 May 2018 14:42:10 -0500 (CDT) Received: by mail-io0-f179.google.com with SMTP id p124-v6so7517425iod.1; Fri, 18 May 2018 12:42:10 -0700 (PDT) X-Gm-Message-State: ALKqPwc3wtXiOd0VIDmlzAmDzu6eL9EC0JMhLzDIDJNloAS/6cbIrfsr xgkTF0gNc4qXTRXo8IRPhPHq+3PrcFZgY7AQc6o= X-Received: by 2002:a6b:5010:: with SMTP id e16-v6mr11778223iob.274.1526672529933; Fri, 18 May 2018 12:42:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:9850:0:0:0:0:0 with HTTP; Fri, 18 May 2018 12:41:29 -0700 (PDT) In-Reply-To: <20180511.155046.122041869811590666.davem@davemloft.net> References: <1525548766-13017-1-git-send-email-wang6495@umn.edu> <20180511.155046.122041869811590666.davem@davemloft.net> From: Wenwen Wang Date: Fri, 18 May 2018 14:41:29 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] isdn: eicon: fix a missing-check bug To: David Miller Cc: Kangjie Lu , Armin Schindler , Karsten Keil , "open list:NETWORKING [GENERAL]" , open list , Wenwen Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for your suggestion, David! I will revise the patch and resubmit it. Wenwen On Fri, May 11, 2018 at 2:50 PM, David Miller wrote: > 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.