From nobody Mon Feb 9 00:56:05 2026 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="Lxb87qz2" 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 functi= on") Reported-by: syzbot+56fdf7f6291d819b9b19@syzkaller.appspotmail.com Closes: https://lore.kernel.org/lkml/000000000000789bcd05c9aa3d5d@google.co= m/ Reported-by: syzbot+a83dc51a78f0f4cf20da@syzkaller.appspotmail.com Closes: https://lore.kernel.org/lkml/00000000000086a03405eec3a706@google.co= m/ 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 =3D=3D 0) return ERR_PTR(-ENODATA); =20 - value =3D kzalloc(size, GFP_NOFS); + value =3D kzalloc(size, GFP_NOFS | __GFP_NOWARN); if (!value) return ERR_PTR(-ENOMEM); =20 --=20 2.43.0