From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28922C33CA7 for ; Sun, 12 Jan 2020 02:16:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A7C920866 for ; Sun, 12 Jan 2020 02:16:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="VKTp20o6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A7C920866 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C6DF58E0005; Sat, 11 Jan 2020 21:16:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C1DDB8E0001; Sat, 11 Jan 2020 21:16:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B33DF8E0005; Sat, 11 Jan 2020 21:16:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id 9ACA08E0001 for ; Sat, 11 Jan 2020 21:16:50 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 52B55180AD817 for ; Sun, 12 Jan 2020 02:16:50 +0000 (UTC) X-FDA: 76367368980.20.birds20_3ba42971a5523 X-HE-Tag: birds20_3ba42971a5523 X-Filterd-Recvd-Size: 4097 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Sun, 12 Jan 2020 02:16:49 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id y8so2393642pll.13 for ; Sat, 11 Jan 2020 18:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vGIDhMkgk6Yxk9hwcJUbeiuGdVTEJQSdVtxa8Ksgq0I=; b=VKTp20o6e1570ly+OroArEs2yK8TRc8zTn1AM6UonyvsiELOT9JRoatzH/zDEmSSMm cZnrNwagysbC84XUWOWPzvMrktG1nStCemX63kEVM3lp/r+rJBZCGlgHLKcu875h3DiQ R7jIoghHxClJEGkWH9X/+Q6ZdWgrqmlo5TzSLZAOzwyU1pOpWeWL8QnXbLCppCyr9Pky UK80Lo90j88hbqJs+KdVCEtw0qt1j0GVrybB6Wwf0CfzgrZwOLcgry2h1+6UtgOwZODv Kkz7eS0klJasPiUkf2w89ct2lqGatlEw8nLm4Y1lzhB/zTi0hXC47ttMVtI0yVLjwZEu xN3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vGIDhMkgk6Yxk9hwcJUbeiuGdVTEJQSdVtxa8Ksgq0I=; b=tKVAgao5Vt/wm1crBEoDMy2S71MWKFJiQJrgyyAqddUaAAp+csGvulF2ln7JFKYdzm P9dARG0jYFSSK8hDasZV+AgSDqWPwtGRrQrbEyxlKlzcSJi+BTD/t8jyCW1iTsk3OkGZ 0FkwQcIguHNrxZDch9dmQtaz9eBp8jyVo8ZAbXtShx1VgHD6jcrDjbd9WDXAX5V2AvWl OBdik9j3gp79ORIryQJOEceURRanOWFZj6dam6XUbZXByPcZQDZ5dEoAvVGeTFq7m+Ku HgY4xoRHgpX06TyhZ9986cyf8xND7a+x5blEQubMCDmEH5rUna9QDCKIWH9qZL8ba6d7 pCqg== X-Gm-Message-State: APjAAAXykcF8KVW9GDNCUhi4mXz9fSHq9GKRoI2yoCQz42keXdNaILFf XY+89QW36p1JWjTa4iBR5At76hYVNvY= X-Google-Smtp-Source: APXvYqyv1LeI+xjOOHaKKiHuxN7/X39asnC3k5SnqhpCRcLo0rDk59XFNfJqk0XKBHd6prsa49uoxQ== X-Received: by 2002:a17:90a:ead3:: with SMTP id ev19mr15035309pjb.80.1578795407788; Sat, 11 Jan 2020 18:16:47 -0800 (PST) Received: from [192.168.1.188] ([66.219.217.145]) by smtp.gmail.com with ESMTPSA id x22sm8389504pgc.2.2020.01.11.18.16.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Jan 2020 18:16:47 -0800 (PST) Subject: Re: [PATCH 3/3] io_uring: add IORING_OP_MADVISE To: "Kirill A. Shutemov" Cc: io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20200110154739.2119-1-axboe@kernel.dk> <20200110154739.2119-4-axboe@kernel.dk> <20200111231014.bmpxdg2juw3mxiwr@box> From: Jens Axboe Message-ID: Date: Sat, 11 Jan 2020 19:16:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200111231014.bmpxdg2juw3mxiwr@box> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/11/20 4:10 PM, Kirill A. Shutemov wrote: > On Fri, Jan 10, 2020 at 08:47:39AM -0700, Jens Axboe wrote: >> This adds support for doing madvise(2) through io_uring. We assume that >> any operation can block, and hence punt everything async. This could be >> improved, but hard to make bullet proof. The async punt ensures it's >> safe. >> >> Signed-off-by: Jens Axboe > > How capability checks work with io_uring? > > MADV_HWPOISON requires CAP_SYS_ADMIN and I just want to make sure it will > not open a way around. There are two ways the request can get invoked from io_uring: 1) Inline from the system call, personality is the application (of course) in that case. 2) Async helper, personality (creds, mm, etc) are inherited from the ring. So it should be totally safe, and madvise is no different than the other system calls supported in that regard. -- Jens Axboe