From owner-svn-src-all@freebsd.org Wed Jun 27 13:42:54 2018 Return-Path: Delivered-To: svn-src-all@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 AD5D11024DDC for ; Wed, 27 Jun 2018 13:42:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (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 375F17DC76 for ; Wed, 27 Jun 2018 13:42:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id u23-v6so1927599ioc.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=tRPRsMupYekFWOm8nL8RQhE8XorVMe1gVc6Oe68t77nKCwlzwgf7TwzibDs5zLFXR+ pwhg0JSTPs+2qdbe1C2ndTs0//niASnWlPm91mhk7UE6Ce6XN/1+gDdUZCIqZtvoL7iv B+5bFmKsvA44cLVfvt4nIPFzDtPRGIgYey8GFyD78fivon/yKrBDYS1SQSsVj3VkFUeM Ga4zTuNOXPbgERMT6qBpabd8Hnxxr9qC3EAPjI5lks9ICpLn3qVG1x8jCamSTOxuRBeo Q/DsZ3kyU9S8vLP48OkxgDw44bo4wVog8Nu0/PAiHLGLIdHsi9Geu1vonFkQxiuqslRm bl1A== X-Gm-Message-State: APt69E0zNlMGkAQ621KMewzoRYUpgvdXDFh6xfwHbxiZH0R3sHS2pSjT shJ02d2gvf4s7pAsXYR4dGETOHToMbaJ7gBrNDiUIw== 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-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 13:42:55 -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