Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1112970imm; Wed, 1 Aug 2018 10:23:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeIxMTTekgG3EEKrQscFEXfrdyDCNbSAFKwRIb4Zf74gCJCilD5ONZ8vbWMp1YWaUhoBpnl X-Received: by 2002:a63:4e25:: with SMTP id c37-v6mr16417476pgb.6.1533144206957; Wed, 01 Aug 2018 10:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144206; cv=none; d=google.com; s=arc-20160816; b=SsceOBsEHBu6aj/8/yg77izxeUcSNXh/3YEQbc4Dh9Eg/KQjbP8Afm8cVfVLTEjDcA AXkgpbvG8ll71iwPv6fUQr1r4XmnhD5LcH5kMB0LDGTB1KBlFOOpSiN18m6lhJ2X8+Dp lx6TEKy2jM75D6b7sehZONgaj8fNy/yO3abdjFoOx1oLm8gTIPnOQqggL4QhXKzh/WIt 2cpIj1cMkLuHkWwWMmQCUHYLv/77aJvXrRzB2rC60rDRAL+11qU8X7d8WiZ689RwLsF8 DXHTKDHLg7wmBWMgMp/fhDbaYr57fOe09t19MB9U1N0RkHKtDOPLfinsJ2O97qxTGhNK pnbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yPpIzkx7Rfh4ubry+sP0UA5brJB5YpWzUNWU43qIOto=; b=IPAPuMlczjTGfjctDPNMv86cvJQI8nN67vWSJi23XxBE6Tgxy7HmE0bcj+2ZuoOIKA 4WVVogUoMZVgXU+VetCg4GRDE/jZ2aAeKnpkUoeFzdDV3///t0jPw4E6zk/dIuEhxcXt VhGuAQC7/8SX78B2M3vyK2SNGvSoDv0ZAjXCZqCvyqZweuX6VDMxdfA+0WddtVgdADpi TOyoWhVWuQx8v/oysBrRMDXyrtrEYYM9Ua7W1nHwPuoDVxcUVIeb++2B/DdSVIO9fmm3 107KAg3pHb1Y2JKU0kIXXPdWNyRn2wooB4nEql97Y1XvEK3Y/Hb1vhWLHgdRjn2kWLqk xHDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13-v6si17286986pfi.147.2018.08.01.10.23.12; Wed, 01 Aug 2018 10:23:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405562AbeHATIH (ORCPT + 99 others); Wed, 1 Aug 2018 15:08:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49350 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405022AbeHATIG (ORCPT ); Wed, 1 Aug 2018 15:08:06 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CBE6ACE6; Wed, 1 Aug 2018 17:21:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sami Tolvanen , Sakari Ailus , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 153/246] media: media-device: fix ioctl function types Date: Wed, 1 Aug 2018 18:51:03 +0200 Message-Id: <20180801165019.056165850@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sami Tolvanen [ Upstream commit daa36370b62428cca6d48d1b2530a8419f631c8c ] This change fixes function types for media device ioctls to avoid indirect call mismatches with Control-Flow Integrity checking. Signed-off-by: Sami Tolvanen Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/media-device.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -54,9 +54,10 @@ static int media_device_close(struct fil return 0; } -static int media_device_get_info(struct media_device *dev, - struct media_device_info *info) +static long media_device_get_info(struct media_device *dev, void *arg) { + struct media_device_info *info = arg; + memset(info, 0, sizeof(*info)); if (dev->driver_name[0]) @@ -93,9 +94,9 @@ static struct media_entity *find_entity( return NULL; } -static long media_device_enum_entities(struct media_device *mdev, - struct media_entity_desc *entd) +static long media_device_enum_entities(struct media_device *mdev, void *arg) { + struct media_entity_desc *entd = arg; struct media_entity *ent; ent = find_entity(mdev, entd->id); @@ -146,9 +147,9 @@ static void media_device_kpad_to_upad(co upad->flags = kpad->flags; } -static long media_device_enum_links(struct media_device *mdev, - struct media_links_enum *links) +static long media_device_enum_links(struct media_device *mdev, void *arg) { + struct media_links_enum *links = arg; struct media_entity *entity; entity = find_entity(mdev, links->entity); @@ -194,9 +195,9 @@ static long media_device_enum_links(stru return 0; } -static long media_device_setup_link(struct media_device *mdev, - struct media_link_desc *linkd) +static long media_device_setup_link(struct media_device *mdev, void *arg) { + struct media_link_desc *linkd = arg; struct media_link *link = NULL; struct media_entity *source; struct media_entity *sink; @@ -222,9 +223,9 @@ static long media_device_setup_link(stru return __media_entity_setup_link(link, linkd->flags); } -static long media_device_get_topology(struct media_device *mdev, - struct media_v2_topology *topo) +static long media_device_get_topology(struct media_device *mdev, void *arg) { + struct media_v2_topology *topo = arg; struct media_entity *entity; struct media_interface *intf; struct media_pad *pad;