From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 526CACD6E7E for ; Wed, 11 Oct 2023 15:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235041AbjJKPh5 (ORCPT ); Wed, 11 Oct 2023 11:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234946AbjJKPhy (ORCPT ); Wed, 11 Oct 2023 11:37:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06DADB8 for ; Wed, 11 Oct 2023 08:37:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44CB3C433C8; Wed, 11 Oct 2023 15:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697038672; bh=sZYMiIgfprtrSPa/YkV0LT+ZOWe7IlPCwKkD47oyPlM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SqMOVbfyTIsQHi9u7DJ5iIe+Ff0gwSpewAuPmDzyYXvqcvJ4F+kiBPbNSqrlJQCRK tl46k7q4/GIsuM7g4CwYR5gzNQxaknnoWaSotPpEGO/v02gd346PPfYUXzJFP37CeZ 1b8PmDksnZhMFZJciijKOd81d9mD1d5wdrPRzetPswD+VujzyqUgU7uwhKfuQJn5b6 dZ32lmPgn2Gcwb4ezDISUOx2EMgAWCKMPcBIL/8aUDlgnc1ziq+hJv678yteFFpcHP kihDfRlFKpIHXiE0oRUkMx4q6TEM13lCXeM/lE5TR920UXFBWWVOpeJX98sphVmy3X 80UQuo8FOYC2Q== Date: Wed, 11 Oct 2023 17:37:47 +0200 From: Simon Horman To: Jeremy Cline Cc: Krzysztof Kozlowski , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Dmitry Vyukov , Lin Ma , Ilan Elias , "John W . Linville" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+0839b78e119aae1fec78@syzkaller.appspotmail.com Subject: Re: [PATCH v2 net] nfc: nci: assert requested protocol is valid Message-ID: References: <20230906233347.823171-1-jeremy@jcline.org> <20231009200054.82557-1-jeremy@jcline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231009200054.82557-1-jeremy@jcline.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 09, 2023 at 04:00:54PM -0400, Jeremy Cline wrote: > The protocol is used in a bit mask to determine if the protocol is > supported. Assert the provided protocol is less than the maximum > defined so it doesn't potentially perform a shift-out-of-bounds and > provide a clearer error for undefined protocols vs unsupported ones. > > Fixes: 6a2968aaf50c ("NFC: basic NCI protocol implementation") > Reported-and-tested-by: syzbot+0839b78e119aae1fec78@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=0839b78e119aae1fec78 > Signed-off-by: Jeremy Cline As per my review of v1, this looks good to me. Reviewed-by: Simon Horman