From owner-svn-src-all@freebsd.org Mon Mar 19 23:53:06 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 DB068F55337; Mon, 19 Mar 2018 23:53:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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 75AE96CE48; Mon, 19 Mar 2018 23:53:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id m83so122462ioi.8; Mon, 19 Mar 2018 16:53:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=wGwQHXxcGE4+HoAtz+2nq9c6LcKsfj0dAqotas0GGSo=; b=jhutZ9ttU3tYL93b7qFthsKOhXTIErG7zmGDMvX0bxrEETnyJHt5VF2nvZajMbCai9 5VKasEI7k0oKNvULdrbGYrBJDf6WLqE1zjHkp+9kCKvv2tb3tCH1UN0/+pcvgX80+omr P1aPIvI3E/QsUnyY8u96oqMpIfedaBxSNc2y8PU4utV5MZyFXox4RaDFFwjI9WKQOWmD fhOrEpyUDt7pbNJAICkXWr19Yc+P73Ooxv2pV/g5kmNIObxPQ38vNeyN+t25RMiVWd7+ e7CN5lowpNAeOzg/GIW5VvgER2wf5CM/QmL4fHRNY449L5raICrMRfCQwpSLtb/+Cry+ Q0SA== X-Gm-Message-State: AElRT7HgZf7XoDw2wGX+q/mCTZPC4jY7WgsdzIvi2yhqLg/IQoGGZDC7 qNVb9Ssl25G3f5BVoxWhh96chFd+ X-Google-Smtp-Source: AG47ELuxUQAfIfIffPvKw/ERN/KqIDMIk9xRuGnHD5gZIcONTJe5OiY9qoP8YK7eXOo3Rb01J+dJ8Q== X-Received: by 10.107.136.202 with SMTP id s71mr14389413ioi.45.1521503237188; Mon, 19 Mar 2018 16:47:17 -0700 (PDT) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com. [209.85.214.50]) by smtp.gmail.com with ESMTPSA id h131-v6sm193219itc.12.2018.03.19.16.47.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Mar 2018 16:47:16 -0700 (PDT) Received: by mail-it0-f50.google.com with SMTP id v194-v6so128810itb.0; Mon, 19 Mar 2018 16:47:16 -0700 (PDT) X-Received: by 2002:a24:b145:: with SMTP id c5-v6mr686634itj.135.1521503236335; Mon, 19 Mar 2018 16:47:16 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.153.132 with HTTP; Mon, 19 Mar 2018 16:47:15 -0700 (PDT) In-Reply-To: <201803192243.w2JMhS6N079312@repo.freebsd.org> References: <201803192243.w2JMhS6N079312@repo.freebsd.org> From: Conrad Meyer Date: Mon, 19 Mar 2018 16:47:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331227 - head/sys/kern To: Matt Joras Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Mon, 19 Mar 2018 23:53:07 -0000 On Mon, Mar 19, 2018 at 3:43 PM, Matt Joras wrote: > Author: mjoras > Date: Mon Mar 19 22:43:27 2018 > New Revision: 331227 > URL: https://svnweb.freebsd.org/changeset/base/331227 > > Log: > Fix initialization of eventhandler mutex. > > mtx_init does not do a copy of the name string it is passed. The > eventhandler code incorrectly passed the parameter string directly to > mtx_init instead of using the copy it makes. This was an existing > problem with the code that I dutifully copied over in my changes in r325621. For those without context: The problem here is that the name string comes from rodata of whatever module *registers* an eventhandler listener, but isn't tied to the lifetime of that module. So for example, filemon.ko or hwpmc.ko. If those modules are subsequently unloaded, the kernel eventhandler lock lo_names continue to point to the (now stale) module memory, resulting in kernel page fault crashes if/when those names are eventually dereferenced (we hit it with "sysctl kern.proc.all" after one of those modules was unloaded). Best, Conrad