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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 AEC7BC10F26 for ; Mon, 23 Mar 2020 05:41:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 787D5206F9 for ; Mon, 23 Mar 2020 05:41:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PtK4feNE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 787D5206F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGFqE-0002mW-Mr for qemu-devel@archiver.kernel.org; Mon, 23 Mar 2020 01:41:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60059) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGFpe-0002Nw-MT for qemu-devel@nongnu.org; Mon, 23 Mar 2020 01:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGFpc-0005DI-NX for qemu-devel@nongnu.org; Mon, 23 Mar 2020 01:41:01 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:56125) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGFpc-0005D7-H9 for qemu-devel@nongnu.org; Mon, 23 Mar 2020 01:41:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584942059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PX70K/Dwj/2HJlnkHUdSrroNPkYbheNfiNoaYzwVpKU=; b=PtK4feNEu08cCsEfdFcWgqOCoLpVTOxsMm/1LjSbC67G5h7WmY2rzoSIykIk8kVQD1FnAF 0DyijjIZq52Pw09A8ykzPbWF/+CFByT+r7UTWsx6y2oKQsAIdzEZBRvHzsfXW9M7HgCWr/ xzrtCteVKwHOVJpW8AYpVWsbjFjUveU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-462-hkF8JOcpNX67d5IcbGdSAA-1; Mon, 23 Mar 2020 01:40:58 -0400 X-MC-Unique: hkF8JOcpNX67d5IcbGdSAA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A058E107ACC4; Mon, 23 Mar 2020 05:40:55 +0000 (UTC) Received: from kaapi (ovpn-112-176.phx2.redhat.com [10.3.112.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A0CD88859; Mon, 23 Mar 2020 05:40:51 +0000 (UTC) Date: Mon, 23 Mar 2020 11:10:49 +0530 (IST) From: P J P X-X-Sender: pjp@kaapi To: Jason Wang Subject: Re: [PATCH v5 0/3] net: tulip: add checks to avoid OOB access In-Reply-To: Message-ID: References: <20200319174050.759794-1-ppandit@redhat.com> <20f29d89-6d52-2edc-ef7e-13124908256a@redhat.com> <26c0091a-89f1-c956-efba-d1b2e4a13d76@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="-1463810047-352782259-1584942055=:5086" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 63.128.21.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , Qemu Developers , Stefan Hajnoczi , Li Qiang , =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= , Ziming Zhang Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" ---1463810047-352782259-1584942055=:5086 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable +-- On Mon, 23 Mar 2020, P J P wrote --+ | +-- On Mon, 23 Mar 2020, Jason Wang wrote --+ | | hw/net/tulip.c:305:20: error: initialization of =E2=80=98_Bool (*)(NetC= lientState *)=E2=80=99 | | {aka =E2=80=98_Bool (*)(struct NetClientState *)=E2=80=99} from incompa= tible pointer type =E2=80=98int | | (*)(NetClientState *)=E2=80=99 {aka =E2=80=98int (*)(struct NetClientSt= ate *)=E2=80=99} | | [-Werror=3Dincompatible-pointer-types] | | =C2=A0=C2=A0=C2=A0=C2=A0 .can_receive =3D tulip_can_receive, | | =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^~~~~~~~~~~~~~~~~ |=20 | Strange, I did not get it. qemu/include/net.h: typedef int (NetCanReceive)(NetClientState *); typedef struct NetClientInfo { ... NetCanReceive *can_receive; ... } @Jason, Looking at the definition above, 'NetCanReceive' is returning an 'int' ty= pe.=20 When I change 'tulip_can_receive' to return a 'bool', I get the reverse err= or hw/net/tulip.c:305:20: error: initialization of =E2=80=98int (*)(NetClientS= tate *)=E2=80=99 {aka =E2=80=98int (*)(struct NetClientState *)=E2=80=99} f= rom incompatible pointer type =E2=80=98_Bool (*)(NetClientState *)=E2=80=99= {aka =E2=80=98_Bool (*)(struct NetClientState *)=E2=80=99}=20 [-Werror=3Dincompatible-pointer-types] 305 | .can_receive =3D tulip_can_receive, | ^~~~~~~~~~~~~~~~~ Maybe because of a stagged local change in your tree? (to confirm) Thank you. -- Prasad J Pandit / Red Hat Product Security Team 8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D ---1463810047-352782259-1584942055=:5086--