Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5069455rwb; Wed, 21 Sep 2022 02:45:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4dmzc2jm7QWho/yyrxbij4iddZld9eHJYWXGJliacGJ232YnkuNF1tjlhjfMHEa+AwQxPX X-Received: by 2002:a05:6a00:1a8f:b0:548:8ce8:db73 with SMTP id e15-20020a056a001a8f00b005488ce8db73mr28500627pfv.10.1663753547916; Wed, 21 Sep 2022 02:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663753547; cv=none; d=google.com; s=arc-20160816; b=mXLJNwC3oXEq3rLoFYcGgxV47i+JAp5exhtws5BYlB1L30euCllExEdBA++vXhp5/H Dk/b9hkQ1IIud9ZRsJ6WRZQr6qntSuhSZ9Bv3UCC1Tsy35/ctZGVosQAq+xNepnQOdKJ 5LsAqp098+qbs+qI6w96Cv5zp4kltfdY/1FK3F03SUIin48p6K9fQLXn7VyEM4MS7Xuc gEbOC7vhiDWjNYH0ltXcCeWzyYN2QFguAKu2fHqEJemQqEG/Sr1Osxx1PQ90EV0v5u2V cFnqaD/WC1oLo/NC6A34mzY4HBdtcVFysA/RlRiz0kOuU5KMWzyf7smzEHGumn3/zfCa d5LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=d9cbzyFuyH09NAncmcdVqfJayfGYNOCh5xOhUfCxaJ8=; b=Q9xGX+weM5zIPcnKdRQTyDWDkivue6wP+o6vFwSr2kjk/DIssgSpClIxkl/eN1GQ+C wzc5ANji5kEOuVjmOPBCpomC3l340JZBduKVhgeva/YXeYNJUGFi38ctbn1a8xCSdrSj WwHvvMNpEL1sOW5P9PtDeYZjP2aAESBqSqmBrkXC/6FO7SII+bz9V+oKtMp+3JKQ6qmy 4PXZrZaJ/OJ5J1ms0iWyiKzTieqnY5sVLTKLDgjaDMcoZOF2k2lSY67hTGbtUlMfQ3x2 EcmDSYLUNxAxJLYQeEQHEB2Gz9n3hvGEylaZxNmKhL/RsCMLfi+vwIodGQucTnM9C8vd WP5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZnDnZ51E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170902e80500b0016ca4b6f18fsi2339469plg.63.2022.09.21.02.45.36; Wed, 21 Sep 2022 02:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZnDnZ51E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231371AbiIUIl3 (ORCPT + 99 others); Wed, 21 Sep 2022 04:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbiIUIlR (ORCPT ); Wed, 21 Sep 2022 04:41:17 -0400 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B4E7EFD3 for ; Wed, 21 Sep 2022 01:41:15 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id F0E0624000C; Wed, 21 Sep 2022 08:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1663749674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d9cbzyFuyH09NAncmcdVqfJayfGYNOCh5xOhUfCxaJ8=; b=ZnDnZ51EEuIeSc/H/wAUhgxkQDL3Xs+bZS6dgEzs23GnOOAg3BaXHX9xYxpzcbFnjePweV oXaiQ3sCYfMC+hnyJfZhNEuL5cLELdQH9CeT4d/I7TaNOKWBiB2tbg2C4j2Iggjw6ghB98 n3FmDYrKFg4Epg/HpZUIuBp4daAYYZxUZPuHMxwEEN6aNen1/Pkvz8W1cGuNB+9l4bl90M JNXeU1gKecYT/+YTEV5/mTaO9qThJFHq04WlDzGIvQBd164Yd/SsUDVYSkr+ZGrz9Y946M bfunZQk6hoZqLr0FEv6dfjVioqmdleFGkTXuPmCImdnO0vL8jc84G3DoS9HOyA== From: Miquel Raynal To: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Boris Brezillon , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/4] mtd: always initialize 'stats' in struct mtd_oob_ops Date: Wed, 21 Sep 2022 10:41:11 +0200 Message-Id: <20220921084111.733303-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220629125737.14418-3-kernel@kempniu.pl> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'745df17906029cc683b8b5ac8bcb08f82860baff' Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2022-06-29 at 12:57:35 UTC, =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= wrote: > As the 'stats' field in struct mtd_oob_ops is used in conditional > expressions, ensure it is always zero-initialized in all such structures > to prevent random stack garbage from being interpreted as a pointer. > > Strictly speaking, this problem currently only needs to be fixed for > struct mtd_oob_ops structures subsequently passed to mtd_read_oob(). > However, this commit goes a step further and makes all instances of > struct mtd_oob_ops in the tree zero-initialized, in hope of preventing > future problems, e.g. if struct mtd_req_stats gets extended with write > statistics at some point. > > Signed-off-by: Michał Kępień Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel