From owner-freebsd-bugs@freebsd.org Fri Jan 31 02:17:54 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5863622F7E8 for ; Fri, 31 Jan 2020 02:17:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 48818f1lzVz3y32 for ; Fri, 31 Jan 2020 02:17:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 3C4A122F7E7; Fri, 31 Jan 2020 02:17:54 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C11A22F7E6 for ; Fri, 31 Jan 2020 02:17:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48818f0xc1z3y31 for ; Fri, 31 Jan 2020 02:17:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BE606D9A for ; Fri, 31 Jan 2020 02:17:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 00V2HrVn034285 for ; Fri, 31 Jan 2020 02:17:53 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 00V2Hrqk034284 for bugs@FreeBSD.org; Fri, 31 Jan 2020 02:17:53 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 243747] Add another length check to the iruserok_sa Date: Fri, 31 Jan 2020 02:17:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: areiter@veracode.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 02:17:54 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243747 Bug ID: 243747 Summary: Add another length check to the iruserok_sa Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: areiter@veracode.com This is not really a bug, I have not seen it misused in code utilizing the = API call, and I wonder the actual number of users of the call, but I file this = if it might be worth adding for robustness sake. Apologies to open a ticket for such a small and likely inconsequential-if-not-changed bit of nitpickery, b= ut so it goes: This is simply adding an additional length check to iruserok_sa() function = in lib/libc/net/rcmd.c. There is a check for the length on line 441: 427 iruserok_sa(const void *ra, int rlen, int superuser, const char *ru= ser, 428 const char *luser) 429 { 430 char *cp; 431 struct stat sbuf; 432 struct passwd *pwd; 433 FILE *hostf; 434 uid_t uid; 435 int first; 436 char pbuf[MAXPATHLEN]; 437 const struct sockaddr *raddr; 438 struct sockaddr_storage ss; 439=20=20 440 /* avoid alignment issue */ 441 if (rlen > sizeof(ss)) 442 return(-1); 443 memcpy(&ss, ra, rlen); Is worth changing to `(rlen > sizeof(ss) || rlen <=3D 0) ` ? --=20 You are receiving this mail because: You are the assignee for the bug.=