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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94596C433EF for ; Fri, 22 Apr 2022 14:12:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 011C66B0073; Fri, 22 Apr 2022 10:12:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F02D86B0074; Fri, 22 Apr 2022 10:12:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA3406B0075; Fri, 22 Apr 2022 10:12:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id C8B4D6B0073 for ; Fri, 22 Apr 2022 10:12:43 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7A48A2460A for ; Fri, 22 Apr 2022 14:12:43 +0000 (UTC) X-FDA: 79384705806.17.E4F7A8F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 737EFC002C for ; Fri, 22 Apr 2022 14:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650636762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=icM2kJqBL5swedCTabkxjhxKVdLrnSGbQ92HmnIvSYg=; b=JrzsHb+Ryd2jqDnZleS3a8VK8LWd3LU//8JpP716layoRB04j4JPrLJlQTFeGic+Q8xFEL zP2PDLzBktCTN5unt2QymhBsnjTtQkfT+K8E3VwsIxuFsDcufQbuI/VPr8wqZPfX8lmjGg LcHk7fb/NpjQEqavGnczhP+fHb6AfIw= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-178-4FFAEoXhO7yM_zlR0ThKkg-1; Fri, 22 Apr 2022 10:12:41 -0400 X-MC-Unique: 4FFAEoXhO7yM_zlR0ThKkg-1 Received: by mail-qt1-f197.google.com with SMTP id fp30-20020a05622a509e00b002f33ea61111so5069988qtb.22 for ; Fri, 22 Apr 2022 07:12:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=icM2kJqBL5swedCTabkxjhxKVdLrnSGbQ92HmnIvSYg=; b=sBKVxH51sEacUzBNvqjs0Sf4IOrrKpu99lXkRgWJ+Q8h4fo6qsQTgZUPiI3jBOU5F0 GzpFtgYUdY5FM+S9fhLGjbOCMpZXWl+Wg0J8XgDN5ra/AWJOPrJIUADT60nWNYmF2csY IwdK0K6ntyeHOxWBRe+N3bfjsRjNliCps+3/VUJWVmp5WpZPJ8/uuj9rPMRnh6wZ+oI+ Q1dFWR0/YY9efA7xluM2jlhRhV8TksceR09Vq+T/1n4JJA6FO5lkf/hzH3ZwxrbfD6K+ sbhbZ2M9t5qFMJ9eMi0h70+/iFEckr34Ag1b7siFZKyzsWIt9iDXpJRf3L3ZX9igTN5U H4bQ== X-Gm-Message-State: AOAM532lf0h/USP3M00oZaW250mJK8K4n009X59kERW2Lq3unZRb0tvs wvbjqe/GcJ2RRvcrNXvuzDgfQ6wPMNGe+JSBwSn7EmTC+ABDaC5BYh303JTWjY+3JfbnoOEWZjX 1UrQR67pgkNU= X-Received: by 2002:a37:6041:0:b0:680:f510:79c8 with SMTP id u62-20020a376041000000b00680f51079c8mr2887064qkb.570.1650636760935; Fri, 22 Apr 2022 07:12:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD2Cj3ZZhQfaByRYJjN4P7n/034MshjTtdGQjVPY/4hzMhBzbBnxIlHQURGCeoxRKwJndQlA== X-Received: by 2002:a37:6041:0:b0:680:f510:79c8 with SMTP id u62-20020a376041000000b00680f51079c8mr2887042qkb.570.1650636760699; Fri, 22 Apr 2022 07:12:40 -0700 (PDT) Received: from ?IPV6:2600:1700:5610:6e80::41? ([2600:1700:5610:6e80::41]) by smtp.gmail.com with ESMTPSA id b126-20020a37b284000000b0069a11927e57sm935609qkf.101.2022.04.22.07.12.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Apr 2022 07:12:40 -0700 (PDT) Message-ID: <19b324a4-f69c-1624-fbc7-e178b7c31d81@redhat.com> Date: Fri, 22 Apr 2022 10:12:39 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC 2/3] futex: exit: Print a warning when futex_cleanup fails To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=c3=a9_Almeida?= , Arjan van de Ven , Ulrich Drepper References: <20220421190533.1601879-1-npache@redhat.com> <20220421190533.1601879-3-npache@redhat.com> From: Nico Pache In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JrzsHb+R; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf28.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=npache@redhat.com X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 737EFC002C X-Stat-Signature: duwwoo5smnquni7swyu5ktg7y1euygkm X-HE-Tag: 1650636759-370257 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 4/21/22 15:30, Matthew Wilcox wrote: > On Thu, Apr 21, 2022 at 03:05:32PM -0400, Nico Pache wrote: >> @@ -1007,13 +1013,15 @@ static inline void exit_pi_state_list(struct task_struct *curr) { } >> static void futex_cleanup(struct task_struct *tsk) >> { >> if (unlikely(tsk->robust_list)) { >> - exit_robust_list(tsk); >> + if (!exit_robust_list(tsk)) >> + pr_info("futex: exit_robust_list failed"); > > Doesn't this allow a malicious user process to spam the kernel logs > with messages? There needs to be a ratelimit on this, at least. Fair point, we'd need a ratelimited print if we want to continue forward with this. Additionally we may want to limit this print to debug kernels, but thats just a thought. Thanks for the review :) -- Nico