From owner-svn-src-head@freebsd.org Wed Jun 27 13:45:18 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 14A991024F6E for ; Wed, 27 Jun 2018 13:45:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 94E3E7DE29 for ; Wed, 27 Jun 2018 13:45:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id q4-v6so1953482iob.2 for ; Wed, 27 Jun 2018 06:45:17 -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=XIVqNMlkqL1hFBs6wF3NoVMfBV5lwoL5u6d2dbtltaA=; b=Y+DPohSjmVUVKfdLOir8DBdOWcoDnw7S5p19viMuNCn7EAzQiN0P8OSUHnsh0hX1qT VqznJToh60S5ysmNGxM0uIIa5aMYUjFmmhUSHDK+FjUWmU1P09M7piGAQhs37/kdwFSa 4XnIAJ9Q8+oY/BM8f/B4eee2JSDom5HvXIJ/muwtK612SucxBEm4CbJRMRKe2Bef6PhI d5vaFOjthEj9CH7Nepm1DXuaxgTC0MXrd8bo/18NlL8y48+P+6WaIlDRm8rbGb3PB7yM +AfitzMkW9FdkRkKaDYE9K6JoNDYfysTtrNnqggs9LsOikm/mqqMdFoiRPnltbDeBb1M mD7g== 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=XIVqNMlkqL1hFBs6wF3NoVMfBV5lwoL5u6d2dbtltaA=; b=Tu6NJo5dH4Zc+Wuf6HuZp9LgroJpmZBGArV50gMDrWC9s/CxNkLbiuqskRx3/W0VCu BTtBG5iRKI/Ac9bnKaj0yIT3y+7XhWicv1JUng4udeZWEtZkz9M6S+KiLjgQTEYH1A3y auRoHagYkdP6CIy+lP05xBiLfedxZ1ouKA93c0SHYQ78T2fplBvp59ePZMqTncOxyKB9 qGMrn6M7IRGV75FunJd6kRac6ZgNO3sGqZ5d1N2bkftmetIjho5NRPFDpjWH06MdZUsr 0aOdgxn0uTvnthG11xMqMVukaB6qfFHw5Mdp+Fzcfwx+5SAdZKrAd9VolmKl3kSt1K+7 H+1Q== X-Gm-Message-State: APt69E0n9xWAeqEtoh/nBYFRxGUDpRZJ+hqoxcjWQaFmu/c2Wll02z21 YefyU4B3Nh6vAP1yV7lgcxFxAa/H90lxFFBsZgFIDg== X-Google-Smtp-Source: AAOMgpfdvcks1gRQpDCGr+hsDl5IEGO376WPESUKnDFylVfcVzT65l2r0+dn8txNgpBOPkCFoR/IlSgbHiZKLDzJO10= X-Received: by 2002:a6b:29c4:: with SMTP id p187-v6mr4797884iop.299.1530107116989; Wed, 27 Jun 2018 06:45:16 -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:45:16 -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:45:16 -0600 X-Google-Sender-Auth: jXxUqLfk-DX0jwRvOtLUlt320qQ 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:45:18 -0000 On Wed, Jun 27, 2018 at 7:42 AM, Warner Losh wrote: > > > 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. > Though the default action doesn't at the moment... I'll fix that with proper quoting. Warner