Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp339319lqb; Tue, 28 May 2024 18:16:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXC8SFtsDylNsXNcFWlA0qxzqr7W62ZsGosjufY/Tf2XJI8wTCbNTe3Blj0tK9kdA5cyHBT1lpWR+Y5fSEWqr9HqaGBd54UOxZdA9raqg== X-Google-Smtp-Source: AGHT+IGwfYMtz3MJ6qix/xKLe5uIDGNc4m1rUnEiy/iZgQNF5YwZZesYYk5BMaKQ8oDXWMYC/sll X-Received: by 2002:a17:906:a0a:b0:a5a:4683:e961 with SMTP id a640c23a62f3a-a6264f0eeaemr909725266b.52.1716945382120; Tue, 28 May 2024 18:16:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716945382; cv=pass; d=google.com; s=arc-20160816; b=oYkNIhJ5LE0W/sB5uPPN+OjsDQxzwgf48m1Kg9tMwWD/5um6n+JqDt3CMSv02SH26j OAmVjBci0RywJEBYVwZS227ospJhbfhJ+pfnXbInLKUu5VTNzR15bdNT/YupwVbxGT5R yzlF4pG6I7cvOp5I9h6wLELOOSsvo8c+p5va5P/GMKuqC46a7AaQ67mgagSKxuNDCP8b zO3tbt4EEbxq3JHCxn9GoIEpRmIN+FgmurvXTRJHtRmNDF8NJfZpUf5U6Yaq5nT8BgEt vs68w8Hye5/ge0gD7OCA6l1a1bZNpcTZvRymLhmsq6tuZmQMsipu2f+cr3dWhUTY4LUc cGMA== 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:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=zssiFsZDZZBTEpQvJYkG+CokD4QQQjIoL2kKugnyhxk=; fh=cXW/gjOLTRybmRDa4wN9dj2dt/XNI6AC7shqVsPTqgg=; b=ZYFMYGysPFfIxwIRn5Z2FQddWwWavxZFhih1bjVhh6xALllL68Tc5dWRwLEgHgJDDJ L+4LHWskQ8323OSNhY8nD1m499T2OJlG3mClMebEz4LokJxMja7xVKtxdF2o2STNmTEV sbl/J4VItIz+MrB1+/7vTwE+uXE4DrrWL/tFF9h1UxFhacgCqw6V8pfd3tSzEJA0XlIk d7ogS8sj51N2YHSfokIIrn4sJ5UgISgJoHdfGapNJ7MBbkO4PxVP8yK598QRZEyp+Pup g75D3LF6VaapU/wSM48uoJ++ZrMk5ALbfu2rg79fpiFXF0yEsGDYHAWFNuT0aqi8x24e YbYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QyCmql2V; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-193288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193288-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c91817csi557281266b.229.2024.05.28.18.16.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 18:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QyCmql2V; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-193288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193288-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D16621F25941 for ; Wed, 29 May 2024 01:16:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB85A15A872; Wed, 29 May 2024 01:16:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="QyCmql2V" Received: from out-185.mta1.migadu.com (out-185.mta1.migadu.com [95.215.58.185]) (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 1CD54632 for ; Wed, 29 May 2024 01:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716945366; cv=none; b=h1jsP2EWxBwLETyTQ7QxfggHL/C+/N1+nis3fGD4AA0eJe8F2h0m4JPfEPJPu9u9cJx/BmeRYBUyxbd9hZGSakjPE4gvaRAPgJOPA2mdTwTyX74VY2ffmjCOdokN391F8mhqGnuOf5G0k4q3/qrlxjbll6rgnd6nALnNCfc2YBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716945366; c=relaxed/simple; bh=VbXMKPFRNM4rvJJUONqIaV2ZyDimdXjJrsK52bXShYY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qEBLLNiWIZWxPaiPEco30zxDgCcI468syZmnu/OUk+HhkFO3E4k/d48CHtuQC7UjuFyHO52PrarLBV7B2ZcB+Ec4eCzjpwMLMrM0gp/OYRdpkNeXYbXSDekAp5jXL5bI5xy8FeFVeqArzUQaT2hjYRs+q4FROJldQjksfIhMr/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=QyCmql2V; arc=none smtp.client-ip=95.215.58.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: quic_abchauha@quicinc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716945360; 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=zssiFsZDZZBTEpQvJYkG+CokD4QQQjIoL2kKugnyhxk=; b=QyCmql2V6OXKrZ5ZFlBeyb7JhYtjR5HEBKolnaVUPPakCu3U10iMi69Syi2uzvPpMvqQdu xFLJOQRaYAUoUs3/KycH3emfzXHatBCSXSetYR5/bBS/vKmy4qlT3tE1UHXWtajEsoPz0w sCKE3vb9kULn95vxftruVdj+vMYmDeI= X-Envelope-To: davem@davemloft.net X-Envelope-To: edumazet@google.com X-Envelope-To: kuba@kernel.org X-Envelope-To: pabeni@redhat.com X-Envelope-To: netdev@vger.kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: ahalaney@redhat.com X-Envelope-To: willemdebruijn.kernel@gmail.com X-Envelope-To: martin.lau@kernel.org X-Envelope-To: daniel@iogearbox.net X-Envelope-To: bpf@vger.kernel.org X-Envelope-To: kernel@quicinc.com X-Envelope-To: syzbot+d7b227731ec589e7f4f0@syzkaller.appspotmail.com X-Envelope-To: syzbot+30a35a2e9c5067cc43fa@syzkaller.appspotmail.com Message-ID: <2c363f12-dd52-4163-bbcd-9a017cff6dd4@linux.dev> Date: Tue, 28 May 2024 18:15:51 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net] net: validate SO_TXTIME clockid coming from userspace To: Abhishek Chauhan Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Halaney , Willem de Bruijn , Martin KaFai Lau , Daniel Borkmann , bpf , kernel@quicinc.com, syzbot+d7b227731ec589e7f4f0@syzkaller.appspotmail.com, syzbot+30a35a2e9c5067cc43fa@syzkaller.appspotmail.com References: <20240528224935.1020828-1-quic_abchauha@quicinc.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20240528224935.1020828-1-quic_abchauha@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 5/28/24 3:49 PM, Abhishek Chauhan wrote: > Currently there are no strict checks while setting SO_TXTIME > from userspace. With the recent development in skb->tstamp_type > clockid with unsupported clocks results in warn_on_once, which causes > unnecessary aborts in some systems which enables panic on warns. > > Add validation in setsockopt to support only CLOCK_REALTIME, > CLOCK_MONOTONIC and CLOCK_TAI to be set from userspace. > > Link: https://lore.kernel.org/netdev/bc037db4-58bb-4861-ac31-a361a93841d3@linux.dev/ > Link: https://lore.kernel.org/lkml/20240509211834.3235191-1-quic_abchauha@quicinc.com/ > Fixes: 1693c5db6ab8 ("net: Add additional bit to support clockid_t timestamp type") Patch lgtm. This should target for net-next instead of net. The Fixes patch is in net-next only. Acked-by: Martin KaFai Lau