From owner-svn-src-head@freebsd.org Wed Jun 27 13:42:54 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 AD6991024DDD for ; Wed, 27 Jun 2018 13:42:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (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 347F97DC74 for ; Wed, 27 Jun 2018 13:42:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id u23-v6so1927598ioc.13 for ; Wed, 27 Jun 2018 06:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=FxnEn9fQeSI/IgJc6bLz7fQs3tQZJeBX0LGRKqSrz4w=; b=mB3Jgv6mDQlyTZQ4qNzbLV1Aymt7kXXoAv08X35QMPVf0JV0ys7kznNQVsIRLu2E9O GGBkSTZN8Adh/i94KJ8GDm6zwtgdXn9eXQnG5zVG6ugjXtRtRayMELH5Lfd6JzZ94bUn r9unjFrH1I4fR25OgQI1fIF8Xtm3fzlLoH02QFBi2pqUQvXzoCapY/1qo9TQu3OIaFbT idN4MGOuSWvYP/CrRhr4g14DmQ9vYt0vTmzYu/A72AtonFg52ACS+AWUr/o8Rph57fnE UG8a8uiptjFUYDE6F0BxpxFiRNmME4SeySg7gxldVlVKB6jaxwSXkPT2loPVE7VJTSb2 Db6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=FxnEn9fQeSI/IgJc6bLz7fQs3tQZJeBX0LGRKqSrz4w=; b=svB3XSW9kZaOtC8Q6U5mWci+CafA0qav7eKoPgiRiGCZOYQfiSH9YqT4no+U9z8TkE E0Tamtn330Ec+cn4CaZFDxjbvpSGJWeHT7bL5ACdbV5wUsOd4nj98RwT0c/Ms7JVSP/C dwxZicwaHBwdGUxsnuzqU5aledJ/i9b6vliFkGU8qHjOWAU9VHd1xa9LqtIDq+2Q5oGf BQhDwSKoYB/+4uRDVSNVHgVZgh3vK0O/wlNH+KQN+0JmG1XUQv/TVvccP/Q7p2+VxTf1 W2poDJm0FsM6rkp37q54nUHoNOGLxuPYUYjwgRmGgubjuAVZ6+cSfWzp8xpQsU4l71UP oSDQ== X-Gm-Message-State: APt69E1weV736QCwrCP5YRrIqSlzIuQ35Bma9MAm0GJnwTitCHbFl/zo BhI9mQksiO1hNt6wzERbgIW83M6DapotL9Kr5tnWVg== X-Google-Smtp-Source: AAOMgpdWRaSNHnjAv3c/7cNrzEXqEJdWrKY+MVlNFTr0XT3poCt4+tun/m62WDwArBsRUkEK5mnY7DiPtAiv/qbfaTk= X-Received: by 2002:a6b:280a:: with SMTP id o10-v6mr4923595ioo.168.1530106973357; Wed, 27 Jun 2018 06:42:53 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 06:42:52 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806270411.w5R4B9ZB078994@repo.freebsd.org> From: Warner Losh Date: Wed, 27 Jun 2018 07:42:52 -0600 X-Google-Sender-Auth: 25bztZkERnEoLp6Ezc9AjS7EeAg Message-ID: Subject: Re: svn commit: r335690 - head/sys/kern To: Oliver Pinter Cc: Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Wed, 27 Jun 2018 13:42:54 -0000 On Wed, Jun 27, 2018 at 12:59 AM, Oliver Pinter < oliver.pinter@hardenedbsd.org> wrote: > > > On Wednesday, June 27, 2018, Warner Losh wrote: > >> Author: imp >> Date: Wed Jun 27 04:11:09 2018 >> New Revision: 335690 >> URL: https://svnweb.freebsd.org/changeset/base/335690 >> >> Log: >> Fix devctl generation for core files. >> >> We have a problem with vn_fullpath_global when the file exists. Work >> around it by printing the full path if the core file name starts with /, >> or current working directory followed by the filename if not. >> >> Sponsored by: Netflix >> Differential Review: https://reviews.freebsd.org/D16026 >> >> Modified: >> head/sys/kern/kern_sig.c >> >> Modified: head/sys/kern/kern_sig.c >> ============================================================ >> ================== >> --- head/sys/kern/kern_sig.c Wed Jun 27 04:10:48 2018 (r335689) >> +++ head/sys/kern/kern_sig.c Wed Jun 27 04:11:09 2018 (r335690) >> @@ -3431,24 +3431,6 @@ out: >> return (0); >> } >> >> -static int >> -coredump_sanitise_path(const char *path) >> -{ >> - size_t i; >> - >> - /* >> - * Only send a subset of ASCII to devd(8) because it >> - * might pass these strings to sh -c. >> - */ >> - for (i = 0; path[i]; i++) >> - if (!(isalpha(path[i]) || isdigit(path[i])) && >> - path[i] != '/' && path[i] != '.' && >> - path[i] != '-') >> - return (0); > > > This part of code existed to prevent shell code injection via file names. > After this commit we lose this. > It's devd's job to prevent that, not the kernel's. Warner