From owner-freebsd-stable@FreeBSD.ORG Mon Sep 9 00:17:21 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B1C183B9 for ; Mon, 9 Sep 2013 00:17:21 +0000 (UTC) (envelope-from jdavidlists@gmail.com) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 869C928D6 for ; Mon, 9 Sep 2013 00:17:21 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id qd12so1471416ieb.36 for ; Sun, 08 Sep 2013 17:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=4H7t0ht0D/pgJiwTuoFknPXtqjjlugJ7zRAbGSOhwK0=; b=W6SsXthbW+JYj37oxe1kYwNjt+sr8Mg0Sb62ogxcXQLIyQ9ljOKwHLbmqo39TW7ePR XXpsvT3G5fnQDFjM4eZD3RQkGiHo3vaDzAMz6Fm55LAZXeCr3a2TgD6cFvPuxwq4yS6q r+IfB/P2eTwt5/qWWKrZyEl+gyme2FiUyZyl1xUMBA6ymQyWyEleLL4G6KUGgeUqH5iF 6PjCaQcydiaRD//mdLrtIG7U8mcu+WYwYD/+QrZomKGRypl/Ln/BzlasApRdmur2AcsK 53hoU5ku2rNeJcWeK/OlsNqW4JbAN8h9bCWeWe6/oP0aTn3Y70tookyNMo5yLnxWYala xkAg== MIME-Version: 1.0 X-Received: by 10.50.30.103 with SMTP id r7mr6117819igh.35.1378685840986; Sun, 08 Sep 2013 17:17:20 -0700 (PDT) Sender: jdavidlists@gmail.com Received: by 10.43.157.8 with HTTP; Sun, 8 Sep 2013 17:17:20 -0700 (PDT) Date: Sun, 8 Sep 2013 20:17:20 -0400 X-Google-Sender-Auth: qu7-sduB-NuPBMkPVtVe1LEXLdc Message-ID: Subject: Small bug in sys/kern/vfs_mountroot.c From: J David To: freebsd-stable Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2013 00:17:21 -0000 In releng/9.2 (and possibly other versions), in kern/vfs_mountroot.c, in parse_mount, there appears to be a small bug. The expression sizeof(errmsg) is used in a strlcpy. This would work if errmsg were an array, but it's a char*, so sizeof() returns the pointer's size and this limits the error message to seven characters + NULL (on amd64), translating "unknown file system" into the moderately less helpful "unknown." A "patch" is below. (It's a tiny fix.) Index: vfs_mountroot.c =================================================================== --- vfs_mountroot.c (revision 255409) +++ vfs_mountroot.c (working copy) @@ -709,7 +709,7 @@ errmsg = malloc(ERRMSGL, M_TEMP, M_WAITOK | M_ZERO); if (vfs_byname(fs) == NULL) { - strlcpy(errmsg, "unknown file system", sizeof(errmsg)); + strlcpy(errmsg, "unknown file system", ERRMSGL); error = ENOENT; goto out; }