From owner-svn-src-head@freebsd.org Tue Aug 21 19:17:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAE41107CCE5; Tue, 21 Aug 2018 19:17:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ECFD92E09; Tue, 21 Aug 2018 19:17:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B829331; Tue, 21 Aug 2018 19:17:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7LJHaHs013913; Tue, 21 Aug 2018 19:17:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7LJHafA013912; Tue, 21 Aug 2018 19:17:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808211917.w7LJHafA013912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 21 Aug 2018 19:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338154 - head/contrib/wpa/src/drivers X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/wpa/src/drivers X-SVN-Commit-Revision: 338154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2018 19:17:37 -0000 Author: cy Date: Tue Aug 21 19:17:35 2018 New Revision: 338154 URL: https://svnweb.freebsd.org/changeset/base/338154 Log: For CID 1394785, add a comment explaining that global->event_buf is not really a char * but a struct rt_msghdr *. MFC after: 3 days Modified: head/contrib/wpa/src/drivers/driver_bsd.c Modified: head/contrib/wpa/src/drivers/driver_bsd.c ============================================================================== --- head/contrib/wpa/src/drivers/driver_bsd.c Tue Aug 21 18:50:29 2018 (r338153) +++ head/contrib/wpa/src/drivers/driver_bsd.c Tue Aug 21 19:17:35 2018 (r338154) @@ -1234,6 +1234,11 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void struct ieee80211_join_event *join; int n; + /* + * CID 1394785: Memory - illegal access (STRING_NULL): + * Though global->event_buf is a char *, it actually contains + * a struct rt_msghdr *. See below. + */ n = read(sock, global->event_buf, global->event_buf_len); if (n < 0) { if (errno != EINTR && errno != EAGAIN) @@ -1242,6 +1247,10 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void return; } + /* + * CID 1394785: global->event_buf is assigned here to a + * struct rt_msghdr *. + */ rtm = (struct rt_msghdr *) global->event_buf; if (rtm->rtm_version != RTM_VERSION) { wpa_printf(MSG_DEBUG, "Invalid routing message version=%d",