Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp786917rdb; Fri, 2 Feb 2024 04:13:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe9kAjl+tsbyIfcSJk7FMriPXECHJDfdWxAppp5ZN5pSxRDJrFgTxHuAP4hMmzOzR3dxTo X-Received: by 2002:a2e:8696:0:b0:2cd:9959:53a5 with SMTP id l22-20020a2e8696000000b002cd995953a5mr3632387lji.10.1706876035397; Fri, 02 Feb 2024 04:13:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706876035; cv=pass; d=google.com; s=arc-20160816; b=izFYdeQE77S5acVeE80J4nO64Cdq7YB4RPQM+16mpIh389wVoPHDRJnGJjjMOWa49z D21eBCz0P7nvhdHoeG1GIOUcR8/L9FJzMQzoFPNNHgg/QUW+0R2CqMlX75q873xyNsI0 Yc/7Xh8RYxPYgx4sbJBdPt0K5tGyHgfJY190los3kKUuBVuRLfkL9K3KaCWw6opA4DoR zTU1fM4aP5RHOUuVWHL267ECyVZQomA2xvajwxriqEuPtxCAmkcgaC2xnP8BERSWJGsp xt8bGRhOl3H6uFv1zqXB7wKMyRc79EpmiUIJFyZZVVuXAt9gN9xDYJwFmr9mdmdjtP0H g5zA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=eA0x4JCi+JyPKsZLcRH52SdlMvZD8FLMA9pRbfG8Ano=; fh=5rd9cdEW7nS/uufM5EghkBmwWraJMZ40dqqhMXcN8Jk=; b=OF3ntU4C7d4ubGF4y5S7x2nLUpP0SphFTO9/oZtEPHOedKfFzzePr0Wod2yv6j8fxP wJ1636TeE7fYeSGBFcY/SeHxpfZIlnPHwjfT0XS3Ihkdw0DijgcUXqXGsMcWmYKyf93V 97oSYCU6LrzvUYUlXPDPjfcBeOJVATBS6QWSKYz8Dm0eGiAFCwj9CMJ1tsYocaIAk0Lm wG7P5/loAJtETyhSzuDdFf+HiPmZgpSOa3vJfI5t3j2VEc2RwGr7pZB9iddIMaQ9SeI8 I9rglPlN+Jr/hPGBat6lM9GE0yw4fFxGidpyRm/F/8cDdS3W60H3Sj0XFsievi0l0Pe3 DUpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=Lxb87qz2; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-49818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru X-Forwarded-Encrypted: i=1; AJvYcCUq7CJvKkxAneuGKZm/vI0Djrks04GdKYAoGt0fSFH/zUyAFENxPefkBXWpcGb1aYu9DBA8uxXsEbqA7OZymryD7RIbDpov9dO9UYZ5cQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a24-20020aa7d758000000b0055f19a32eb2si762224eds.451.2024.02.02.04.13.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 04:13:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=Lxb87qz2; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-49818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 254621F29E7B for ; Fri, 2 Feb 2024 12:13:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F0F814079A; Fri, 2 Feb 2024 12:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="Lxb87qz2" Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E41914199F for ; Fri, 2 Feb 2024 12:13:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706876021; cv=none; b=FKhUbuw5r+AvOCIxin7PD3Z+pXo64dGusul+c5mBxh5lSMSrJVyVuR7FND6L8OynUcuBO9zx2zimqsExW0jrTzXACzKhFUqMtxzjC1SmLir43+u6aIh5wYPDJ7J4x97spfXt+e+NMfJNmUr/NB0GKQLpw5GNDFds4hM1+/cH8aI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706876021; c=relaxed/simple; bh=/MYz96hTgmyfUKN8lIz6Wn2kXH/W5xiuldsDugYBDUE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gO9rb3nXrQhYs+WrLACGRHyOwMuffPkvV6DQyXN9Z56hmFqGuA3W1/8nvJqWjlGYJK6DE3lkGXRi9io9DFscKQaPI8DeC78y14d0GkMmFlfU10xRfOqSCOvNpGev9lZPpx5BzS7kiVelPxLZO/vFFTfKLcbdaeuYSIPoAryDnbI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=Lxb87qz2; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Received: from localhost.ispras.ru (unknown [10.10.165.19]) by mail.ispras.ru (Postfix) with ESMTPSA id 96CEF40F1DFF; Fri, 2 Feb 2024 12:13:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 96CEF40F1DFF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1706876014; bh=eA0x4JCi+JyPKsZLcRH52SdlMvZD8FLMA9pRbfG8Ano=; h=From:To:Cc:Subject:Date:From; b=Lxb87qz2ETojmszILfllYWsjKulf2HoQQ2pH6pW1jgMjUGenElWZsVzl45cgVNr0A sKxOtGaCxs/8+lsr8G8Fwr5zE+9VuX8VECkEA73KVIdeY8bzX/DR467QNniwXGxZpO /gAcpDzTDCP4pBUQGJNaZfLK9QUckjgxYFbVLh9A= From: Fedor Pchelkin To: Dominique Martinet , Christian Schoenebeck Cc: Fedor Pchelkin , Eric Van Hensbergen , Latchesar Ionkov , Venkateswararao Jujjuri , "Aneesh Kumar K.V" , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org, syzbot+56fdf7f6291d819b9b19@syzkaller.appspotmail.com, syzbot+a83dc51a78f0f4cf20da@syzkaller.appspotmail.com, Pavel Skripkin Subject: [PATCH] fs: 9p: avoid warning during xattr allocation Date: Fri, 2 Feb 2024 15:13:17 +0300 Message-ID: <20240202121319.21743-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit An invalid server may reply with an xattr size which still fits into ssize_t but is large enough to cause splat during kzalloc(). Add __GFP_NOWARN flag for the allocation. It seems client side can't do much more about sanity checking here so it's better to return ENOMEM silently. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 85ff872d3f4a ("fs/9p: Implement POSIX ACL permission checking function") Reported-by: syzbot+56fdf7f6291d819b9b19@syzkaller.appspotmail.com Closes: https://lore.kernel.org/lkml/000000000000789bcd05c9aa3d5d@google.com/ Reported-by: syzbot+a83dc51a78f0f4cf20da@syzkaller.appspotmail.com Closes: https://lore.kernel.org/lkml/00000000000086a03405eec3a706@google.com/ Suggested-by: Pavel Skripkin Signed-off-by: Fedor Pchelkin --- fs/9p/acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/9p/acl.c b/fs/9p/acl.c index eed551d8555f..e19a46192d2e 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c @@ -29,7 +29,7 @@ static struct posix_acl *v9fs_fid_get_acl(struct p9_fid *fid, const char *name) if (size == 0) return ERR_PTR(-ENODATA); - value = kzalloc(size, GFP_NOFS); + value = kzalloc(size, GFP_NOFS | __GFP_NOWARN); if (!value) return ERR_PTR(-ENOMEM); -- 2.43.0