Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp739851ybg; Wed, 3 Jun 2020 12:19:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQuYXDrfQBqDKpXjJz19UMLw/F8awsvm1uHYujgBQ0FrBtJrrdnVS8M9bSVWpbAGva5Gc3 X-Received: by 2002:a05:6402:1481:: with SMTP id e1mr897594edv.113.1591211952990; Wed, 03 Jun 2020 12:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591211952; cv=none; d=google.com; s=arc-20160816; b=OpQN517ZkJfeZ4/D/OLVu3K0/Vjy6uZh2boi9deO4Ob7mGVWRLBU/GlEd9SzvIN1wL vN2FRNYw1r4PmfrzIEXAnmjiwT0oC8NCpeguhQeXBLnWIE/Ji/FBLlAqQAH4UZD1l7Fw a/eXXuL38O3cqaBxpU/Bu+gqAbDxZ0BKNBv8JPOqhu0AQivQzR6z8vK9f/sZgt3C1UhT NQ//mq5EByDiBH2BwKYHF2BFfAggg/xxzE+UOXf5VPcZh6N/RltQORSRZ1d7ezFF8HLV PK8HrOlFvwhC5vnJk/OfDDC9ua1XN3tbZSklEp+eOZLZmar+G8fOtPQA7HFMX/MgsFyQ Ig6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=K3kGe1mJiZJ6dwCK1eiMjr6x1I5RcW2yQKwe0qCmt18=; b=I0SHALUxWMxyhHQ0jMTWEB01+cOKfWmGOHLZ6bM/WUmOIj9sShVJ4NYthkpy7WzBNR RQf0HV/BaKRPXvCuR3UllStx4AF4XNb2J9xkYh3Akt2Pr6H/yDIkzpEdPCGGwSZQD0Sl 9MP8wSi3DH7mLQtYYL1r83Tk3Z4ij6f89WGE4Cvut8mYcMhnImVt3bx7KDvV+d60h5fM CC2bF77oab49ml1grZ7/oWGhymAyzpd32EXaeYrz9fTBCOyjDb8PXEquAc2Obc5i65Qx fkMRnoSPZ6vRj6TJC+DJZE/+x2A1t9CHdcUnrAPtDD1pUT1WODF2UpyYHvRun6aJh5NY Ix0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fQbCD8GI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si258257edq.147.2020.06.03.12.18.48; Wed, 03 Jun 2020 12:19:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fQbCD8GI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726123AbgFCTNl (ORCPT + 99 others); Wed, 3 Jun 2020 15:13:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbgFCTNl (ORCPT ); Wed, 3 Jun 2020 15:13:41 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01910C08C5C0 for ; Wed, 3 Jun 2020 12:13:41 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 23so1334918pfw.10 for ; Wed, 03 Jun 2020 12:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=K3kGe1mJiZJ6dwCK1eiMjr6x1I5RcW2yQKwe0qCmt18=; b=fQbCD8GIVJ5wlkL5wGfpFvF9FNSn8t1F2Oc5rQJeL2UIwAsPyIRuO/le76qQAiUrSR BTAZkFkepzS3NK6NSIj+g+Q7TD/6wailngAlm+56RsYRqrFiqObLM77Cs5rcrPIvZmJO H0QVCBeb4/ISJiEKXBnF9w/aUj0K6G56zsYZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=K3kGe1mJiZJ6dwCK1eiMjr6x1I5RcW2yQKwe0qCmt18=; b=liwqN62wtJjPI0VA8eDF1e4ppGiqS1kzZKgvyiaP1ktzDEMNZDb/q0PlFthCT3Tp3m JErNA8JIOpC2CWTePJXmFWXb/ALej4yQb4pJb98h0CE6VKw1XKdhvvQf3A3clG+GnIal 2J3h7AHb4ZOeVW1mSBqIPUW6HWZz2biGzNtdhWo3woF7SjLpPjr4Bz69oJAIdsq3o+9i B7PBY4ZlHk3YkK3JmqKxu2jcGNdMDrt6jGXkguZnBj5JEKHoW4Uuv13158b5BVwmK1Qy dsnrDhilVYwckv9iJZ8/M7FDR2UJM0WvVK1Vl4oazlUGRz/EUMGFn+hfxXckeqPA3vkT uZNA== X-Gm-Message-State: AOAM531I6JcEt3yY4M5Ll+TYwgNJNJ8G9ncjOO4lLkgLnuaNmhlWDTxx EmBuynJtqSnI8C5IN+EP/Q05MQ== X-Received: by 2002:a63:5812:: with SMTP id m18mr779730pgb.407.1591211620629; Wed, 03 Jun 2020 12:13:40 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m2sm3292501pjk.52.2020.06.03.12.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 12:13:39 -0700 (PDT) Date: Wed, 3 Jun 2020 12:13:38 -0700 From: Kees Cook To: Denis Efremov Cc: Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty/vt: check allocation size in con_set_unimap() Message-ID: <202006031213.22D9D875@keescook> References: <20200603102804.2110817-1-efremov@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200603102804.2110817-1-efremov@linux.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 03, 2020 at 01:28:04PM +0300, Denis Efremov wrote: > The vmemdup_user() function has no 2-factor argument form. Use array_size() > to check for the overflow. > > Cc: Kees Cook > Signed-off-by: Denis Efremov Reviewed-by: Kees Cook -- Kees Cook