From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Authentication-Results: gnuweeb.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=kernel-dk.20221208.gappssmtp.com header.i=@kernel-dk.20221208.gappssmtp.com header.a=rsa-sha256 header.s=20221208 header.b=kedPAOWw; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.179; helo=mail-il1-f179.google.com; envelope-from=axboe@kernel.dk; receiver= Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gnuweeb.org (Postfix) with ESMTPS id 4ED95245CF4 for ; Wed, 10 May 2023 22:17:55 +0700 (WIB) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3357fc32a31so872125ab.1 for ; Wed, 10 May 2023 08:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1683731874; x=1686323874; h=content-transfer-encoding:mime-version:date:message-id:subject :references:in-reply-to:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lN7tbsnewymx3Hha9SErMkfjnHX+bufyhRuLjrWne0Q=; b=kedPAOWw1SnhirRMkBOdCYfWJOhBtIQddzc6tVfVtEhapV90gOFqq0WkqycAGdytwZ 1481+dK/0lz2B5/haB7EY2dgOlc2Itn+JrhyNfKFBr+s+zAWBJxctx1lvleSUFOiFeSQ ZRmRkuO2MonNEdoAz+T6u866p9FFjB+RDM4DFDzFywJXuytT5ZD6xnSifKdF1UGXnfif 7oTgr7KRUR5+hqjiYwMC9Ba6kTiUsHZK6srDAhWWCUuTxe5YCYfIXPUdjJr+Sp+Wn9Ax 0LG+IaC+v9nVr/Q1kfnASsRat0WhMGqjx6xV6gwHMnX8dzOkSStS2bkqRsKU8oXA12aC wN+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683731874; x=1686323874; h=content-transfer-encoding:mime-version:date:message-id:subject :references:in-reply-to:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lN7tbsnewymx3Hha9SErMkfjnHX+bufyhRuLjrWne0Q=; b=RkUUWVy1mENMlzBDff5e2r+AGIcHbjRpTSPSezSLWxrdrmfOp6bc3WlKRhs0DlyqvO AmyJA6JD+iCXrDyBOS0zR4xFI4BDezXouJTQwYQYsHidu1T+7cZY/Vw3lsogOjC6p3bV 74ltTOtWvQiv0TOt5+2OB9PGE2+n7XmJCKq2LUIToxNOn9/SJ5lA9AegJX66ADMGjd3G Mabh1DUZJSD/ufQnhEDvCIQj6bZ3mM7RwXk4Riw4VIiccp2+bUsEQSHNsh7A2s2yEuYL rGSF6cs4kR74AQXPVdu3fqgLaPNVtUmifOchpJSJhHshR6JTRla9fh3U6dvgg+F333lK zdRQ== X-Gm-Message-State: AC+VfDzoPB7+StDveWS12HRsAflXKV5OxchEgdK1p3B2YFOweAhUR1Ib E0OHF0k7EB7g2ton+qhKXnW7sg== X-Google-Smtp-Source: ACHHUZ7idZS3nGS0DkQmkhqX2ZSUVTjY3GYuAVz9kd+gohWAtXgNwQpsNjx1FQLF1cyTr6TteIlIZw== X-Received: by 2002:a05:6e02:1d9b:b0:32b:51df:26a0 with SMTP id h27-20020a056e021d9b00b0032b51df26a0mr10042992ila.2.1683731873752; Wed, 10 May 2023 08:17:53 -0700 (PDT) Received: from [127.0.0.1] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id t12-20020a92c90c000000b003248469e5easm2399300ilp.43.2023.05.10.08.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 08:17:52 -0700 (PDT) From: Jens Axboe To: Ammar Faizi Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Michael William Jonathan , Linux Kernel Mailing List , io-uring Mailing List , GNU/Weeb Mailing List In-Reply-To: <20230510143927.123170-1-ammarfaizi2@gnuweeb.org> References: <20230510143927.123170-1-ammarfaizi2@gnuweeb.org> Subject: Re: [PATCH liburing v1 0/2] 2 fixes for recv-msgall.c Message-Id: <168373187265.405534.8990004306948050012.b4-ty@kernel.dk> Date: Wed, 10 May 2023 09:17:52 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.13-dev-00303 List-Id: On Wed, 10 May 2023 21:39:25 +0700, Ammar Faizi wrote: > This is the follow up patchset for the recent issue found in > recv-msgall.c. There are two patches in this series. > > 1. Fix undefined behavior in `recv_prep()`. > The lifetime of `struct msghdr msg;` must be long enough until the CQE > is generated because the recvmsg operation will write to that storage. I > found this test segfault when compiling with -O0 optimization. This is > undefined behavior and may behave randomly. Fix this by making the > lifetime of `struct msghdr msg;` long enough. > > [...] Applied, thanks! [1/2] recv-msgall: Fix undefined behavior in `recv_prep()` commit: 05c6317367cab6fd4b8cf38c68cea1563bf31c5f [2/2] recv-msgall: Fix invalid mutex usage commit: 09c3661278bebb8431fbc10ed213e42181e7cac7 Best regards, -- Jens Axboe