Received: by 10.213.65.68 with SMTP id h4csp2437220imn; Mon, 9 Apr 2018 03:36:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+OlCMRW/VWXw4jiP8eONqFOD2BHK/XAnNFpawVfQOsfIJ8F/RXx2oMDqtUpWqkI+3RhobE X-Received: by 2002:a17:902:8d98:: with SMTP id v24-v6mr38072631plo.21.1523270217305; Mon, 09 Apr 2018 03:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523270217; cv=none; d=google.com; s=arc-20160816; b=QnGscYh0QKxLu7BT3kBMlefoesz1gBEls99e+7JqIMBDHyUIuqTfGIcfFSpqdFZur2 tYmit4D0fSSQa4455+mE4ozdGLhLOLlaNRegX+jDp48Hb+eMvjhFMUGPkpNEx3U2dknH 1JCZVMW8X+Tr8W8Ei5d24jiJDn5HVx0ItMHW5JdpN+BgUz8Xze7+XXKJS87LovBBNJXp CJZ2eMm/txHpFfJofDHw2tQY3H2sWB3OUnOasqJoqAvIw+LSw4pD1Cdkplbl+tVJSMXD AfaAHp2du9K5yl259uDN2Md7Tkzfm++9darl9RrG+/1YNzOvPZ3Qkg4s1ILsFFfL4JEZ SU1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=sTMG1G7QeuBXxRx5nk4tPPuOWFSunBuJ91Qi6l5X5BY=; b=GzUqFSuEtKzejPWssXvYlz45+3v0H94RvolgLR+7SBSuqEbtsRsLp2vN8vDL8dnViK KL9DZqhExVUaczIKhF57kFX7eoApxVobEHuglyJRND3+xJHMvt67h8W4LOyf+sl4ohQh 8kUezl0Pub87QIQPMirjeAsZdrc6gi6FwlEFKgtiD9XrbxrqavLwYySptuqAOFbcL+C6 wWeH2+PC3NmbTbgb+FP+DX+4+FUbRI8UVE2xDMX9g5rPVLeqx6KteX0b+/7OrGU2u9KK 3TN4FnBcu38FZtR2BcJ0bAKKiU5s/EBVIVnb7epMk7pl99Ik89pjzrDK3YZfMIqFn32p 59Yw== ARC-Authentication-Results: i=1; mx.google.com; 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 n6si27119pgf.310.2018.04.09.03.36.20; Mon, 09 Apr 2018 03:36:57 -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; 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 S1751978AbeDIKdp (ORCPT + 99 others); Mon, 9 Apr 2018 06:33:45 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:52880 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbeDIKdo (ORCPT ); Mon, 9 Apr 2018 06:33:44 -0400 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 9CD6F201BF; Mon, 9 Apr 2018 12:33:40 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5xPdo1N85dJd; Mon, 9 Apr 2018 12:33:40 +0200 (CEST) Received: from mail-essen-01.secunet.de (mail-essen-01.secunet.de [10.53.40.204]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 25399201BD; Mon, 9 Apr 2018 12:33:40 +0200 (CEST) Received: from gauss2.secunet.de (10.182.7.193) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server id 14.3.389.1; Mon, 9 Apr 2018 12:33:39 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id B4CAD318136F; Mon, 9 Apr 2018 12:33:39 +0200 (CEST) Date: Mon, 9 Apr 2018 12:33:39 +0200 From: Steffen Klassert To: Kevin Easton CC: Herbert Xu , "David S. Miller" , , Subject: Re: [PATCH v2 1/2] af_key: Always verify length of provided sadb_key Message-ID: <20180409103339.jtkfg7xhjmjy772o@gauss3.secunet.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 23 X-G-Data-MailSecurity-for-Exchange-Server: d65e63f7-5c15-413f-8f63-c0d707471c93 X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: CEFCC8D5-2E9A-400B-8BE5-124B09842E70 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 07, 2018 at 11:40:33AM -0400, Kevin Easton wrote: > Key extensions (struct sadb_key) include a user-specified number of key > bits. The kernel uses that number to determine how much key data to copy > out of the message in pfkey_msg2xfrm_state(). > > The length of the sadb_key message must be verified to be long enough, > even in the case of SADB_X_AALG_NULL. Furthermore, the sadb_key_len value > must be long enough to include both the key data and the struct sadb_key > itself. > > Introduce a helper function verify_key_len(), and call it from > parse_exthdrs() where other exthdr types are similarly checked for > correctness. > > Signed-off-by: Kevin Easton > Reported-by: syzbot+5022a34ca5a3d49b84223653fab632dfb7b4cf37@syzkaller.appspotmail.com Applied to the ipsec tree, thanks Kevin!