From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D748C432C3 for ; Fri, 15 Nov 2019 07:44:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65B9020740 for ; Fri, 15 Nov 2019 07:44:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="FTkRFdQC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727196AbfKOHoF (ORCPT ); Fri, 15 Nov 2019 02:44:05 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:52886 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbfKOHoF (ORCPT ); Fri, 15 Nov 2019 02:44:05 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAF7d7m2109375; Fri, 15 Nov 2019 07:42:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=X0VNfringVRO9ZVRht9e5s3LnUQ2e+qgyFMElJYlBIg=; b=FTkRFdQCWVcIB180H/MSBxHyx1lVnNNCof55N5Ov2f+txzz8Za5Gydrm+0xdStCJBxOP 4TjQXY4sZnWI3iTduYZ/gS7Zy/ZBBd9tATAg/Uy7oQirEjzUefd+JqpmRRFB41YqVrCe LQp9zTlFSuluEESaLQn00M4vzqOU0lIBr2Db49ie8wCOyuPnLjkJNhlS1eTUufJuy2rU Qlm6xurzXjLkBeH1h/ew5b4+SxRCvaGTXNukltC7PqXNlzhDJ+N5TdAraVDnxuoWM/4S ZZ8KyhMn+T23ILPwLM4ad+xOAfvMIsd09iCtIjQ0eRmlohDr9ISKh33mgnNwdGHUzilO nA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2w9gxphkbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2019 07:42:44 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAF7cgfb006334; Fri, 15 Nov 2019 07:42:43 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2w9h0jdu9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2019 07:42:43 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xAF7gh7n000598; Fri, 15 Nov 2019 07:42:43 GMT Received: from kadam.lan (/129.205.23.165) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Nov 2019 23:42:42 -0800 Date: Fri, 15 Nov 2019 10:42:35 +0300 From: Dan Carpenter To: Kees Cook Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Florian Schilhabel , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, Romain Perier , Larry Finger Subject: Re: [PATCH] staging: rtl*: Remove tasklet callback casts Message-ID: <20191115074235.GJ19079@kadam.lan> References: <201911142135.5656E23@keescook> <20191115074003.GB19101@kadam.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115074003.GB19101@kadam.lan> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9441 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1911150069 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9441 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1911150069 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 15, 2019 at 10:40:03AM +0300, Dan Carpenter wrote: > On Thu, Nov 14, 2019 at 09:39:00PM -0800, Kees Cook wrote: > > In order to make the entire kernel usable under Clang's Control Flow > > Integrity protections, function prototype casts need to be avoided > > because this will trip CFI checks at runtime (i.e. a mismatch between > > the caller's expected function prototype and the destination function's > > prototype). Many of these cases can be found with -Wcast-function-type, > > which found that the rtl wifi drivers had a bunch of needless function > > casts. Remove function casts for tasklet callbacks in the various drivers. > > > > Signed-off-by: Kees Cook > > Clang should treat void pointers as a special case. If void pointers > are bad, surely replacing them with unsigned long is even more ambigous > and worse. Wow... Never mind. I completely misread this patch. I am ashamed. The patch is fine. Reviewed-by: Dan Carpenter regards, dan carpenter