Received: by 10.213.65.68 with SMTP id h4csp72818imn; Mon, 12 Mar 2018 07:07:54 -0700 (PDT) X-Google-Smtp-Source: AG47ELv4mWpFEij9KPSTk0BYijQpdfFZOMgHibjE+CP/bXzUZTvcyc4FASyhbDqEsq1NReEgwcG2 X-Received: by 2002:a17:902:6184:: with SMTP id u4-v6mr3389365plj.390.1520863674017; Mon, 12 Mar 2018 07:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520863673; cv=none; d=google.com; s=arc-20160816; b=FxreukqejreDB9WpZtAEm5asMAkhsnf/muVWKTWqqBU4GeYkWOGNYnOONb3gFEDY1v DncWfIhnCxBODdG1CufU2DaHte7dNPiOPIdwjDVlptw/qz0GBW/5E9rtHl5JT8l77Hr4 Hmf4pOremyFDM9ViX8Vd/A/NDQY5ezhVtqo/9xlfwAh9YKzzD3GGhEO0RGD+AR5GnSwV MmvegAoMXJVluYWMBf2PV74m+oztAbQLSXCPN2LCAsTdg4uDWQ7ElZF1/I0xbsODSg9N Yi9eDU6ylHOBi8nX5EatB0SyFGdWd3GhNrR6DPHBVKl5u5vDkSc6EdSJ43GVFTrc/FgJ Xtjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:mime-version:in-reply-to:user-agent :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=H4Kw98VFcYEHxfPXww0A28t9pfjdaEXD8B8xN2MrQgc=; b=vqHzQ1OopHgPZP63uEDXO5DpUif4G+UHqjh2ypuSno//xjDNsLjYRElEHnGFfAWRHY iNTb87NLaTpje+JMC5lBq3aKYAHY6yt8gaur78l2hdXqLoQDyM1odqZu8MRlSZpnNRmt qwI0DvXs1ENbUM2Lg34oSUzE5E+f//+Ny3tTTHLuYnNPJY0u5HxPHpQDCy7yY03YfhjH CmUvPH9fRA66bWLM5TmDZP1iAGM0mutfNQYRMVdKi58lsEBW9DxCDIT/6MyiDDT0sFQk yYYhtkNbUgoqiphpd8RB5WBO/1fWgnZn91uGaKsKtB2gO5zhni+SNr27c+q3khIuqP+t +Jmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=re0F2vax; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12-v6si599202plj.126.2018.03.12.07.07.39; Mon, 12 Mar 2018 07:07:53 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=re0F2vax; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbeCLOG0 (ORCPT + 99 others); Mon, 12 Mar 2018 10:06:26 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:26898 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbeCLOGX (ORCPT ); Mon, 12 Mar 2018 10:06:23 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20180312140621epoutp028644b45bc29acd417ee955316672d663~bMV6bNiqL3199431994epoutp02R; Mon, 12 Mar 2018 14:06:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180312140621epoutp028644b45bc29acd417ee955316672d663~bMV6bNiqL3199431994epoutp02R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520863581; bh=H4Kw98VFcYEHxfPXww0A28t9pfjdaEXD8B8xN2MrQgc=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=re0F2vaxEY1lx+zxh/52WYx6yf51SsIHuX9RBTaLStp0WcXiPIJiBJGlwDzh0qizl MztmQmYRExkAHKqa89/yShlTIzEuir7k2/YKRvt6G5E0XsYbKJKUszc9qZ+khW285k Egg84W83E5sDTxamMJOnZvUEZ0NWIJKssGBhFoy4= Received: from epsmges1p4.samsung.com (unknown [182.195.42.56]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180312140621epcas1p3571306f27eba330112d8015cc6456c57~bMV6SmltX1538515385epcas1p3-; Mon, 12 Mar 2018 14:06:21 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 55.3D.04180.D5986AA5; Mon, 12 Mar 2018 23:06:21 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180312140620epcas1p10db98576017a2e4ef9a6ada74eb5daf0~bMV5nnYnL1208512085epcas1p1W; Mon, 12 Mar 2018 14:06:20 +0000 (GMT) X-AuditID: b6c32a38-adbff70000001054-a7-5aa6895db9de Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 08.8A.03826.C5986AA5; Mon, 12 Mar 2018 23:06:20 +0900 (KST) Received: from amdc3058.localnet ([106.120.53.102]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P5H00GUMDUDDS20@mmp1.samsung.com>; Mon, 12 Mar 2018 23:06:20 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kees Cook Cc: Joao Moreira , Greg KH , Kernel Hardening , LKML , Daniel Micay , linux-fbdev@vger.kernel.org Subject: Re: [PATCH] vgacon: fix function prototypes Date: Mon, 12 Mar 2018 15:06:12 +0100 Message-id: <4831767.IeJWIvYDSU@amdc3058> User-Agent: KMail/4.13.3 (Linux/3.13.0-96-generic; KDE/4.13.3; x86_64; ; ) In-reply-to: MIME-version: 1.0 Content-transfer-encoding: quoted-printable Content-type: text/plain; charset="iso-8859-1" X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRmVeSWpSXmKPExsWy7bCmnm5s57Iog10XxC1u/TaxaF68ns1i eccMVosz3bkWSz/9ZrM40feB1eLyrjlsDuwesxsusnjsnHWX3WP/3DXsHis7H7N5bD5d7fF5 k1wAWxSXTUpqTmZZapG+XQJXxowZU5gKnopX3J03ibWBcZ5QFyMnh4SAicSBp5PYuxi5OIQE djBK3F0+hxnC+c4o8f31ahaYqhXT37FAJHYzSrzb84sJJCEk8JVR4tbmQBCbTcBKYmL7KkYQ W0RAVeL7pWZmEJtZ4D2jxJnr+iC2MNCg/3/OgvWyANWcPP6WDcTmFdCUONJ9FcwWFfCS2LKv HayGUyBY4s3rd0wQNYISPybfY4GYqS3x5N0FVghbT+JKwwmw4yQEDrBJvP7SyA5xtYvEnq+3 mCBsYYlXx7cAxTmAbGmJS0dtIeqbGSW+7djDDFEzgVFiz3pouFhLHD5+EWoBn8S7rz2sEL28 Eh1tUCUeEt/W74QGkKPEh6190GC8wCgxYdpa5gmMsrOQ3D0Lyd2zkNy9gJF5FaNYakFxbnpq sWGBiV5xYm5xaV66XnJ+7iZGcKLQstjBuOeczyFGAQ5GJR5eg+ZlUUKsiWXFlbmHGCU4mJVE eO9oAoV4UxIrq1KL8uOLSnNSiw8xSnOwKInzBgS4RAkJpCeWpGanphakFsFkmTg4pRoYKyU2 Rz7qZFCK9+t6tuCnj8f8JKc15cEHGE+ueyhslXnH6LA/h2TSnKuq7BskspO4ut4EWR25JnL6 6Wm1Eudrbydqhn1IzVnrw/bwfmShX8Ep+e4+9ZdZD4+dO3nildTKqQlSPvvXnb3H6yule1Qx wsD218ll057+kLi28NKT3mDtz8n/7e/PUWIpzkg01GIuKk4EALBiyX8QAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsVy+t9jAd2YzmVRBgt2a1jc+m1i0bx4PZvF 8o4ZrBZnunMtln76zWZxou8Dq8XlXXPYHNg9ZjdcZPHYOesuu8f+uWvYPVZ2Pmbz2Hy62uPz JrkAtigum5TUnMyy1CJ9uwSujBkzpjAVPBWvuDtvEmsD4zyhLkZODgkBE4kV09+xdDFycQgJ 7GSUWHPpKQtIQkjgK6PEoY5iEJtNwEpiYvsqRhBbREBV4vulZmaQBmaB94wSM97sYQdJCANN +v/nLBOIzQJUdPL4WzYQm1dAU+JI91UwW1TAS2LLvnawGk6BYIm9/54yQSyrkeif/4YVol5Q 4sfke2BHMAtoSzx5d4EVwtaR6P3+jXkCI/8sJGWzkJTNQlK2gJF5FaNkakFxbnpusVGBYV5q uV5xYm5xaV66XnJ+7iZGYGhvO6zVt4Px/pL4Q4wCHIxKPLwdrcuihFgTy4orcw8xSnAwK4nw 3tEECvGmJFZWpRblxxeV5qQWH2KU5mBREue9nXcsUkggPbEkNTs1tSC1CCbLxMEp1cDoVGCe Mic8xnRqheEP+er1N2X9BCOqOJX007z+bj+5tUMzt+av/SvDTQweSV8SVP491nCb4PDrLevj xuk7mmZenDGpxstC+HNme46azdkrVdJpmbsX5Nk4ZCUqdqy4telkH/OBLwttyudICwuv3Saw 9ZjXoZ1tTPNUr4ge4n7fk7nldlb9HnMlluKMREMt5qLiRABJZBioaQIAAA== X-CMS-MailID: 20180312140620epcas1p10db98576017a2e4ef9a6ada74eb5daf0 X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180312140620epcas1p10db98576017a2e4ef9a6ada74eb5daf0 X-RootMTR: 20180312140620epcas1p10db98576017a2e4ef9a6ada74eb5daf0 References: <20180310064059.12720-1-jmoreira@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Saturday, March 10, 2018 07:27:21 AM Kees Cook wrote: > On Fri, Mar 9, 2018 at 10:40 PM, Joao Moreira wrot= e: > > It is possible to indirectly invoke functions with prototypes that = do not > > match those of the respectively used function pointers by using voi= d types. > > Despite widely used as a feature for relaxing function invocation, = this > > should be avoided when possible as it may prevent the use of heuris= tics > > such as prototype matching-based Control-Flow Integrity, which can = be used > > to prevent ROP-based attacks. > > > > Given the above, the current efforts to improve the Linux security,= and the > > upcoming kernel support to compilers with CFI features, fix prototy= pes in > > vgacon console driver. > > > > Another similar fix can be seen in [1]. > > > > [1] https://android-review.googlesource.com/c/kernel/common/+/60201= 0 > > > > Signed-off-by: Jo=E3o Moreira >=20 > Whoops, I missed this one. :) Thanks! Greg, do you need this resent > directly to you? I would prefer for drivers/video/console/ changes to go through fbdev tree (like suggested by scripts/get_maintainers.pl).. However since Greg has already merged your CFI patches: Acked-by: Bartlomiej Zolnierkiewicz > Acked-by: Kees Cook >=20 > -Kees >=20 > > --- > > drivers/video/console/vgacon.c | 18 +++++++++++++----- > > 1 file changed, 13 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/video/console/vgacon.c b/drivers/video/console= /vgacon.c > > index a17ba1465815..f00b630f6839 100644 > > --- a/drivers/video/console/vgacon.c > > +++ b/drivers/video/console/vgacon.c > > @@ -1407,21 +1407,29 @@ static bool vgacon_scroll(struct vc_data *c= , unsigned int t, unsigned int b, > > * The console `switch' structure for the VGA based console > > */ > > > > -static int vgacon_dummy(struct vc_data *c) > > +static int vgacon_clear(struct vc_data *c) > > { > > return 0; > > } > > > > -#define DUMMY (void *) vgacon_dummy > > +static void vgacon_putc(struct vc_data *c, int a, int b, int d) > > +{ > > + return; > > +} > > + > > +static void vgacon_putcs(struct vc_data *c, ushort *s, int a, int = b, int d) > > +{ > > + return; > > +} > > > > const struct consw vga_con =3D { > > .owner =3D THIS_MODULE, > > .con_startup =3D vgacon_startup, > > .con_init =3D vgacon_init, > > .con_deinit =3D vgacon_deinit, > > - .con_clear =3D DUMMY, > > - .con_putc =3D DUMMY, > > - .con_putcs =3D DUMMY, > > + .con_clear =3D vgacon_clear, > > + .con_putc =3D vgacon_putc, > > + .con_putcs =3D vgacon_putcs, > > .con_cursor =3D vgacon_cursor, > > .con_scroll =3D vgacon_scroll, > > .con_switch =3D vgacon_switch, > > -- > > 2.13.6 Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics