Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp947219ybh; Wed, 22 Jul 2020 18:09:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcDZgo30tHDFU9R0M4ituaQTo5Z9rIQDvNU6IeJvFPticziPP8sf4EdXgj80p9rPK5q+Lc X-Received: by 2002:a50:f384:: with SMTP id g4mr1899724edm.205.1595466597725; Wed, 22 Jul 2020 18:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595466597; cv=none; d=google.com; s=arc-20160816; b=jmnaO6hLAa97uuvuEyGudyvgrv+mrj/bEsuTKLH4/cHQWoW+gFptTNnMmVCFmirZ0S Qb34N1wSr7YpPS1BosrYCSViN4V7owtoYxrFMeRycR90D1xMwFzUHnBFHZTeglTBictP wT67QH5+RhjO0pFKTUvRp0h+sSCjm4b6fcglEBk2TqAfCRaQlCnLePqeUGwISEVOD5zs MkHUU8CuMWkHSMTrSBBCaSV4hxFJJsOYNZZKciML1fMpgLi/N/Jx2etaTeC3905aOeHg eYFSC9IrLT81DNYcL68ZlBBVzG/4WQmTWHFRhk7WEIk2FsfswOYcxal6MK9MUHYmMGfz QHJg== 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:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=dq3sE3J+wSQB0yW86oDJ8SBuOJoYFH4iI4eTLbZjAj4=; b=OE7SNBC1bnrKqLPf3Odvh5tawcFKUp4x3NnTUAZ18Q/pBQtimjk9Cr0vy3fjEt80oD cv6PrmoRVRe90CG6n5elmkfVUP7u2SpnC5yRzzs3NNpxP2JKI/Lz9l9kbibEv3wuP3cT nGp4kQWpl2pSg6nV91K2pEciHtNhcml2nS4gOti3TvA/IfIQyrQKsb5FPT5esOP9TJr3 F6iJgx5qOo2xRgqiR+/3nKy4QhjkwWaWtEaBvEneAPRE7vj+kvc1rfLgYqJ8K7qGGdSM nCtSsHeMWRU1RcnbkhfZ2lHMPejAJ7PTElZjyGBlSkMfn8i2RGHrODYLb9Pwj5r4WaO4 1dlw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df7si1208967edb.462.2020.07.22.18.09.35; Wed, 22 Jul 2020 18:09:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387442AbgGWBHZ (ORCPT + 99 others); Wed, 22 Jul 2020 21:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728607AbgGWBHY (ORCPT ); Wed, 22 Jul 2020 21:07:24 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9B8BC0619DC; Wed, 22 Jul 2020 18:07:24 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 03364126B39BC; Wed, 22 Jul 2020 17:50:38 -0700 (PDT) Date: Wed, 22 Jul 2020 18:07:23 -0700 (PDT) Message-Id: <20200722.180723.102622644879670834.davem@davemloft.net> To: yepeilin.cs@gmail.com Cc: jreuter@yaina.de, ralf@linux-mips.org, gregkh@linuxfoundation.org, syzkaller-bugs@googlegroups.com, linux-kernel-mentees@lists.linuxfoundation.org, kuba@kernel.org, linux-hams@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Linux-kernel-mentees] [PATCH net] AX.25: Prevent out-of-bounds read in ax25_sendmsg() From: David Miller In-Reply-To: <20200722160512.370802-1-yepeilin.cs@gmail.com> References: <20200722160512.370802-1-yepeilin.cs@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 22 Jul 2020 17:50:39 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye Date: Wed, 22 Jul 2020 12:05:12 -0400 > Checks on `addr_len` and `usax->sax25_ndigis` are insufficient. > ax25_sendmsg() can go out of bounds when `usax->sax25_ndigis` equals to 7 > or 8. Fix it. > > It is safe to remove `usax->sax25_ndigis > AX25_MAX_DIGIS`, since > `addr_len` is guaranteed to be less than or equal to > `sizeof(struct full_sockaddr_ax25)` > > Signed-off-by: Peilin Ye Applied.