From patchwork Mon Feb 22 20:47:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 8382941 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4D345C0553 for ; Mon, 22 Feb 2016 20:47:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B53CA2040F for ; Mon, 22 Feb 2016 20:47:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C1E120531 for ; Mon, 22 Feb 2016 20:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755544AbcBVUrJ (ORCPT ); Mon, 22 Feb 2016 15:47:09 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:49801 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752980AbcBVUrI (ORCPT ); Mon, 22 Feb 2016 15:47:08 -0500 Received: from lanttu.localdomain (lanttu-e.localdomain [192.168.1.64]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id 0C4DD600A0; Mon, 22 Feb 2016 22:47:05 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: mchehab@osg.samsung.com, hverkuil@xs4all.nl, shuahkh@osg.samsung.com, laurent.pinchart@ideasonboard.com, Sakari Ailus Subject: [PATCH v2 1/4] media: Sanitise the reserved fields of the G_TOPOLOGY IOCTL arguments Date: Mon, 22 Feb 2016 22:47:01 +0200 Message-Id: <1456174024-11389-2-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456174024-11389-1-git-send-email-sakari.ailus@linux.intel.com> References: <1456174024-11389-1-git-send-email-sakari.ailus@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sakari Ailus The argument structs are used in arrays for G_TOPOLOGY IOCTL. The arguments themselves do not need to be aligned to a power of two, but aligning them up to the largest basic type alignment (u64) on common ABIs is a good thing to do. The patch changes the size of the reserved fields to 8 or 9 u32's and aligns the size of the struct to 8 bytes so we do no longer depend on the compiler to perform the alignment. Signed-off-by: Sakari Ailus --- include/uapi/linux/media.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 6aac2f0..1468651 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h @@ -302,7 +302,7 @@ struct media_v2_entity { __u32 id; char name[64]; /* FIXME: move to a property? (RFC says so) */ __u32 function; /* Main function of the entity */ - __u16 reserved[12]; + __u32 reserved[8]; }; /* Should match the specific fields at media_intf_devnode */ @@ -327,7 +327,7 @@ struct media_v2_pad { __u32 id; __u32 entity_id; __u32 flags; - __u16 reserved[9]; + __u32 reserved[9]; }; struct media_v2_link { @@ -335,7 +335,7 @@ struct media_v2_link { __u32 source_id; __u32 sink_id; __u32 flags; - __u32 reserved[5]; + __u32 reserved[8]; }; struct media_v2_topology {