Message ID | TYZPR06MB6568A36C5201185B4D3F80C0F139A@TYZPR06MB6568.apcprd06.prod.outlook.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2241110vqt; Tue, 18 Jul 2023 23:44:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlFK1v3kamtt8rOqvFa4i19xZ2EGOQzpZX/TTjq0Izo0xUUGnB+PRLvTlzLiS0NETxcO9Agg X-Received: by 2002:a9d:5e99:0:b0:6b9:848f:8ae3 with SMTP id f25-20020a9d5e99000000b006b9848f8ae3mr14994677otl.30.1689749091239; Tue, 18 Jul 2023 23:44:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689749091; cv=pass; d=google.com; s=arc-20160816; b=ZrkTo9GheCvS/sFn2JKiH5k2A9eq/G11JClAzSTrhNjY538VvrKwORk12+VocxHn86 w4frSqtfzmKN0ixrDZXdx0mKE34iReTf+cNvFm4YSgpTou+vdEjd7rTVSWl4nvsGgHpA Yg+j3dPobm2BR8xHEbJkdKDAONk8bCO6AsfjbsicfvGhcyfJuEc5llGjOyoYP27U0V+3 1c90YARPWRyhBFaEg37hSiYrFlEWChQ+9r1cTRI89j+tUOEbKZIZWR53u5TmGAVbvh/S O0LLSfiu5o63bq2mpqdQtwOq6AgZBd/lDGvGxI25KfbIepfNRtOvo2gDyrJCZ58UDcUu 6nRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:dkim-signature; bh=pQbB9AeJxrvjKq2Af2sz4lX/ZqNpRW1aGmgojZJpt7E=; fh=JNPCH8DldG8ivnqetc2anSRDBmNuJUWPOXvQMMRrWBk=; b=U7yxxGMYgSiQCAroCdhL/A3LV6mj2d6J+viJtyFiaHjYPHd9gzfuenhx0vbq0C2tri BsnUI7qCSpu29WZXRJIg2Z20s6yTZvux//ie5F9bIDtvnf3p++iIDvQBDZSUY8S8FyFI jYTbw8hvwP4qxpZNJekrqIgAPU+ZujOMlSO3Or/s/OImuQjBfrNxnL2pD3kd9yJJaQT4 eOJd47JgN+z0qztuG2rofGe4Slf7RlSDlSTn1oQmUda8gv3tXPmpube3EKJFyN1yWyfE bwzr8NQUZB/e3+kmiuHo2uuVmMXa9xC3gGAkF07PdrxmIAVhYNJQKSObwRRcdP2kUAZJ BLkw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@aspeedtech.com header.s=selector2 header.b=cddBzSLc; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=aspeedtech.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b005577fd7efa2si2615628pgp.444.2023.07.18.23.44.38; Tue, 18 Jul 2023 23:44:51 -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=@aspeedtech.com header.s=selector2 header.b=cddBzSLc; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=aspeedtech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbjGSGdZ (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Wed, 19 Jul 2023 02:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbjGSGdX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Jul 2023 02:33:23 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2118.outbound.protection.outlook.com [40.107.255.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A4611FCB; Tue, 18 Jul 2023 23:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lFaoU1KckSwsbkAZXevH0XK34kzdsMYq4pQFJL52hdGZLZozdeyjGN9ChmQ5xLJt0emUF42TpP/33cdemZ4stU7ZL+6Az7WqsAKpPS+5Rn0wYeEZABXUl48au1ePw1A62Kw3xSdpN/txFaDBgCldviLGWLhoasie49YVrNvfhChD39MmQ2993OJGaVD14z0xv266XEwVtsbag5kuM6gurkyWmb5qUCRMyesmd+jj2AqcMc0ERyyMYm0jyUMHBc5OXMMaUdlMD/gtCPu+3xLw5cxO0p6GYBB3Yw/jM34i8nL4IrYZhNv0y35zMwPsefUlr6YRqza4OCOD+5jDiAdCcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pQbB9AeJxrvjKq2Af2sz4lX/ZqNpRW1aGmgojZJpt7E=; b=b+sBq5reIA2kGvfbrIHHRIGxKzn4ebqSAqvNRhNJEI2MC/dkowuHnC0gNPSrf9hUqFYoFOgszEaeucn3fYRoBmfWrLmEhCvvHSsarCZcJ1nKLkDFsY/1y1hf0IlDnzXKXyN7TDtOc5z4Mw/nQQdTbeN0Wu7Y8EPDR6vPnX2OmlOKbgcdgalaYLK/+FUsUIiwuE2ep28zMzqm8ZYZFSRqPxdLtRn2X8L0D5hH7sN2qQALdtaWdalz99jlCMUXVkKnA+JzI5BDwvnFGNo93QO68JyHAsrrdReCli7HN4+L1zeEeZ2rnhkhuN5ThteIPASgWCW426ErCqmsGQQK+9bYwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pQbB9AeJxrvjKq2Af2sz4lX/ZqNpRW1aGmgojZJpt7E=; b=cddBzSLcZfykKYNwjserqse2JvLHIds6bWyrFNGJj5drgFy9WFeFOthoRguP3uY/88LuHKGbpOA6AKLKBgnNVKycqFZvnJwE+NIlO3ghplPoZlVa0c1qlTzdXYXw4KWn1JluG1cDJSEczkAaAyz2gwU3tTmZVAy/yv7LUXYMhQS5T1hqsJbbUf4yxmZzJCz+ZJIwJdKur3L6CChSsJwV4TCIo0bIs2xXcFsLv8d0OdhURPFqCnPtehLATAJnblqrobcpowRezxrjX3C+03+O5+hgVldv0m5w6m+diqFiW9ItsUVFCyrwxMjcSLkLmzLXfwEg5hL/mSznWJR8N5nElA== Received: from TYZPR06MB6568.apcprd06.prod.outlook.com (2603:1096:400:45f::6) by SI2PR06MB4410.apcprd06.prod.outlook.com (2603:1096:4:15e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul 2023 06:33:18 +0000 Received: from TYZPR06MB6568.apcprd06.prod.outlook.com ([fe80::72f5:eab8:7757:7c49]) by TYZPR06MB6568.apcprd06.prod.outlook.com ([fe80::72f5:eab8:7757:7c49%6]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023 06:33:18 +0000 From: Jammy Huang <jammy_huang@aspeedtech.com> To: Hans Verkuil <hverkuil@xs4all.nl>, "eajames@linux.ibm.com" <eajames@linux.ibm.com>, "mchehab@kernel.org" <mchehab@kernel.org>, "joel@jms.id.au" <joel@jms.id.au>, "andrew@aj.id.au" <andrew@aj.id.au>, "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>, "openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Subject: [PATCH RESEND v2] media: aspeed: Fix memory overwrite if timing is 1600x900 Thread-Topic: [PATCH RESEND v2] media: aspeed: Fix memory overwrite if timing is 1600x900 Thread-Index: AQHZugrnPAu3uBx5akaz+7fGPVJhRg== Date: Wed, 19 Jul 2023 06:33:18 +0000 Message-ID: <TYZPR06MB6568A36C5201185B4D3F80C0F139A@TYZPR06MB6568.apcprd06.prod.outlook.com> References: <20230717095111.1957-1-jammy_huang@aspeedtech.com> <21e13f35-5caf-6d60-c388-3386e3540834@xs4all.nl> <TYZPR06MB6568C3CE08659F86C301787DF139A@TYZPR06MB6568.apcprd06.prod.outlook.com> In-Reply-To: <TYZPR06MB6568C3CE08659F86C301787DF139A@TYZPR06MB6568.apcprd06.prod.outlook.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB6568:EE_|SI2PR06MB4410:EE_ x-ms-office365-filtering-correlation-id: 0642e748-6873-4f04-223b-08db88220a26 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NjgC0TbLCCTdYVUm7lxRZNtKNBrHAwEsLnpvX57rof3NfzeZsRK+0K+wCfFTGRX3hCFN4H5lsf0VizKrSwfUXkklysO/RvWT082u1W707t9XU3Xdaq1XjE4xeCiWdykRQKoKhToRagbDmnM0XFiAZzOvxEovyFkSPTqzXkfZ0u1DmVXaPn5wigr/hk3S7t3p4jl34rz9Xnl+SLBmBoKa/kzRlSCTE4cMkQhF6K/g28T4CpJEqbd1bRVWxvyBEorPvN6cxMoDVZGRMgeeQxNo2KRep6KCzuTld5sfQ4PGLYFNAZqxEegVXOMKm+wbwJQ4MylbxyXYWehR4BAnoAihgxEFjXRpOVo3DxxYFTEvSvJZw85l+qBCC9o1nUY/E+xeWaNWoiHF/N0xEdB6muFp2OAQrcLglNt9mhzagb6syOoFegd2urJXdVtrdniVyJum4fhR2h8pV2icIbP9UxyxXOsildn+Yo5tHXd1ILnuyRfQQhmP2Id472+FZXI59rwitbEsKca/jGA5Fzr+3V2XKARqeKlxyL3xlPMxPdAyNsywnTFcS71+C3icPZW+asN5bxiEQdIffDgaSnSQdxrwGHg2ugyEe4O85rlgfpl3Ex+ErYxgNaHKeovDjZwJPFxYEF5S+9dpkvZ3JJblEpzokw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB6568.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(136003)(39850400004)(396003)(346002)(451199021)(38100700002)(7416002)(8676002)(5660300002)(8936002)(41300700001)(52536014)(7696005)(2906002)(316002)(110136005)(478600001)(71200400001)(83380400001)(2940100002)(186003)(6506007)(26005)(9686003)(76116006)(66556008)(66476007)(64756008)(66946007)(66446008)(55016003)(38070700005)(33656002)(86362001)(921005)(122000001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-ch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utf-8?q?dfO/uEiwEUfP2PfJOz/OlFlhHFSBgT/M/+0qerqB3YARGhiFbWvramK1CWIjbJssi?= =?utf-8?q?OpWxOq/8DnGSBHSepSu0akY6IajhehZbvdXf2C307EV812lQM1YmmVodbYo1ho8wu?= =?utf-8?q?qq3o74PxBHIlxlxdrt4ml9HgNtWNkRe2y2oCID6OvD7wHzpBXeM0jszv9lZ54eA8H?= =?utf-8?q?pgmeISn5uKT3/0AQgqXCyjI5hQVkzTYHFrxxF+NXZ9/aIdUMtDvDV7C6+7g9+UvR3?= =?utf-8?q?O2oamlm0/22IcULdjX9dz2I5ixTzHV4UsNVYLFjg5fqClyX9vd9p1VXgtOolzCTaO?= =?utf-8?q?PODpg/sLPJZGrPW6jARacaIXABshJXhVKTTtkoIxHd2IW4+Mn2wEMlEtV6vOOxZFE?= =?utf-8?q?ozQqwumGG4pnaA3qEbGb6nDIQTnBF9DzEacIecK20K8g+CUdWKlXGvVJX6m5z4A8s?= =?utf-8?q?QdI8a8hZ9skLpKV9PnFHm1OYfYhk2e8nzLa+bABe5S8AyPo6/9BPWHgcxCJXdLQRc?= =?utf-8?q?LVZiqLIZ0Ud8/uMjyL9DvLJUrA5rrGe7oISusaXtHAvqBu1VY5tewZiQbHsIYpTAf?= =?utf-8?q?k7rw/IJI9tJnxdcWplF98KEn76eQ2py4+6yuctLcyWN5mZoTxZz6pRI5tXdrxE2K/?= =?utf-8?q?ZeCxUec7WYpSUEMNaqzdliqmTUk7g2LnT/kJGRXURSdbTyH0DZN44bcpJa2tvWp7W?= =?utf-8?q?7wbh4mZnBsg+uHrQin48El30dadr59djMA=3D=3D?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6568.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0642e748-6873-4f04-223b-08db88220a26 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2023 06:33:18.3402 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YGLpzfaGfyjJqJIavt8zmKS5P+m/PnumZmX+ij2Q6r23JwvBTI6UFT5fIXgnuFNps0FtF9wmONy5qSrtA3QvIh3T8fdgEfEFNWp+ut4cwiY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4410 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771663609001424640 X-GMAIL-MSGID: 1771830343026125775 |
Series |
[RESEND,v2] media: aspeed: Fix memory overwrite if timing is 1600x900
|
|
Commit Message
Jammy Huang
July 19, 2023, 6:33 a.m. UTC
When capturing 1600x900, system could crash when system memory usage is
tight.
The way to reproduce this issue:
1. Use 1600x900 to display on host
2. Mount ISO through 'Virtual media' on OpenBMC's web
3. Run script as below on host to do sha continuously
#!/bin/bash
while [ [1] ];
do
find /media -type f -printf '"%h/%f"\n' | xargs sha256sum
done
4. Open KVM on OpenBMC's web
The size of macro block captured is 8x8. Therefore, we should make sure
the height of src-buf is 8 aligned to fix this issue.
Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
---
v2 changes
- Add how to reproduce this issue.
---
drivers/media/platform/aspeed/aspeed-video.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
base-commit: 2605e80d3438c77190f55b821c6575048c68268e
--
2.25.1
diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index 374eb7781936..14594f55a77f 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -1130,7 +1130,7 @@ static void aspeed_video_get_resolution(struct aspeed_video *video) static void aspeed_video_set_resolution(struct aspeed_video *video) { struct v4l2_bt_timings *act = &video->active_timings; - unsigned int size = act->width * act->height; + unsigned int size = act->width * ALIGN(act->height, 8); /* Set capture/compression frame sizes */ aspeed_video_calc_compressed_size(video, size); @@ -1147,7 +1147,7 @@ static void aspeed_video_set_resolution(struct aspeed_video *video) u32 width = ALIGN(act->width, 64); aspeed_video_write(video, VE_CAP_WINDOW, width << 16 | act->height); - size = width * act->height; + size = width * ALIGN(act->height, 8); } else { aspeed_video_write(video, VE_CAP_WINDOW, act->width << 16 | act->height);