Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp282967lqh; Thu, 28 Mar 2024 01:40:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjH26DhKKkByG6FBvYKE9E981EblpUkCGb3rQwRIftmNEFrrvKo/MasSkg5o0duWLMgmu9hKdON2+n/kaqOvdDxOZmwUFnB+lu9WuYGw== X-Google-Smtp-Source: AGHT+IHpWqoGRRr6SAt1ww+jXFGWx3AVGHAmnmIrSsB+fGeKYTmYndha4+bz1qrC1uNkhOHUXOwr X-Received: by 2002:a17:90a:cb0a:b0:29a:729a:be2c with SMTP id z10-20020a17090acb0a00b0029a729abe2cmr2063923pjt.21.1711615209158; Thu, 28 Mar 2024 01:40:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711615209; cv=pass; d=google.com; s=arc-20160816; b=OJb8js7J6jFO/0tPO9ubP55ND+fTuXOfG4whciPt1+otvHfyDBzSlpuIpGFAFoKPrx f5tWt742W98yq2NcporJ9+BxvqoTKNirym2nWTLEldL2fDK/Ru1F3YUJ4w0TboBFVrLC u+kOBYL/0cMH/v3i5mBJ+DsqlrvH9PxfUzVnyP+HZtMJZmKEXoBJSOUpBXFOSVi+lfsP V8hywoNcjMHmjujOno6rPjI8jQl5b5Ou4WTHGFNamxBl7281h0cmT9xKcTds70sKj2f9 3No5uj+0yQ1Fc0HIxNnWtjqYsKZqdsv2sEDMbbRxNk02+O0eX2f0QGL9YycSruo80pEm tVRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=xyJ35OeYZ8gYDoCSDvqC+bURigKZ0DrKEJIfJCIxPiA=; fh=lc5jtEcDYc97xH+R6c3uxX6TdfUGCSDyzTW/2eaXZjU=; b=NykT2OJj2TRjDOU74D8HhLps2fyoOhXluIjLrsz/c4p6D+t/kRMEdHmzKrNPSrY+bm /VpWqYNzTrKrx23PC+1DYh0XLTy8Ph3W6syjji88MTcx3nkFaxYwCvXahqAU9MZYGvDn gQsN65i2NhwfzqdWPrIh2Nw3KiGBkHceCX0g5RdTjqvDy04epVkKHlZuXv+BHd0KeGXd B9zpcMFxZY1aD5rpNxm5MAQefuPXXHKGiJGGDgWp/xlAnPdtGNm5Mfr5spWApJfcrwKD +VLndFRYQ2MI6MUor4UbOVZ7FqiqbV6LTfZV5cErv5DVKRzMpxOChOn4N2DxmgAqkt+0 IOug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=vKOostsJ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-122581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122581-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id px1-20020a17090b270100b0029ba3a7ab05si1204367pjb.80.2024.03.28.01.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 01:40:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=vKOostsJ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-122581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122581-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DD7B3B250B6 for ; Thu, 28 Mar 2024 08:26:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5050354908; Thu, 28 Mar 2024 08:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="vKOostsJ" Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 367E21C288 for ; Thu, 28 Mar 2024 08:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711614355; cv=none; b=gk9f2PsFpU9J3zfQeCcYThlE+zdWoxAIFfoAUKC6ife6VgDm18JAwcbjaJ+2dEBLU3EwFNQT2E1nuOEMHhgBJ8GeDKXdmMI5w19KGVODj6haLRN++/3hmZKXtmklnmI/+v8JIbGeDRl7snADwV/WYCBsHWySxTps4sk3SjWrZyo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711614355; c=relaxed/simple; bh=xyJ35OeYZ8gYDoCSDvqC+bURigKZ0DrKEJIfJCIxPiA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=WMUXaiq6Q3s7eQJVMyzHhdQJb8yB2xXH1OdUd1gk4DnqUHx+hyZbB9YdsX/8d/unVYeL8EaUdFnvd2mBvnPnGe1oJW05L6QYf7E/xa9bNcOm/Z1A0r0HqePHrmw8y9Zr8Jvsy6w/4b3ZLU9xJegf5w1/xavzfYKmww8DA9vIM6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=vKOostsJ; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=xyJ35OeYZ8gYDoCSDvqC+bURigKZ0DrKEJIfJCIxPiA=; t=1711614353; x=1712823953; b=vKOostsJpL7kb+WntTWwPGs3/0Y/OWqW18vvaGyfSYKwY64 auWJQ0UpmDIZAhuw7oaqkJEl0jZHr+B1rjOp3NisNtqVq0lmSI5xwshO3AcRauBkwt+NuY+zF6Ntb qzYtsbSztocAjWr/57Ja4/5ZCx0+tou5TJxmZbe4qMAZNUtK/hxGedG4tHsKUsj5On+bR8B3Lgv0K NSF8/nody1Vv9NLxDPOrz9vY3sicvTBko5MFLZ/vuupq1wgBDk1tVUq8tIdcbbW7fn3paHyjsHG6x RKYVD6S+0/s29ofx7zpvfcYy/UJmLzgjQnIAj1Ho8WqhbVPgLNYYUsuLkvmJYm+Q==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rpl51-00000000mV1-3Jg5; Thu, 28 Mar 2024 09:25:47 +0100 Message-ID: <1743ad022502d64042fa7db4d847a988bb90cbdc.camel@sipsolutions.net> Subject: Re: [PATCH] um: Add winch to winch_handlers before registering winch IRQ From: Johannes Berg To: Roberto Sassu , richard@nod.at, anton.ivanov@cambridgegreys.com Cc: linux-kernel@vger.kernel.org, linux-um@lists.infradead.org, Roberto Sassu Date: Thu, 28 Mar 2024 09:25:46 +0100 In-Reply-To: <20240307104926.3531358-1-roberto.sassu@huaweicloud.com> References: <20240307104926.3531358-1-roberto.sassu@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Thu, 2024-03-07 at 11:49 +0100, Roberto Sassu wrote: > From: Roberto Sassu >=20 > Registering a winch IRQ is racy, an interrupt may occur before the winch = is > added to the winch_handlers list. >=20 > If that happens, register_winch_irq() adds to that list a winch that is > scheduled to be (or has already been) freed, causing a panic later in > winch_cleanup(). >=20 > Avoid the race by adding the winch to the winch_handlers list before > registering the IRQ, and rolling back if um_request_irq() fails. >=20 Reviewed-by: Johannes Berg johannes