Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp184865rdb; Thu, 8 Feb 2024 03:02:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbja7d4+ebwBLMAYMTv0kiEB9svYHIv1ZD47VocSOUduhzEtxfrK+oZn0exdZU3gLz87Xc X-Received: by 2002:a25:6844:0:b0:dc2:470b:887e with SMTP id d65-20020a256844000000b00dc2470b887emr8582639ybc.21.1707390169584; Thu, 08 Feb 2024 03:02:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707390169; cv=pass; d=google.com; s=arc-20160816; b=YxV/w6vLqu7S8FSx2QEXISzn8Ir+8VPGVbPntaC05QJHfIZHfQvzu3EN+7C9HrbaEb QaIllgbG1yu9xzVx53JCANy3ks7D532FH5ouhD4uXGfRT1R5khQrrYQ7CxJUrJIflC82 sswfbFfWk47OptXccwEk5WLEDeCTRXGc2bIdXB7gGnA8cQSa7HoWzJ325CApsEtHyWL5 xbF7uXTKTXc8yuaQB3kp8ytXowkQ/SarftEZoecZ9N0k9WJDVaVZP1urPtpQ5JGPg1cI LcZzOVT/Cu0AoqznrM47ZTszYJS6P+0N01ZJ4R3cRrVDSF6n/pzJuD1wIKUnsaD1ISbx hfHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=p5vbbFhCn6+mcFfX/Bbdzb2TNUXSGCTUJonCB0G02iA=; fh=sSjC87DMGEq/TiJnW3Mq/gWANjgILV6t7R1u4TJarh4=; b=g52T7UoQvosnAlADfvmIgUB1+aPBcObUBv6B9h+CW7SNI9mRsZ3mHbhzNejxnhoaYv QUTry+ELXUbBZ+jpcccvuipUciQbUyPsOPj6H3iB2rAVqG5DYdBH3NPyAMoFiSl1dIcy Yfi2gw2b0lNkTdDcUs2nMsTKuzGA2mkZmMmvcy3zYPG3wVM0U6n0ZUB17Kw79uAbLGiB gCSTPGoBe2Qhumbp1Yr/XzaLig5D410aSrhH+otfq0jfBV/yEF/1Uv9dcV69QfoViPsK 4W/eIAJc2qoW4zbm4S9n50P0ej99s6hVlSqM4HXaZL4QeAjwcg7608WLJpKF3jCNO/g3 bSsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CU1AlERc; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-57926-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org X-Forwarded-Encrypted: i=2; AJvYcCWlesp1D3UwIGFRd6pz3nomy1JESZGl63F0XoV9ivYnZSdKWsVKzmBta5M22hDbAWa9BHkzWQ4EYBxe0VelBCsjwXRMsGfds05YuACtFQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o6-20020ad45c86000000b0068cc1bb8ed1si2539199qvh.381.2024.02.08.03.02.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:02:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57926-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CU1AlERc; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-57926-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3C07A1C264DE for ; Thu, 8 Feb 2024 11:02:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0346B6F52C; Thu, 8 Feb 2024 10:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CU1AlERc" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B5176E2D1; Thu, 8 Feb 2024 10:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707389764; cv=none; b=VGpGDvRLIGcitcjZqhkMGgKnUJ/+195HiLYNqIVPah9y/qAu+R57zBEIzcTGpiUiv2k+6XhiY4AYr5gBeoPTH1PXXmgP12dNSKvS2QQIuvZtd80gTpH5edKVxMyUnCOk5rSnBQb7OqiJUYhLp4Zqy57p73wb6mu/5kzceFxUxhU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707389764; c=relaxed/simple; bh=8Z4tyBCIZ1+COc9EX7GYyGke8vZAkKNTm/jG3Jij07M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J5VVrMzHU+KQYOi0c4QQXPmOFQf6cP3DOC/NmUrxeCbemSNTWrLMwqDutm4RU32zX5uOlHP0JfKR++YtSIH0fZYtALEdNvjym0UKq/88g1B+vATfierb9F20oF8ABnKz1xPaFAMmPHbxiS8tkPlbuhxt7dcyqsBrFXorDOix4CE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CU1AlERc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03D79C433F1; Thu, 8 Feb 2024 10:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1707389763; bh=8Z4tyBCIZ1+COc9EX7GYyGke8vZAkKNTm/jG3Jij07M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CU1AlERcPKXuwdF+eZN8gCem9/7c6zgZJoUa4kvIR1dS4d5/54cJPZy9KholIOVjZ RFuMOeC0rFz9SM2f1U+zHVMvzn8jiJ9huBfGWAlo3+d4g8Pwl2HIZX0w3oQu30wOyR thJJFOUNZn1IOBpCsZCEghjJhDbC7QjJA5nBfC+k= Date: Thu, 8 Feb 2024 10:56:00 +0000 From: Greg KH To: Edward Adam Davis Cc: syzbot+8e41bb0c055b209ebbf4@syzkaller.appspotmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, rafael@kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH riscv64] kobject: fix WARNING in input_register_device Message-ID: <2024020812-snowbound-version-6bfa@gregkh> References: <00000000000047631d0610d010c1@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 08, 2024 at 06:46:55PM +0800, Edward Adam Davis wrote: > The input_add_uevent_modalias_var()->input_print_modalias() will add 1684 bytes > of data to env, which will result in insufficient memory allocated to the buf > members of env. What is "env"? And can you wrap your lines at 72 columns please? > Reported-and-tested-by: syzbot+8e41bb0c055b209ebbf4@syzkaller.appspotmail.com > Signed-off-by: Edward Adam Davis > --- > include/linux/kobject.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/kobject.h b/include/linux/kobject.h > index c30affcc43b4..74b37b6459cd 100644 > --- a/include/linux/kobject.h > +++ b/include/linux/kobject.h > @@ -30,7 +30,7 @@ > > #define UEVENT_HELPER_PATH_LEN 256 > #define UEVENT_NUM_ENVP 64 /* number of env pointers */ > -#define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ > +#define UEVENT_BUFFER_SIZE 2560 /* buffer for the variables */ That's an odd number, why that? Why not just a page? What happens if some other path wants more? And what's causing the input stack to have so many variables all of a sudden, what changed to cause this? Is this a bugfix for a specific commit that needs to be backported to older kernels? Why did this buffer size all of a sudden be too small? thanks, greg k-h