Message ID | TYZPR06MB6568A36C5201185B4D3F80C0F139A@TYZPR06MB6568.apcprd06.prod.outlook.com |
---|---|
State | New |
Headers | show
Return-Path: <openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aspeedtech.com header.i=@aspeedtech.com header.a=rsa-sha256 header.s=selector2 header.b=cddBzSLc; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R5QyG1ptjz1yY9 for <incoming@patchwork.ozlabs.org>; Wed, 19 Jul 2023 16:33:58 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aspeedtech.com header.i=@aspeedtech.com header.a=rsa-sha256 header.s=selector2 header.b=cddBzSLc; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4R5QyG0hX1z2yV5 for <incoming@patchwork.ozlabs.org>; Wed, 19 Jul 2023 16:33:58 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aspeedtech.com header.i=@aspeedtech.com header.a=rsa-sha256 header.s=selector2 header.b=cddBzSLc; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aspeedtech.com (client-ip=2a01:111:f400:feae::72b; helo=apc01-psa-obe.outbound.protection.outlook.com; envelope-from=jammy_huang@aspeedtech.com; receiver=lists.ozlabs.org) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2072b.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::72b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4R5Qxt0gXgz2xqB; Wed, 19 Jul 2023 16:33:37 +1000 (AEST) 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-chunkcount: 1 x-ms-ex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wEUfP2PfJOz/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-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC <openbmc.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/openbmc>, <mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/openbmc/> List-Post: <mailto:openbmc@lists.ozlabs.org> List-Help: <mailto:openbmc-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/openbmc>, <mailto:openbmc-request@lists.ozlabs.org?subject=subscribe> Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" <openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
Series |
[RESEND,v2] media: aspeed: Fix memory overwrite if timing is 1600x900
|
expand
|
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);
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