From patchwork Thu Feb 8 10:46:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Adam Davis X-Patchwork-Id: 198287 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp78831dyd; Thu, 8 Feb 2024 02:47:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXrgJNNK2vO71n+dXYWx/ndOsBn9nokXKwTY5PXgkACMHi09kFZPvOWESOWyOVQv9D0l2ub2A8GNvVzIRb5FHVvWnd3vA== X-Google-Smtp-Source: AGHT+IGR/dLhBMs41ASjtdBf1HcKKUUnDRGTnSWzHUaZXsi8UYrihUTR/QFHDk7IQAELxZlld/ke X-Received: by 2002:a05:620a:6108:b0:785:a9b8:81c7 with SMTP id oq8-20020a05620a610800b00785a9b881c7mr603104qkn.53.1707389256740; Thu, 08 Feb 2024 02:47:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707389256; cv=pass; d=google.com; s=arc-20160816; b=YA8/ZmFtI5LO+rjk74SnNHClIt5NAHdIasu8/7SNW/RiyJddQHITa5grVT0gPPZlL2 4xs3c5BADJIh1u//rHngYHX/JtKsXs/qfGx4LiCcpzojIMs19IyyBqv6u0cUO2i0T5uu tvpHi3fWrOEeNbymftF7Kuh0EI1qoMhh5D6DTTs8jGTyfn13BlPAHPpwwdNg4jC0taof wLAXJXU7r3WfpwQzl+SGFRDtUnzAvYtY8s0Szgt06Je9R+a14J2tRVINTyW+14vkuucH hFbUSHMX2QvvxtLTjgqGatr5UbKLMJlgeM0rJ85NX+FDWCqhXvC1sV5EmhvTf+XechJ7 CUuw== 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:references:in-reply-to:date :subject:cc:to:from:message-id:dkim-signature; bh=hcbbJhAls5Uesp7NyjBSOyZ/XNieAhW/QJoPzNlPnlQ=; fh=ulOlP8Qv5Oeioh8z09jnxNlKa4MqDp6T9uGdJoc+oa4=; b=q/YzuS1Pp3oTEpW/ktrWJ+Pd+2v0J7WN3Tj13KbCtQnJoOZNavbsLePMgxQl8p7F/7 NBuJxieuj2JJvl6NhMjSspiFfsAhEenRqzPlLYTGXIglUZpy4P4fxSV/n+BZSp45ZULi 7xLvs8juhsLTS+dwvxZC/zMmo9tziH/Ass6wz3pHkLukyTLOOTXYBk/dOVor2bXwKaKR dtazb94n0RBwD3G/VjHXoQGEtPLBj2yhLQxtJ/sFwPqgt0XKHv0Uiltd0CCC3ckzGMYP SZUMLtC24ZFk6BkjtOpnQ9TdYRgcnewx77UK+HUETylie+BFVUh8cLgqmiEmtZdIIlfF +hAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b="ac6vJ6/s"; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-57883-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57883-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com X-Forwarded-Encrypted: i=2; AJvYcCUfcbwDmm5hIkkCKTCgc9pdawd2DhuUDs2J36o2yCPS0AMBIgF3IdPE8ZjS+NR6+ByR9unsC6IpHsdxFoZ6F0qqEiniyQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v1-20020a05620a090100b007859f20c29fsi2528981qkv.616.2024.02.08.02.47.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 02:47:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57883-ouuuleilei=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=@qq.com header.s=s201512 header.b="ac6vJ6/s"; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-57883-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57883-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com 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 842311C229F1 for ; Thu, 8 Feb 2024 10:47:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A20916BB3E; Thu, 8 Feb 2024 10:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="ac6vJ6/s" Received: from out203-205-221-173.mail.qq.com (out203-205-221-173.mail.qq.com [203.205.221.173]) (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 88A8C6D1CA; Thu, 8 Feb 2024 10:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707389233; cv=none; b=ZFgf7Xz9SGb9Gwlh29JNHpr/ccgG2Jm+EYVz9WSqcBnTifC2uPHyubjpWO9FfJh8Soay9wwBClBNOmJOz585IbXQRw4vd+GFGdik4ST8+B57Wa6luUF7pmdxFCOAcALwQDliGLP6heyxwMwDuIXD22CbZrhjCdCdcGfBjQT2kcc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707389233; c=relaxed/simple; bh=h7tpdDW4CcqCKn6XE4h5OZ+mpFGC6zQVQuoEeBaQ7bs=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=iSWZ0fA8h8abFlN3CZ9zKBZzbVjxjwnPh+ubGAbnyVDzRXjqAJCn8Js2rjwyzrQfZeJ5BgL8ZvuZ+0MELtAeWn6IxkAzyfTxvTpC5V2OENaTzyXgVny58xZ+7TDKSXNKfJ/G4XOmIaPPRJjj55IqXgOaDKz4k9SLA1+ki96CY08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=ac6vJ6/s; arc=none smtp.client-ip=203.205.221.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1707389218; bh=hcbbJhAls5Uesp7NyjBSOyZ/XNieAhW/QJoPzNlPnlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ac6vJ6/sCj8BTEThK4epPx9UY1M539mgYjxNZeZLBmCAJXTI2kxgox85oxT6Dk8Th wvOsO5koDxJl9IgHxzXdKZ3h2+1RcgO29os9V2lhvZr22/3Miqpef/K7ypv2xj15Gl 0JwDH8DJjhbQXI7PaWILj5gT13DixyDTIimvINik= Received: from pek-lxu-l1.wrs.com ([117.61.184.234]) by newxmesmtplogicsvrsza1-0.qq.com (NewEsmtp) with SMTP id BB7060B2; Thu, 08 Fe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dU= From: Edward Adam Davis To: syzbot+8e41bb0c055b209ebbf4@syzkaller.appspotmail.com Cc: gregkh@linuxfoundation.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, rafael@kernel.org, syzkaller-bugs@googlegroups.com Subject: [PATCH riscv64] kobject: fix WARNING in input_register_device Date: Thu, 8 Feb 2024 18:46:55 +0800 X-OQ-MSGID: <20240208104654.3757719-2-eadavis@qq.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <00000000000047631d0610d010c1@google.com> References: <00000000000047631d0610d010c1@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790327397508201397 X-GMAIL-MSGID: 1790327397508201397 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. 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 */ #ifdef CONFIG_UEVENT_HELPER /* path to the userspace helper executed on an event */