Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1063258lqo; Thu, 9 May 2024 03:51:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWlet2OVf92phGAMK6T9bPK7EwvUtztHgD7IeAkKx0yy0JjuxzLWesNHTBiqC3hsxblnB+rOjdPCRiaVK/pNE6VjbAl8+0QadMyqVYF9g== X-Google-Smtp-Source: AGHT+IFMJaKic5RsTm9MPyf9kegmzzElS6wSdrkIGX3JrgTdIkcb8SLhKqNrdv/kFNHUWYSYUSev X-Received: by 2002:a05:6358:70b:b0:192:6f25:2101 with SMTP id e5c5f4694b2df-192d291713bmr599184255d.1.1715251873048; Thu, 09 May 2024 03:51:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715251873; cv=pass; d=google.com; s=arc-20160816; b=p8m4EClS7OtUI2Q1SgFxz/bOtGRI9GxiZFRcEru5mlcpUdIGSgk06Py8LNUAWsq3vY 4DtsOg+IxuW/UbXhv3wqSia755tdIfa9+LnJsuKz7xVSbUTK/SP9ZIJ2M4YpIFoTn9x5 OqsXeRWdnYQB1qNX9JUlWXjv9pV35z3ZoTO7bCmlJ0NZMyGWuOyFaqIdrZuRcwFKnbDD H49imDNNDMz2Aw0xV4dzOJhEkNZG8EFJA6Vmf3cI8g/zJ3sjJlySoY7IUAH49V87mSQg mbWtCURku7DecrlMdiUfBf2IgIC8OVGriXk3mTkLUzmB6Zx4yd+J/K35ISNbGGEKKvGb hPbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=1rUGSw1BOvy4nSCnLDtXwjmmz6sz4Fg4JvkDjn2tH+U=; fh=TQfsTXrXIEef9CZAk7plBkDz5w2PZ/0ZerIOzX2uWhw=; b=uOatEUHgnrYOse9EcvwDB7dPOqRsHqstjEvGrjTccdd66vrI601MAi8IGuBUr+afTC nbmbCiKq+MhWkMWEACzA8rEiTbivB6NrN+Nvl1pE+sG/hhiKtBT4on/UTD85P1dGBXcA qeGnQ4dZMd0L1TIooV13BfPURJy/gJnC9O4aCiWbfdzAQR58CsqNRIW3VhGyf/Nkxlx+ fKDWBBtRK25B25BjTW5OyiM5OPW6fciKbJfQgMT1hurse0v5n7ONlTa7lTT04Vf3ver6 on3GxXMoQYdp86gB9u4NgbYWMcTz7kPUBtMUiKkTJLgc31vTCucv/f+OSTxEk5dpXMg/ vlCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vq3Jmpyh; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-nfs+bounces-3217-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340a06c0cbsi1142607a12.24.2024.05.09.03.51.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 03:51:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3217-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vq3Jmpyh; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-nfs+bounces-3217-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5D7BCB237A6 for ; Thu, 9 May 2024 10:47:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09A7114A8C; Thu, 9 May 2024 10:47:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vq3Jmpyh" X-Original-To: linux-nfs@vger.kernel.org Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CB2B12F582 for ; Thu, 9 May 2024 10:47:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715251663; cv=none; b=BGcZ8AB1nKzSTM2XsEFlBXvy4C4lc942b4mh6kgLB7/mbZu/X0b6BGs4I+8p421LKGINWQxMgDcKlz2fzOPRfTlNJDvRhk+rV+cnFK5GG07+/cxVMm/uXR82PnQWcU1bCVF2TjWFEKc9ms6kDkoVJeql8ubEmA6FvFT3+Gdt0kg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715251663; c=relaxed/simple; bh=rm5tKlmmzDvxykhjXtAahnY24hMhcwI+5x2kT/7OVE0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=rlRNzFgWBhhZYXI5U7Cw5EjmhP7KStNT0wKtGito6lP9ZylcSBInzY4WJLGDB89WadcKwG1g4L8+J9Qd+bDPTNJZzyMaBkYynCWCC7lgcw6I5g0lMjuWz+zGyuOlDpBU72EQbVM/pm9xGspIL7biwCPTfTciu6gM7r093dFc460= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=vq3Jmpyh; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a59cdf7cd78so185107066b.0 for ; Thu, 09 May 2024 03:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715251660; x=1715856460; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=1rUGSw1BOvy4nSCnLDtXwjmmz6sz4Fg4JvkDjn2tH+U=; b=vq3JmpyhZRc3TR4cEjBGRDbyb7flDs1B9zCrNJi8ceyjfew37YYFlILBv7Y4aOX3NN QzeIZuLN4JjUglakAYoh2qa0uWv7E8ZsGChseMCjfvQCU6m8CaERDYjKiFSdtJNOTH5T 9QdlQPQJuuM3+22NubkXiFgC4RXmot0Awl+etVOpw6Q/UePzy2Nhgokt5n51Zw+uXLW1 fApW7tHj88rCSIlbqk76hpwS6MdMl4h4JKxU8GGOwur7EwZOIA1d4LhZecY5Z2dg7lNf Z31Me0l785CTrTJ602WjYqgMDTEe6z5NHLEuQVyFmydKASh2Eed5LrWKebbClikTIlu1 K/UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715251660; x=1715856460; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1rUGSw1BOvy4nSCnLDtXwjmmz6sz4Fg4JvkDjn2tH+U=; b=g7dVfAbV6coM8OlJynQP0SeMpOn3bQh808XrnmwDJvXgnB3GEQIU3FqL9sQMBUzGS1 yL+LrAkzuWmx/chY6hm5MXCj1oxUXn99wlAfpB2HxMzHvAPZkK5fEa5ln2I09+BTKO2/ 4ui1HeKOPrytFqpuN2bMWYHN6fhVw7v3UawTSsl1ep6gF8t1eb9ePn2QZboH75vW6iDL jIjU3DlSlb1ZKc8BbBVagMvXCtgUcPNoylinksNVIKrSsL1V3gl9SKw2/oyczvTDVj8R fGGJ88GdyEO7Avcnj9l0MbixRSAy/R8RXseLit14MASS+FUCcQvg2A3VxT3VPaJWRs8n Oq8Q== X-Forwarded-Encrypted: i=1; AJvYcCUU5hojKRSQGn3xLKejSa59gX8mg6Liv+i2201qAFW/iBUu9XjBuxxilvrr3ssMeL/4C1WXEUhaOakagBzSv6zKYauR1F4+OmWf X-Gm-Message-State: AOJu0YyB8uklgQ6nat0RWmpxEaruc6iLxhbwc26+/xNmLRWpA3fGxZxo c5IfoFB69k0QgEUdbfqMmHI+Pat4yikvXJIQUrA7FouHowMcY+sBRGK4qHHbYog= X-Received: by 2002:a50:8d41:0:b0:571:bed1:3a27 with SMTP id 4fb4d7f45d1cf-5731da9edfdmr3363456a12.38.1715251660386; Thu, 09 May 2024 03:47:40 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733bebb6bfsm564708a12.28.2024.05.09.03.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 03:47:40 -0700 (PDT) Date: Thu, 9 May 2024 13:47:36 +0300 From: Dan Carpenter To: Trond Myklebust Cc: Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 0/2] NFSD: prevent integer overflows Message-ID: <332d1149-988e-4ece-8aef-1e3fb8bf8af4@moroto.mountain> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline There is a potential for integer overflows in svcxdr_dupstr() and svcxdr_tmpalloc() and XDR_QUADLEN(). I believe the fixing the overflow in XDR_QUADLEN() would fix the bug, but it's safer to be more thourough. Dan Carpenter (2): SUNRPC: prevent integer overflow in XDR_QUADLEN() NFSD: harden svcxdr_dupstr() and svcxdr_tmpalloc() against integer overflows fs/nfsd/nfs4xdr.c | 12 ++++++------ include/linux/sunrpc/xdr.h | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) -- 2.43.0