Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp865095pxb; Fri, 22 Apr 2022 12:59:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5tU2w71wRBdtTTIO7kyMbD0rtqAX65HDMLeDuJm4S1Rx7y2FN+WK3g+xjAB66JoscUz5b X-Received: by 2002:a05:6a00:996:b0:50b:76b8:3bb1 with SMTP id u22-20020a056a00099600b0050b76b83bb1mr6518358pfg.9.1650657539928; Fri, 22 Apr 2022 12:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650657539; cv=none; d=google.com; s=arc-20160816; b=n6/Ol6Kylnl1pcf8E57ChsAcupGTiUVEUyJFLcXyyfZIWQKhbHBUbKt+6jFU5Ajeuz 8b3CNY4uSVg4BdHzKY5j5YhadAaXX4ZYY+JrG897k2A9axxOO43ElfevcPjkgj9osyv8 vcC+Unwrht6IJw+k6U4QFCa1sQy7ic9Ve8dM8U1E2LliUEt61LnJiiq7RvByJrbW1pHx nIQ97ankmITzWhvR6C65G//h7bBwSQGq1u7MnCCeptGswIeJEbTq65pGWFHao6xgrOTT DX0lwVRa3u8h6d+6hqo1N2LUqi6o8M1A4p9ahrVaGlmdnfEj7GFtaPpH15POG+3Q9RFM sl7g== 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:to:from :dkim-signature; bh=5sUaNXOTPfSNutP1Nw7SXQWnMZHzjp1ss3S3Q/iiVUM=; b=a09czuusVuBzANHhnvir+c6IBTYXqdc8fgLATTBm5X9PwaEmhuQPRdgoGUAX/wPZ9u b6bBCDPU6+Qw8JwIO71D3hU9BfzkZ2wKr11H0wspYZ8OrDOU38U7EBvNW4okJBTrZ0h4 3VbOc9SDLgpVIb1qKaTlgzugXQ57NwV0P9z6dOz0tiR+eUWEwqKGtVRPnMRJ9UzTMYJY LthHwesb/cQs9k0cF0VRXSiT7P81HaTxJZmO2mmaJjEGcM/I9JQxcr9Qie1izsL/7Sv3 XhZrCChavurvkT+jk/efk118qpk/kFz+3Eg9kwC6MaE7/w7w5MkdIxXU++kGAiQLRF3y dQQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DqqHDeRh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u20-20020a63df14000000b003816043efd3si8840520pgg.456.2022.04.22.12.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:58:59 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DqqHDeRh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6699CBE9F4; Fri, 22 Apr 2022 11:57:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385868AbiDUHij (ORCPT + 99 others); Thu, 21 Apr 2022 03:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385859AbiDUHiY (ORCPT ); Thu, 21 Apr 2022 03:38:24 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24386DEA4 for ; Thu, 21 Apr 2022 00:35:35 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id A62691C0014; Thu, 21 Apr 2022 07:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1650526534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5sUaNXOTPfSNutP1Nw7SXQWnMZHzjp1ss3S3Q/iiVUM=; b=DqqHDeRhUgldMcsQYFpqSMHOXjUkSTLj0wpr0kTgrr3W3ou2YcG22IF0xK77bUqWH9paZn WG2Sy5RHNhqVKmjvnkVmnyqtYuFShP1GV99cfNy/Uy73y501M8I5+e+Qi3hR8OithBlC7m 7Oeez/NM8/i22HCoyGgHCyT3xD2gJ3cpYPQgwRkJY+4VCAWs0HCsNoh1HsL5AiLSpztvqE u62HdYhqZJRJP1BOSFoPuQHo3SR72pG0KIP7nbixy5ug6HD2rtZfnP/3rzVcg7Th3NQ/du LJohDkDLxaKcTIsFfzfK+sDf3VtZtQqByYbmjYjJLQgD9jej5aL9iuYAPWp2QA== From: Miquel Raynal To: Oleksandr Ocheretnyi , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: fix 'part' field data corruption in mtd_info Date: Thu, 21 Apr 2022 09:35:33 +0200 Message-Id: <20220421073533.71758-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220417184649.449289-1-oocheret@cisco.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'37c5f9e80e015d0df17d0c377c18523002986851' Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Sun, 2022-04-17 at 18:46:47 UTC, Oleksandr Ocheretnyi wrote: > Commit 46b5889cc2c5 ("mtd: implement proper partition handling") > started using "mtd_get_master_ofs()" in mtd callbacks to determine > memory offsets by means of 'part' field from mtd_info, what previously > was smashed accessing 'master' field in the mtd_set_dev_defaults() method. > That provides wrong offset what causes hardware access errors. > > Just make 'part', 'master' as separate fields, rather than using > union type to avoid 'part' data corruption when mtd_set_dev_defaults() > is called. > > Fixes: 46b5889cc2c5 ("mtd: implement proper partition handling") > Signed-off-by: Oleksandr Ocheretnyi Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks. Miquel