From nobody Mon Apr 17 04:50:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q0F4K1rdxz45KVT; Mon, 17 Apr 2023 04:50:57 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q0F4J3cDsz4c9W; Mon, 17 Apr 2023 04:50:56 +0000 (UTC) (envelope-from sjg@juniper.net) Authentication-Results: mx1.freebsd.org; none Received: from pps.filterd (m0108161.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33GMmwot030164; Sun, 16 Apr 2023 21:50:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-id : content-transfer-encoding : date : message-id; s=PPS1017; bh=SpCLAdJrB06014+qrlQFPp5AtpnLJJANXzuKmlfIAcY=; b=xpvbUyg7FCEcWIxHy3iVi+GcUM5IZ5vuK1+qHX620K4sslnGTq3FiGC0BSI/Ec1umoOq yI34yTEITIOVrUBF6DpSFlD43DR8Bunj+Leto4lR+mjwwWhznXLxswEo3QBiaq6IyRWl YEsERS6kg17arsoNTWzyjiwWnmu2DLRFhxHJvcu8qMjtDYtxH8CYT5VCZssGxNaaIpaB oofbWAs+o1eK7SQkOnrlAIuhEXTVNJ0z7QD3PQrhkZAQmv5qSWwFmKh2cYLnWaL3ajJN AZE6t+yhZY3pB6YBYqqrbCMULFkXLMmiX2+0gmz27LXXx9BMczd+7aVAPjmNLhwCWJIh JQ== Received: from dm4pr02cu002.outbound.protection.outlook.com (mail-centralusazlp17013031.outbound.protection.outlook.com [40.93.13.31]) by mx0b-00273201.pphosted.com (PPS) with ESMTPS id 3pyu20acap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 16 Apr 2023 21:50:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JPrzuLx8+ILHoff+f2oCoHH1UuPiSttX9e2C6yLF0WrkyqjqjhN93GMgW6ldMKhb/DFjvI2vDJEvunUc+Fn8c2IhaArMDM1p8WNoUQapbrcoysKP0V9b1kBdjwNP/fl5UwOdhPIPz8INBBYEGgqFKdNEreeVJ2tjSZGR9ZtdGMpvvp2M+SUBW5zP/P1YqIpwbcxjq8QBhQZKaRQLiFNLAs/QQVcNHVqp3mq13I8H7N6DqtJg1Lhhj8hrmUqJu5nO40u7qsGFD3k4qHrWRo1LwH6BTnp6ur/K4UCSgMP9fbTH11tHWl7Vw7KX+1cMN0AZeCL8/iP2YiRSHbT6XDF1Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SpCLAdJrB06014+qrlQFPp5AtpnLJJANXzuKmlfIAcY=; b=T19z604Y4buskXZUBxKFvVNt1fIRqpb4Sp13/P0p7HNjDojA6cLQLD/txd3tCwt4awIblpUWhpkNdZaP+M+l/4GwLyyZ7U5K9YPdjDnTdFkOpyteFeG8GWS4EdQAwb8UJG9RcsKZBjCj6Mq7zkjZHou7HIGvkZVliJ9gzMV8yzjBmdHVJIeXO+vrPUxQ5s/XTZfW3qD4aaniVTYl84JPN7r6cOp/tooRDj3mRoYJl43nCIUI/EkLygs+DIQ0zy6/7slre7u5Lhx81ATUpcf61RfQwShko9C3ws2bBtfI0rZICR5JiT1jHP9IkHm7dIAoXyllO/34jDj0g5dGLUBkMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.15) smtp.rcpttodomain=gmail.com smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SpCLAdJrB06014+qrlQFPp5AtpnLJJANXzuKmlfIAcY=; b=ZZ+RCCd6DWTF35hcFJS138DVneg7DuKO2j2HwYhKLStx/i9qvtmrAAyRTLgLiiFP8fGfMWJhFGFrt4Hgc/QuxQEl4SAFYyW1hlMcr+Xl21yr8M11+Ir8Z/fT5cu1ejkN9uYqFQPJv8enYIVCeovHcRhtmPIIq0Wnc12zXWCxCZw= Received: from BN9PR03CA0486.namprd03.prod.outlook.com (2603:10b6:408:130::11) by DM6PR05MB4425.namprd05.prod.outlook.com (2603:10b6:5:95::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Mon, 17 Apr 2023 04:50:52 +0000 Received: from BN8NAM12FT025.eop-nam12.prod.protection.outlook.com (2603:10b6:408:130:cafe::bf) by BN9PR03CA0486.outlook.office365.com (2603:10b6:408:130::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.46 via Frontend Transport; Mon, 17 Apr 2023 04:50:52 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.15) smtp.mailfrom=juniper.net; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from p-exchfe-eqx-02.jnpr.net (66.129.239.15) by BN8NAM12FT025.mail.protection.outlook.com (10.13.183.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.19 via Frontend Transport; Mon, 17 Apr 2023 04:50:51 +0000 Received: from p-exchbe-eqx-02.jnpr.net (10.104.9.15) by p-exchfe-eqx-02.jnpr.net (10.104.9.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.7; Sun, 16 Apr 2023 23:50:51 -0500 Received: from p-mailhub01.juniper.net (10.104.20.6) by p-exchbe-eqx-02.jnpr.net (10.104.9.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.7 via Frontend Transport; Sun, 16 Apr 2023 23:50:51 -0500 Received: from kaos.jnpr.net (kaos.jnpr.net [172.23.255.201]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 33H4ooOn027798; Sun, 16 Apr 2023 21:50:50 -0700 (envelope-from sjg@juniper.net) Received: by kaos.jnpr.net (Postfix, from userid 1377) id C80E384E82; Sun, 16 Apr 2023 21:50:27 -0700 (PDT) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id C6F6184E81; Sun, 16 Apr 2023 21:50:27 -0700 (PDT) To: Konstantin Belousov CC: "Stephen J. Kiernan" , , , , Subject: Re: git: 4819e5aeda4e - main - Add new privilege PRIV_KDB_SET_BACKEND In-Reply-To: References: <202304161838.33GIcJiX079190@gitrepo.freebsd.org> Comments: In-reply-to: Konstantin Belousov message dated "Sun, 16 Apr 2023 23:47:48 +0300." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10953.1681707027.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Sun, 16 Apr 2023 21:50:27 -0700 Message-ID: <11356.1681707027@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM12FT025:EE_|DM6PR05MB4425:EE_ X-MS-Office365-Filtering-Correlation-Id: c9cd3512-d5ca-4052-8f0a-08db3eff523c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g0SFbv3YSv4FkXM0vpWxjZRLtPVeixSD3NL18EHKmd5GotcYhB2MC8pO1jySe86O6gMhI8ht7fFD9LQ6qoKyO2daf76rTuvdpLzpaS7dNilXGfy55nFkAONLN3vbUYmwY7yXvEhstSkgvhiHyGbivIPhWpvMwoB4REtvHQzALJk/CStDsA06UWmNrWSBo2lQojngyl5+Y9wn4Sdvx3Xo+ve+98J9oLF3GGBb3qTWnTLTML2Yk7dVSOJt3xK6NI3d/xZqiANx0JHypPa2QZ43ZMzxfjC8ibRJIUryf3A/YfErkTF5GVTAkTSPBZMe0N3pBiOdw6Ay9OlnKiK8cqR/gQCED3xxEAink6TeXLgsEHtqikxIYicfarpE0FAPSTExQKWGFjEN9q5WNHQCyQklmknJxkxLw6SXlUFu8gMntDIRq88yg8prc5vtS49yyMUnlTTuDWi2iREByaFLihibuL1KDLOXFYmRnNHq4j0/uOZahOzR9ldWr3DMlmdpurVdeVwJbEDLjE7HWT2ovEjfjtC0ddYcJacvdDNt3UsuXr6gTJ4ADbFQXr21ROaVtoXyK+1ml+oAfqnCgM2bf3fWUXK2Tp07jHQvZkl7eAY39+6aQwpmkg4DQgTwYcLwtVZZnWmSPwxm3xRRZSHP5NeD65HTqlAFkgEY+oFMq9UBoRjmAWikes6shlbxTGdH+ILy8FpKsDcymk4BEbEkgAeJngyunxxKWrFmbdQOAGJKe+k= X-Forefront-Antispam-Report: CIP:66.129.239.15;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:p-exchfe-eqx-02.jnpr.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199021)(36840700001)(40470700004)(46966006)(40460700003)(82310400005)(2906002)(5660300002)(8936002)(8676002)(356005)(41300700001)(81166007)(55016003)(40480700001)(86362001)(478600001)(54906003)(7126003)(36860700001)(26005)(9686003)(107886003)(186003)(6266002)(7696005)(336012)(6916009)(4326008)(70206006)(70586007)(82740400003)(316002)(83380400001)(47076005)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2023 04:50:51.8934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9cd3512-d5ca-4052-8f0a-08db3eff523c X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4;Ip=[66.129.239.15];Helo=[p-exchfe-eqx-02.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT025.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB4425 X-Proofpoint-GUID: ubwBVJiVSbgAyeTGOO01BOMYtH4pzkKK X-Proofpoint-ORIG-GUID: ubwBVJiVSbgAyeTGOO01BOMYtH4pzkKK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-17_02,2023-04-14_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 adultscore=0 mlxscore=0 impostorscore=0 clxscore=1011 mlxlogscore=670 phishscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304170043 X-Rspamd-Queue-Id: 4Q0F4J3cDsz4c9W X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:22843, ipnet:67.231.152.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Konstantin Belousov wrote: > > @@ -484,6 +485,11 @@ int > > kdb_dbbe_select(const char *name) > > { > > struct kdb_dbbe *be, **iter; > > + int error; > > + > > + error =3D priv_check(curthread, PRIV_KDB_SET_BACKEND); > priv_check() fails for jailed, or even simply non-root process. > kdb_dbbe_select() is called from a random context, e.g. from > kdb_alt_break_gdb(), where it inherits whatever thread was running > at the moment of break to debugger. That sounds like a bug? > In other words, this function no longer works reliably. > = > > + if (error) > > + return (error); > > > > SET_FOREACH(iter, kdb_dbbe_set) { > > be =3D *iter; > > diff --git a/sys/sys/priv.h b/sys/sys/priv.h > > index 20bfc7312ce3..cb4dcecea4aa 100644 > > --- a/sys/sys/priv.h > > +++ b/sys/sys/priv.h > > @@ -515,10 +515,15 @@ > > #define PRIV_KMEM_READ 680 /* Open mem/kmem for rea= ding. */ > > #define PRIV_KMEM_WRITE 681 /* Open mem/kmem for wri= ting. */ > > > > +/* > > + * Kernel debugger privileges. > > + */ > > +#define PRIV_KDB_SET_BACKEND 690 /* Allow setting KDB bac= kend. */ > > + > > /* > > * Track end of privilege list. > > */ > > -#define _PRIV_HIGHEST 682 > > +#define _PRIV_HIGHEST 691 > > > > /* > > * Validate that a named privilege is known by the privilege system. = Invalid