Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2319177pxy; Tue, 3 Aug 2021 03:32:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDU6OjBITY8Bb4w6AfuY5otnRWDVVBZYSrA0KB7F7eNifFNPnwQJvxo9YtVvweYp8TZloO X-Received: by 2002:a05:6638:37a4:: with SMTP id w36mr1007246jal.32.1627986734351; Tue, 03 Aug 2021 03:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627986734; cv=none; d=google.com; s=arc-20160816; b=FEwmIM/sfFbBnRG67Dk37NsmYt9l584/qThOP/Z3FbW7kuOI3+UyVVfOQu0/Z1l9g9 OgkLL0yAiEzWkynBEmRAyMt7n4PWfxlXhawRvONShgQvgQx8u/LckAOnqL3b2jMA6uD3 dB8SQUU7MOkuQ34bvGptCE0w4Y5C711gTHkRJkOxTG+Asod+k+cyBm7K/s75YEOy0JeU d7VkSHmXUXntfgkLW/dlUCJP1z0OnSe5Qx5y/L6iiV4xQSJiDnmeq6EFAmXzUekLPdkV 9gqvwcVb075xiKkbv1iwqiZ0Pf6NEuCuyaZ7DP8Uk3fwXcXscuxh4PSOi56wzJdmW31x I9bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=A3QeIWoPrsn+ykoo/g+jrZdeWbZ20AgRw8r993XsJI0=; b=ybMvLP4M7ogCAKSHU5ECkFTFtLv+g1eveRjyBhWuKUk+PYx1z2k7qfdAwocUyy8Vdb lDZAMRpMjV3tZ8Tr3pWWH9sEolzp8xjbKlTvTo2yYwj+JOhGAe7ctgKij6kl5xZ9o113 +IcWhLuscX5HiC0oakQOvHK537Ydf/P54QSxtVX4HyznCx1VEB4gc1eQ+ybHojUIOnnY DMzbmWjoy0IsuYznuH2DZ0/fypARR7MRV/FPLp0upQzGqqFqMQ6Z0M1QK4jABB+IT8y6 pkUKyYGBzcrbN5d7SRT44XuW7/EEgoK7v+F3S8FfEHJ9uzH3Um1gAm5trCJDhT7iQBEW fS6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vz8U5fHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si15793891ill.98.2021.08.03.03.32.00; Tue, 03 Aug 2021 03:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vz8U5fHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235073AbhHCKbO (ORCPT + 99 others); Tue, 3 Aug 2021 06:31:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234674AbhHCKbM (ORCPT ); Tue, 3 Aug 2021 06:31:12 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23016C06175F for ; Tue, 3 Aug 2021 03:31:01 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id a20so23215654plm.0 for ; Tue, 03 Aug 2021 03:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=A3QeIWoPrsn+ykoo/g+jrZdeWbZ20AgRw8r993XsJI0=; b=Vz8U5fHeK5HrMrM8+QaQY+5fyZjHmh/Xjwf8780Ud3sv+PYV0YRRbtkyfSChhERY0P TtsuViRPM8zMlkqWyAExFzb30vJgSfEFI9ods7AcbHtN8+GnyrZ7C/NYooItI9JG2EPH Wqr9lMyUzbRk9PeEl/BTzjE/iLC3F5/MzzWosyTEypKBQdUK1JgeiiTDTctF5seA42v/ HAClIzT9k+mVT+BAmBx/GBgJhq/WgxyHOWk0ZuQNhZGUlwLNMkOge+PWMwLMbKnhCTXk 9qt0vbsUw+UwL+vlOqX9V53F2EzeFsr2jQHxo0ymejhVVcDKAeYcMFIlSi67NF1SUwRc G6DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A3QeIWoPrsn+ykoo/g+jrZdeWbZ20AgRw8r993XsJI0=; b=jlBsetpiD80SQ7NOVBZYkcxOMxKDCPO3H3b0VQFFe3jaUzr4UKrmOVhITHOupcsmQb KUlsnHINmknXTyp1ozVM/FhIR9CssJRJB45ukL3ESvRv16LM9c5LmXujGYSOMzVko/cz K0UoffKt4wOYxNMA1UYP3JRF+fpf1BRpVsvfrJ6nRT5ogqk92qNa2sYmodx7Qvjv8M7t MZ8kVratj2lEl3i8lpehgeQ8NGV+f84z+TpGx6T7aF3RXbzeb0tPLt7bhNtJUoFbgv5r bpKeyZ7RFeyb2/duoG5rEopcPgCs/6rMrSxWiqWIMfvE8stAMHWSI93/frUFObISgbh6 u83Q== X-Gm-Message-State: AOAM530pod7ELNAonK8aR2ActKRWvZcMUsvDT+ER3s/UlAwyZCN9Z6m3 cWG29omtKqVb8eI80IKeCnE= X-Received: by 2002:a17:90b:2286:: with SMTP id kx6mr3879448pjb.11.1627986660675; Tue, 03 Aug 2021 03:31:00 -0700 (PDT) Received: from localhost ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id b17sm14788326pfm.54.2021.08.03.03.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 03:31:00 -0700 (PDT) Date: Tue, 3 Aug 2021 03:31:50 -0700 From: CGEL To: Christian Brauner Cc: keescook@chromium.org, ktkhai@virtuozzo.com, jamorris@linux.microsoft.com, varad.gautam@suse.com, legion@kernel.org, dbueso@suse.de, linux-kernel@vger.kernel.org, Ran Xiaokai Subject: Re: [PATCH] ipc: add set_ownership() and permissions() callbacks for posix mqueue sysctl Message-ID: <20210803103150.GA607784@www> References: <20210729030651.536326-1-ran.xiaokai@zte.com.cn> <20210729145348.hvvhu6lmlcn5js4y@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210729145348.hvvhu6lmlcn5js4y@wittgenstein> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org O Thu, Jul 29, 2021 at 04:53:48PM +0200, Christian Brauner wrote: > > Yeah, we did that work specifically for the network namespace but knew > there were quite a few places that would need fix up. This makes sense > to me. > > Please add tests for this patch though. Also make sure to run them in a > tight loop on a kernel with memory and log debugging enabled. For now i have rebuilt the kernel turning on the config items you suggested and some other kernel hacking and locking debug configs. I tested this by a shell script concurrently writing the mqueue sysctl files and checking the value. Do you mean that i should add some test code in this patch? Can you give some examples for this tests code? > The whole sysctl retire stuff can't be called from rcu contexts and that's easy to > miss. for this patch, retire_mq_sysctls() is called by free_ipc_ns(), and free_ipc_ns() is triggered by schedule_work(&free_ipc_work) in kthread context. Can you give some comments on the chance this code running on rcu context? > So turn on at least sm like: > > CONFIG_HAVE_ARCH_KASAN=y > CONFIG_HAVE_ARCH_KASAN_VMALLOC=y > CONFIG_CC_HAS_KASAN_GENERIC=y > CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y > CONFIG_KASAN=y > CONFIG_KASAN_GENERIC=y > # CONFIG_KASAN_OUTLINE is not set > CONFIG_KASAN_INLINE=y > CONFIG_KASAN_STACK=1 > CONFIG_KASAN_VMALLOC=y > # CONFIG_KASAN_MODULE_TEST is not set > CONFIG_HAVE_ARCH_KFENCE=y > CONFIG_KFENCE=y > CONFIG_KFENCE_STATIC_KEYS=y > CONFIG_KFENCE_SAMPLE_INTERVAL=100 > CONFIG_KFENCE_NUM_OBJECTS=255 > CONFIG_KFENCE_STRESS_TEST_FAULTS=0 > CONFIG_LOCKDEP_SUPPORT=y > CONFIG_LOCKDEP=y