Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2815632pxb; Mon, 18 Apr 2022 08:48:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwttKMlAjXpmjFkuO457/k+KV82l2mY2n33cqWWc4pGVa/P4JlD/0E3gxO2pvUgSFoR3D1+ X-Received: by 2002:a17:906:d9cf:b0:6ee:32ef:8da with SMTP id qk15-20020a170906d9cf00b006ee32ef08damr9889565ejb.750.1650296929722; Mon, 18 Apr 2022 08:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650296929; cv=none; d=google.com; s=arc-20160816; b=ozHkJ8katAIBx46pKSobBRyd3celG1YdVFHrqA3ZEpAc/KbtY2p2gAfdSfMAsxIXm7 xESoUgLCTQuuL8YJ9Ae71dUtvBgYnysrjnar+CsGXqDLWZmo3SxL9wPxQuYw5a2ZvRGy MIr6nd97bpUAxCUaVE6qTSjfIWFCSqKh/Wx4qWjjFMEK711ci3CzHbFUVD7kVqu+52oc Y4efPxwGzh1H+8iOhpi5AcnzWj63+pcrxhorNV4yy7EWJhi5uW19LMKwD0COkjevQnFa b9cs1Av0y1L6qVr4Un7z7LucbA1bIbdamwRhoKr+U9Lf8fiXJ2RHAcsb+XCesV76/2oB ptsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fJ/p3Eyo9U+4NYEv6L/KhKjVgy3Mt0xlio+rijiBx54=; b=K9cwyCoRu+DDafUHqyXjFxbM/jJoGnj/b2g0jzIN7SHgWlSFBSnJbdkpdlOvgid6/S 17TkOzU8C3ZPES/BK3uSL28/0mepJxECnoTeKMEIq988Bmf647A9ujR5FJ41OiWxIxqb 1nuZWN43q4nGDCfaP0+a0/NgdQjLueIa1xE052TwBJHFkiCoZ1HCZvD9tma+Q62d5vNE 3u6xJmp8sIZWx37IoPo9ZV/1S01qID2eANtFdoqTQz79cN3DeC8YT0cC+a/vtPHO9QPB 5/Chfj5cOTdWmQJaWQn1tsCunht/NWLmt4fIOUCnP1W/Zh9DNtVTNzOUxnAn2UYfCQxC LFPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gKRhzPQb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id yr5-20020a170907334500b006df76385c81si6026614ejb.289.2022.04.18.08.48.26; Mon, 18 Apr 2022 08:48:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gKRhzPQb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243347AbiDRNmS (ORCPT + 99 others); Mon, 18 Apr 2022 09:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241764AbiDRNIa (ORCPT ); Mon, 18 Apr 2022 09:08:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD3C72C114; Mon, 18 Apr 2022 05:48:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E5F6961256; Mon, 18 Apr 2022 12:48:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D491CC385A7; Mon, 18 Apr 2022 12:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286082; bh=TY6spYhMggnEkLYKEkBTsFgJaAlJwopjPFVTkWP82EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gKRhzPQbxfv6cEyWv+Iw8C0j3X/jt78/+xDFHZwetxlKb2pOCMlals4W/FXhJLqBc 3fPUy51DMu+P/7OlB+Rv9WnkA83F3vNl3+Ko5Nk4w9QD74oXym/BEkvVSlAeTb6VRx aSEaVL3OemAlSwkzWouj4gXJd416sY0k6Ee63x14= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Chuck Lever Subject: [PATCH 4.14 023/284] NFSD: prevent underflow in nfssvc_decode_writeargs() Date: Mon, 18 Apr 2022 14:10:04 +0200 Message-Id: <20220418121211.356029123@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit 184416d4b98509fb4c3d8fc3d6dc1437896cc159 upstream. Smatch complains: fs/nfsd/nfsxdr.c:341 nfssvc_decode_writeargs() warn: no lower bound on 'args->len' Change the type to unsigned to prevent this issue. Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Signed-off-by: Chuck Lever Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfsproc.c | 2 +- fs/nfsd/xdr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c @@ -227,7 +227,7 @@ nfsd_proc_write(struct svc_rqst *rqstp) __be32 nfserr; unsigned long cnt = argp->len; - dprintk("nfsd: WRITE %s %d bytes at %d\n", + dprintk("nfsd: WRITE %s %u bytes at %d\n", SVCFH_fmt(&argp->fh), argp->len, argp->offset); --- a/fs/nfsd/xdr.h +++ b/fs/nfsd/xdr.h @@ -33,7 +33,7 @@ struct nfsd_readargs { struct nfsd_writeargs { svc_fh fh; __u32 offset; - int len; + __u32 len; int vlen; };