Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1431395lqg; Sun, 3 Mar 2024 09:38:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9vuRQPtYTWDXvZqWNVv0qcvh2o8Q6s86uVLqpoc2jHQi2vCg024zSu1bRZF0An2e+IS6m7d2/l22peXmQZ2jlLnxAYq/BlQyyX1v4Lg== X-Google-Smtp-Source: AGHT+IFvVzy0xz5oM8Kgq/WpgQGhXic86FB52QoqOIHFRpcExOvnP64+FIVeyloQJtccsSzGEEE2 X-Received: by 2002:a17:902:e5cd:b0:1d9:a647:5579 with SMTP id u13-20020a170902e5cd00b001d9a6475579mr7444315plf.1.1709487513357; Sun, 03 Mar 2024 09:38:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709487513; cv=pass; d=google.com; s=arc-20160816; b=X7LCmS8uwLgDp5w/XWpvcXdbx9rijmNhV3zmIVAk3ZtTHlYAe8nnvdcC2lh5Buz6dq rkslKenXnVwjtJj/jaAEVQpcdI1htKVO1Bnue0qURMwyy/+sSHqBqtmr3WfxcRsJIiCE UgVh1OZltQ7B/3DqM3E4Y9fw+5h2z00yC92fg7E97gWsdJR2ODwV+XG3y5hMZF6TcqCm zWYSWpdJIvlWq4JSnujDF07u9yCALyEoMYSiGBrMFBEUDb6rGxsnzjozJVMyvdRqLOu5 SdLxB0FkZ72r3khACCiNNmt6NT0eebV90/IZZaRlfEoSkW/pBNwtuBmzzoKI5CFrg7TD nZnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=6OXHcs0u7KBydjJek2lY4Er4rvAyb0qiJYU1ggCN13U=; fh=8VEHrcrF9KJAX/0wbBB+pN+MyhaV8fi9j22fvfQ1TCE=; b=AmZ10kMULNWPfU8nB9E8YENZFvrIJj9IowGYupKkbOC/tqi+OWJ1Ub8qznC6YKYgDW DvZNvEe2LTUvJ65fVtQvcnBraxnhJSIdyyB71kMvZUQoPon1ycmJNLM1hwVESZKhb6iK YzS9zA+WEgy3qQoQfsg5RKvhs/0/jcSSWTevYqNUeTfhgmewJrJ1uHa8jIcUqD6XcTX0 lmqDgAouPxBMgi3ogOJvD637IcVfqFoZ5qfs8j7fXyfAgCgD/DvJfRItcOagktHIYrMq R27tb2qs7LrB8ifBnphuohI6POtZnQAR2oOrHWY/mPWyB022OLAs7MIcDe1Qn0H+Nqng f0VA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=XnRPWI1Y; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-89847-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89847-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d1-20020a170902cec100b001d721475ff1si7379223plg.106.2024.03.03.09.38.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 09:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89847-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=XnRPWI1Y; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-89847-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89847-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0CFE2281CF2 for ; Sun, 3 Mar 2024 17:38:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F1AD76416; Sun, 3 Mar 2024 17:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="XnRPWI1Y" Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 985738F40 for ; Sun, 3 Mar 2024 17:38:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709487507; cv=none; b=e3al6AWbs+B/Z3Vyvg+MiehhYt9U/wSZOAZbGntqagWYoz51LKk/c2Oa3iQkjtpD7U3Rxokqj53bOllLrzQxn2Zd0R3V0X2t+e7MqNoxcDvkqaIQVmADb0jyUjZ3LHdHcOnywHu6bZ8LKEv0rbsMC40JWu3ag13Dq3He9GkZyMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709487507; c=relaxed/simple; bh=EraWs6zRpMrLuSDfy+wsdAKnpSaRQvG9MzaC/ej7704=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Hm6cV7Mb3ltw+FBn78T6/qwBTx7X/H8fDHa9JDMRxcHeDm6KX8yhsrQvS/bmP/SGKXOfyR5M8Ag6fqP3DLRJgean50eIWCBhyefl98kvc8oGGnhcgfn2ebDJV96thfmm+ARGshzHjijHgVdz0ftBGvWTOJq+kSVsc1unqHtMuN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=XnRPWI1Y; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d27184197cso50738891fa.1 for ; Sun, 03 Mar 2024 09:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1709487502; x=1710092302; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6OXHcs0u7KBydjJek2lY4Er4rvAyb0qiJYU1ggCN13U=; b=XnRPWI1Y8KcJLA+aXdawlGcTFpycj8x5bG+BQYMzLAsiFYaMefmRYSNgu+ctrP4Fqm VE4jxYvyQUhqM068wg/4ZC7QDElG3h4JP4khdb5DnqaoeskcgWoT6pMGVTBdc73uhrqX sGhxUmPHZleom0VsNmg8WWyGUMAG7baMdfhV8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709487502; x=1710092302; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6OXHcs0u7KBydjJek2lY4Er4rvAyb0qiJYU1ggCN13U=; b=fQRXbNOjnClfaza1svFW2RkzEHYfp4oZMTmdSvyjl3E/0C9lXrDg/7uMhF0G674Kr5 PORu8BYdcoCoYEMQ07Jd4Im0tnOPY3R0xnQNQcj9QWo4emomSXwiL9gh8D4xFwWJSMLJ CPNq72XKVeS4s6/fLOide1RrBiL31EA964Ktat21lF6W9e/Xq4NKfTh/uGtsymeFgYzW u77x0OvGzw4XQfHjGwEwuskiO+EsLAT0/9iRix+FVsDcf5Nv7MTMzW3uvm1aGF9VkhiA 6JklPYYn130C09Ble7im2fZ8PQybqY6pI27/ltJhRZmq0CsLkSOvLvuH9PbyzvJy3iRn S/6g== X-Gm-Message-State: AOJu0Yw5bbudxuYLDwxvvLz3BtstnXasgUZ6jcs30uI8AO4XmRDioCbp 36FXsv55IZe6dzZVe5zHZYmOdyIINB4Af1W0TqiDY5LVNfX2NSS0qKga0oGsWTbVJaNdrzFCNzM nWaX4rQ== X-Received: by 2002:a05:6512:2fc:b0:513:201c:5dc6 with SMTP id m28-20020a05651202fc00b00513201c5dc6mr3826594lfq.61.1709487502493; Sun, 03 Mar 2024 09:38:22 -0800 (PST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id x8-20020ac24888000000b0051339f52ab2sm701921lfc.44.2024.03.03.09.38.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Mar 2024 09:38:21 -0800 (PST) Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d109e82bd0so42322331fa.3 for ; Sun, 03 Mar 2024 09:38:21 -0800 (PST) X-Received: by 2002:a19:4359:0:b0:512:9857:34f3 with SMTP id m25-20020a194359000000b00512985734f3mr4527253lfj.39.1709487501350; Sun, 03 Mar 2024 09:38:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240302111244.3a1674be@gandalf.local.home> <20240302145958.05aabdd2@rorschach.local.home> <20240302154713.71e29402@rorschach.local.home> <20240303075937.36fc6043@rorschach.local.home> In-Reply-To: <20240303075937.36fc6043@rorschach.local.home> From: Linus Torvalds Date: Sun, 3 Mar 2024 09:38:04 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] tracing: Prevent trace_marker being bigger than unsigned short To: Steven Rostedt Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Sachin Sant Content-Type: text/plain; charset="UTF-8" On Sun, 3 Mar 2024 at 04:59, Steven Rostedt wrote: > > - trace_seq_printf(s, ": %.*s", max, field->buf); > + trace_seq_puts(s, ": "); > + /* Write 1K chunks at a time */ > + p = field->buf; > + do { > + int pre = max > 1024 ? 1024 : max; > + trace_seq_printf(s, "%.*s", pre, p); > + max -= pre; > + p += pre; > + } while (max > 0); The above loop is complete garbage. If 'p' is a string, you're randomly just walking past the end of the string with 'p += pre' And if 'o' isn't a string but has a fixed size, you shouldn't use '%s' in the first place, you should just use seq_write(). Just stop. You are doing things entirely wrong, and you're just adding random code. I'm not taking *any* fixes from you as things are now, you're once again only making things worse. What was wrong with saying "don't do that"? You seem to be bending over backwards to doing stupid things, and then insisting on doing them entirely wrong. Linus