From owner-svn-src-head@freebsd.org Fri Jun 3 05:03:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83DBAB68F79; Fri, 3 Jun 2016 05:03:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 502B119C8; Fri, 3 Jun 2016 05:03:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x229.google.com with SMTP id z189so128561209itg.0; Thu, 02 Jun 2016 22:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=mUqIxQ0JRMYHZ2NdO8pUbvaF7ViT2Xdhr3lFngCnTjY=; b=BTlIwgtTy428E2YSUIeDT8tfzAOhfZgSzFB7z8SOTV2rON7368dKOuxDEPUsTwgEOH luXqwEM4VmtsRAQYmiy2n247wBs7vkx89m1239MTLcYSV6B61z9yM1o8ELK2KdRvHyB2 ADctsWzF9wscBA2giGM5elUH6X9xOLrTIR6PRPHtPPoUXYpV8IWOWr0TYX5F+fYTfJ2b XvajK4ws85ekM4puk7OdZirOP0NTQwKymYRDjuNToY31muIoyAiebMxt4n5tq19T7pvu 84HY9TgOIn55k/S7SEPJiQT+d73jrXD21+BWMli7FbyCUZT+Y/LUD2FvjWAAKVsEUyQ7 RKvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to; bh=mUqIxQ0JRMYHZ2NdO8pUbvaF7ViT2Xdhr3lFngCnTjY=; b=PfD4FKx5eKaOxRxDpN9DYxUWlC/kHeTTw0HbMpb/YqZ7pWFKC7h3lBxre5aL8SkNxE cEVJY6wjduemMsdxb6ICSsixPAxUpBduY3SVAaSq454mjWTkuGiRhQH902xx+2AAII7C sCChqNEIGDhpklp9o4x0+MMfb4XpAO2Wfxj1p9JaCv8WzDdhK/+Rr+YJBo6qTeJFa/VN L4LGjMaH+IKtmvB5sxhy5yeUXWh6qfuvNzPkoDzZKEtjfRCI8GPgYAux/Jw+Av38MlVE sL8AMiixX7R4ocniQm+fRuiEOf/vud9hlMsI+iq4BMbBtfKK72wEdgIPTksas6LS+ApT 0hGQ== X-Gm-Message-State: ALyK8tKLpmEkMzttKPtPkGrDhZxV8IzrCb2eA9TkbBI9iACzKwJS6WdFBpL3XnH+VHGZOdzDQQ5ToKjfWkN+ww== MIME-Version: 1.0 X-Received: by 10.36.81.79 with SMTP id s76mr2298072ita.71.1464930209527; Thu, 02 Jun 2016 22:03:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Thu, 2 Jun 2016 22:03:29 -0700 (PDT) In-Reply-To: <201606030501.u5351ZMg035703@repo.freebsd.org> References: <201606030501.u5351ZMg035703@repo.freebsd.org> Date: Thu, 2 Jun 2016 22:03:29 -0700 X-Google-Sender-Auth: MOHjWW3ONZZR-AQYA_NOzGRkmck Message-ID: Subject: Re: svn commit: r301236 - head/sys/dev/drm2 From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Fri, 03 Jun 2016 05:03:30 -0000 fwiw, this made me cry. a lot. grr. -adrian On 2 June 2016 at 22:01, Adrian Chadd wrote: > Author: adrian > Date: Fri Jun 3 05:01:35 2016 > New Revision: 301236 > URL: https://svnweb.freebsd.org/changeset/base/301236 > > Log: > [drm] fix up hex_dump_to_buffer to not overflow linebuf. > > That check wasn't enough to handle appending a two byte character > following it. > > This prevented my T400 (Intel Core 2 Duo P8400) from attaching; > it would panic from a stack overflow detection. > > Modified: > head/sys/dev/drm2/drm_os_freebsd.c > > Modified: head/sys/dev/drm2/drm_os_freebsd.c > ============================================================================== > --- head/sys/dev/drm2/drm_os_freebsd.c Fri Jun 3 03:40:39 2016 (r301235) > +++ head/sys/dev/drm2/drm_os_freebsd.c Fri Jun 3 05:01:35 2016 (r301236) > @@ -422,7 +422,7 @@ hex_dump_to_buffer(const void *buf, size > } > } > > - if (j > linebuflen - 1) > + if (j > linebuflen - 4) > break; > > sprintf(linebuf + j, "%02X", c); >