Date: Sun, 10 Mar 2019 10:34:34 +0100 From: "Kristof Provost" <kp@FreeBSD.org> To: "Harry Schmalzbauer" <freebsd@omnilan.de> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344974 - stable/12/sys/netpfil/pf Message-ID: <8C805FB7-AE8B-4FF9-82E6-EA406C3B07BE@FreeBSD.org> In-Reply-To: <7bdf4d3c-61b3-4319-d5b7-5234991fad78@omnilan.de> References: <201903100056.x2A0ucCT013392@repo.freebsd.org> <7bdf4d3c-61b3-4319-d5b7-5234991fad78@omnilan.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10 Mar 2019, at 10:16, Harry Schmalzbauer wrote: > Am 10.03.2019 um 01:56 schrieb Kristof Provost: >> Author: kp >> Date: Sun Mar 10 00:56:38 2019 >> New Revision: 344974 >> URL: https://svnweb.freebsd.org/changeset/base/344974 >> >> Log: >> pf: Small performance tweak > > Seems to be the MFC of 344493. > Indeed, apologies for missing out the MFC tag here. That’ll teach me to sleep before I commit, rather than after. > Out of curiosity, do you have to manually write these log messages > each time? > Yes. I should see about scripting these MFCs someday, to avoid silly mistakes like this. Regards, Kristof From owner-svn-src-stable@freebsd.org Sun Mar 10 21:22:15 2019 Return-Path: <owner-svn-src-stable@freebsd.org> Delivered-To: svn-src-stable@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 7ACC21542614; Sun, 10 Mar 2019 21:22:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 917838F04B; Sun, 10 Mar 2019 21:22:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x2ALM1l7040649 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 10 Mar 2019 23:22:05 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x2ALM1l7040649 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x2ALM1DQ040648; Sun, 10 Mar 2019 23:22:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 10 Mar 2019 23:22:01 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Vladimir Kondratyev <wulf@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r344984 - in stable/11: sbin/sysctl sys/dev/evdev Message-ID: <20190310212201.GS2492@kib.kiev.ua> References: <201903102058.x2AKwOmF050410@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201903102058.x2AKwOmF050410@repo.freebsd.org> User-Agent: Mutt/1.11.3 (2019-02-01) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree <svn-src-stable.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-stable>, <mailto:svn-src-stable-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable/> List-Post: <mailto:svn-src-stable@freebsd.org> List-Help: <mailto:svn-src-stable-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-stable>, <mailto:svn-src-stable-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 10 Mar 2019 21:22:15 -0000 On Sun, Mar 10, 2019 at 08:58:24PM +0000, Vladimir Kondratyev wrote: > Author: wulf > Date: Sun Mar 10 20:58:24 2019 > New Revision: 344984 > URL: https://svnweb.freebsd.org/changeset/base/344984 > > Log: > MFC r344494,r344495: > > evdev: export event device properties through sysctl interface > > A big security advantage of Wayland is not allowing applications to read > input devices all the time. Having /dev/input/* accessible to the user > account subverts this advantage. > > libudev-devd was opening the evdev devices to detect their types (mouse, > keyboard, touchpad, etc). This don't work if /dev/input/* is inaccessible. > With the kernel exposing this information as sysctls (kern.evdev.input.*), > we can work w/o /dev/input/* access, preserving the Wayland security model. > > Submitted by: Greg V <greg@unrelenting.technology> > Reviewed by: wulf, imp > Differential Revision: https://reviews.freebsd.org/D18694 > > Modified: > stable/11/sbin/sysctl/sysctl.c > stable/11/sys/dev/evdev/evdev.c > stable/11/sys/dev/evdev/evdev_private.h > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sbin/sysctl/sysctl.c > ============================================================================== > --- stable/11/sbin/sysctl/sysctl.c Sun Mar 10 20:43:08 2019 (r344983) > +++ stable/11/sbin/sysctl/sysctl.c Sun Mar 10 20:58:24 2019 (r344984) > @@ -47,6 +47,7 @@ static const char rcsid[] = > #include <sys/stat.h> > #include <sys/sysctl.h> > #include <sys/vmmeter.h> > +#include <dev/evdev/input.h> > > #ifdef __amd64__ > #include <sys/efi.h> > @@ -678,6 +679,22 @@ S_vmtotal(size_t l2, void *p) > return (0); > } > > +static int > +S_input_id(size_t l2, void *p) > +{ > + struct input_id *id = p; > + > + if (l2 != sizeof(*id)) { > + warnx("S_input_id %zu != %zu", l2, sizeof(*id)); > + return (1); > + } > + > + printf("{ bustype = 0x%04x, vendor = 0x%04x, " > + "product = 0x%04x, version = 0x%04x }", > + id->bustype, id->vendor, id->product, id->version); > + return (0); > +} > + > #ifdef __amd64__ > static int > S_efi_map(size_t l2, void *p) > @@ -1097,6 +1114,8 @@ show_var(int *oid, int nlen) > func = S_loadavg; > else if (strcmp(fmt, "S,vmtotal") == 0) > func = S_vmtotal; > + else if (strcmp(fmt, "S,input_id") == 0) > + func = S_input_id; > #ifdef __amd64__ > else if (strcmp(fmt, "S,efi_map_header") == 0) > func = S_efi_map; > > Modified: stable/11/sys/dev/evdev/evdev.c > ============================================================================== > --- stable/11/sys/dev/evdev/evdev.c Sun Mar 10 20:43:08 2019 (r344983) > +++ stable/11/sys/dev/evdev/evdev.c Sun Mar 10 20:58:24 2019 (r344984) > @@ -67,14 +67,16 @@ MALLOC_DEFINE(M_EVDEV, "evdev", "evdev memory"); > int evdev_rcpt_mask = EVDEV_RCPT_SYSMOUSE | EVDEV_RCPT_KBDMUX; > int evdev_sysmouse_t_axis = 0; > > -#ifdef EVDEV_SUPPORT > SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args"); > +#ifdef EVDEV_SUPPORT > SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, > "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " > "bit2 - mouse hardware, bit3 - keyboard hardware"); > SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, > &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); > #endif > +SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD, 0, > + "Evdev input devices"); > > static void evdev_start_repeat(struct evdev_dev *, uint16_t); > static void evdev_stop_repeat(struct evdev_dev *); > @@ -194,6 +196,87 @@ evdev_estimate_report_size(struct evdev_dev *evdev) > return (size); > } > > +static void > +evdev_sysctl_create(struct evdev_dev *evdev) > +{ > + struct sysctl_oid *ev_sysctl_tree; > + char ev_unit_str[8]; > + > + snprintf(ev_unit_str, sizeof(ev_unit_str), "%d", evdev->ev_unit); > + sysctl_ctx_init(&evdev->ev_sysctl_ctx); > + > + ev_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&evdev->ev_sysctl_ctx, > + SYSCTL_STATIC_CHILDREN(_kern_evdev_input), OID_AUTO, > + ev_unit_str, CTLFLAG_RD, NULL, "", "device index"); This change depends on r310051 which was not merged to stable/11.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8C805FB7-AE8B-4FF9-82E6-EA406C3B07BE>