Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp57516lqg; Wed, 10 Apr 2024 15:27:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzcKNyaNJNvRN6K6mnXRKXQE1NlRfKMO+/ZGE8+8bxeE1JE/kZcJBxh/GbkY/8lt3oE0OP6/AGx6T/gKucbEWdnpYZFSKlhl/WzslYLA== X-Google-Smtp-Source: AGHT+IH0yLYVtF2v1GWtLtIyMAh/eU7XbeX9KoA8mlkm1EZ8axJ/PagVLbEWY64XRPyhgGNZsSIJ X-Received: by 2002:a81:6ccb:0:b0:614:4f9e:5677 with SMTP id h194-20020a816ccb000000b006144f9e5677mr4163085ywc.9.1712788056581; Wed, 10 Apr 2024 15:27:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712788056; cv=pass; d=google.com; s=arc-20160816; b=GdTivfYaF5Qc50xPu6ooKsF/pDrwMVAFidUFQdssLCsT60QEMVM8yuq4eK/Xmg7dHJ BiJc+HxoO1LcP0sh2w1gU2nq29RY4hfeM78hTQYVCatnJg8B1f198XXodEI1hb/m9F10 s1g2TIqtLNJJbXWENqc08ICs1qfOM7QFSGu8WT/WvDGXogDusKCGgBypPYXtakV8HV63 A64SpqyHkdrQh9ErwHvZsQPy+dCTJYX05Gr9krN30FHKK0c9+c1Hesih5gzSEcVj95JF dtSVR0SjnM5o+bjCFd/CT2YNBh5lPbCSKtow+PAG3sozDjJvsu+87CaS4U0zrgHEBC3C UnMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=9P0aMHFsVVEdLlv0SDKAm08of/R9DQjYXYCl7/2YrKs=; fh=HvellogXMpiL9Hg7UIC4BmvJaP1nEKihSG1oh41MRS8=; b=TUmkK3JxqnmevtS2DCJqUUVGdTX/v5ZhMvPOZ5/A5PPqyQZaABwcS3uerp+KZHCMDH tnxKNugUxpYgDr1j50QgbKTxTjFpA+mDf4rVj3ue1haTiazWkW6k4sjApOujhTJ7uoYf xqTim3r5nQNr9cTaI6MXTjrzmSSEr+J70Bq3opBAb6zsNfWH3NqlBr7k9po6SebeodPj l1ObTknwms/q0SSiAc9j3MThRSmPnfQ3Y10tUwlqZxbXRGjr4ykDJl2zjxR8xxzRBwH4 HtswCaUAXpVLGpGckB+aA9ydcVUaGvt0iNgyoewI2BAH09KgbTt2KGQcWsg/Xd7ZgsNo 1fwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="bz/mzcdy"; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-139434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139434-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o8-20020a05622a044800b00432cfc75456si165496qtx.585.2024.04.10.15.27.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 15:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="bz/mzcdy"; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-139434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139434-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1FFCC1C2206B for ; Wed, 10 Apr 2024 22:27:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ABE8218413E; Wed, 10 Apr 2024 22:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="bz/mzcdy" Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFF64168DC for ; Wed, 10 Apr 2024 22:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712788040; cv=none; b=pvupsi7WbPU7DfhkIcJVPy3u/qDbLAQL6JpsE4ujCRX7Kwh6P+2YBLP5383dgP9WDcirILS2Wv2H2m1uYXvcixzxgGZFXcTmnSExdZbai10mM944V5QUPlrDQSU/fp3WEHlr1H8RgsjC87mgodmwTYUszDfMnNJrsu5Oqy/4ytE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712788040; c=relaxed/simple; bh=GNSKKpbMF2d6HjHazkjSsi+nfHk+zDq0eehNnCdFE/w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jeyhYJjUrDxCTtpF6FjEoMle/Y1lVw4AqEQ5HQIL+YcRatfece1BeEgrsVHzGQkq8TB9RfWZ5LuqH4IWqOYGPsTACgHv0UcX9yAt86u2AyXdyAOxu8DDO46cw/rFPm4KN6GFbYqpvE0mMyIZK3nY7NSAUetUUEmRrOTJ2OU4+s8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=bz/mzcdy; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7d6112ba6baso39861639f.1 for ; Wed, 10 Apr 2024 15:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712788036; x=1713392836; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9P0aMHFsVVEdLlv0SDKAm08of/R9DQjYXYCl7/2YrKs=; b=bz/mzcdyOW5iC0FkNnlVirITgZp55ltOwJATvHUCyt8JvXJpNoYolTDX84OJrCdrLk 0H91lHurYH2hkT8qrYuvrWm5RLq6J1rAzXpi9M5duyLFaRzxxunOrZl7r24wnkhkIkLT HALj59QHKNel4Q0jnU7ztk/BktHgKO9/0g7W+6aGIzeq7TYHh5lCaPpGR5txHE0Kwz96 l3VJIbKd/reEqR/Sif7Ue4E+KpcoIeoL/few+j6y2jUJRJshAsYAxDO3v53dO7pc03Qf ydEbyOXmz7r4YFiVIFS03u3mOJ5RRRUjhBor+0WBxFHHc9voqZox8brHiM8D7MCyKxnN MSMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712788036; x=1713392836; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9P0aMHFsVVEdLlv0SDKAm08of/R9DQjYXYCl7/2YrKs=; b=GoOq/Qgy5OvEcqEHyJOC9pHfv/9KyFCZCQhkxoYWamL26TXcpIzfYyxvvKH+jmM6Ku cOvG2qJwChxlSzyNZpW+wekkCnbgCMJ3rAZcb+IeMrVnBjeem0qgUSZLAP/BliHn44YM MqaWrYiF6OBcbGQhVCohNfWSXQjEgE9vYYgJs+qwyXxIJB2950h+yJsfIT5wjsiGFwQY gwlO/uwKrULFCrmHUCnHg30NSCk72mGPuD6JVfhyekKZCQRYJG1sewklxYGkWyLYnGo7 ncYH9sJWsST72TBuJLS2ohPVAIkb5Ep62wvw1U+iOerVyqf5phBHUjZxmNqmLyrLBjpG KyeQ== X-Forwarded-Encrypted: i=1; AJvYcCVaJKx4/AhPSRl4TazmJvBd4r+RptBggL3xFw+iIkwj6hNFr7KIbDDVudSaOg4ULUEEwsBVmm15e1fyVivsTuQM97YLtq4n979IWjT/ X-Gm-Message-State: AOJu0YzI8RILBiMi+ma/2GFZq4kzb2jSsfBfcoK7ZQe5h4HgdyvaIJp1 lOMoqcbi4j9/qHeKwhaC7nfCqOR64Z83oYQGvm1Spfsw/9LsaVNVava9x4pyBrI= X-Received: by 2002:a5e:a60c:0:b0:7d5:de23:13a9 with SMTP id q12-20020a5ea60c000000b007d5de2313a9mr4122264ioi.1.1712788035906; Wed, 10 Apr 2024 15:27:15 -0700 (PDT) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id bt3-20020a056638430300b0047ee01746f1sm15159jab.120.2024.04.10.15.27.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Apr 2024 15:27:15 -0700 (PDT) Message-ID: <1a1c00fb-c83f-44e7-bc6a-cfe52d780c35@kernel.dk> Date: Wed, 10 Apr 2024 16:27:14 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] timerfd: convert to ->read_iter() Content-Language: en-US To: linux-fsdevel@vger.kernel.org Cc: brauner@kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk References: <20240409152438.77960-1-axboe@kernel.dk> <20240409152438.77960-3-axboe@kernel.dk> From: Jens Axboe In-Reply-To: <20240409152438.77960-3-axboe@kernel.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/9/24 9:22 AM, Jens Axboe wrote: > @@ -312,8 +313,8 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, > ctx->ticks = 0; > } > spin_unlock_irq(&ctx->wqh.lock); > - if (ticks) > - res = put_user(ticks, (u64 __user *) buf) ? -EFAULT: sizeof(ticks); > + if (ticks && !copy_to_iter_full(&ticks, sizeof(ticks), to)) > + res = -EFAULT; > return res; > } Dumb thinko here, as that should be: if (ticks) { res = copy_to_iter(&ticks, sizeof(ticks), to); if (!res) res = -EFAULT; } I've updated my branch, just a heads-up. Odd how it passing testing, guess I got stack lucky... -- Jens Axboe