From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 58097132103 for ; Sat, 30 Nov 2024 21:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733002805; cv=none; b=Q4NXVylACYnhMdw0480w7gjU4HEG/n9DU4dV9u9ey0cSYfdx05QTFR382r3wPO20+dzJYJ6uuoVrUw9xuDRb2bemVgQ9wSCOWIwDdHMlcr1bkXCtAtJqhZsWkBG3e2dIcFnDfayHAk/sx+m5y2ju4X1NxTfhtSXQeYYi1WB0BKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733002805; c=relaxed/simple; bh=QIh5LPdBUUadt5QzHZ7uB31Jw1WDhsvFhK956BLp8P8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Sio0OTuoyK1OX3gGKVMZXC3nyPttPZPaKP2x5+My/TIVkNTidruPwBSg5HLGrBxkgVOlvTS0ajR15tfIhRQe0MQwR8yQhg5a1dV6QLstqy3ha4AsTPGHJvcfUna0qrBYFw8IL2Nl+090cq23HENG9wL6NbIdP3AHin2Yg1RL+po= 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=cfYz9N9i; arc=none smtp.client-ip=209.85.208.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="cfYz9N9i" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5d0c8ba475bso1165854a12.1 for ; Sat, 30 Nov 2024 13:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1733002801; x=1733607601; 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=Pw67/dEHvgxdkhQ24l1tOBa/DcJdy1WA/fl+pLzPNUA=; b=cfYz9N9in0vmgdwIrqcSTstnLikT5P72iDImi+nBcD2C6fPm59TYUfGBgngIyfxKxq YqI+bv/IQhYgp4mjktHly3iz8cLGnXQFoZ90u6XmydEKRPCwMrofLR7t0zyBTGdv1peq rCk6V6e4g0n+86Pwddqmb2OFMqJjiNLEBPXY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733002801; x=1733607601; 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=Pw67/dEHvgxdkhQ24l1tOBa/DcJdy1WA/fl+pLzPNUA=; b=xDF+onspOUH6QZDqy0Nnib9kh2xCPDKG1QAKxVCfy9m+zQDPWL2cwG+gmA3tlLW3vs mdPzXK2fP47gwQjZ97k09EToZuXuOY3wXm2qfpR3ApiyD7xT52PFvJa68ngu0fh0JodJ SFqC7q73y+DOvlDtV5YRSRT8UHmGiG9YktqZP/GUiL+yBxrNv2n9iWH1nQtvz4TeBjNx qNNUla10LaBxCVVCcx4GAPyV1c1PPvmQdTYU+f6dWiNanRBQFKNyyS7qplgpCR4fXR9D 5JyajF0vo4f4U+9i7L4XshKeVYmJq398vP+JGB0CRPJtAuUmGD/VB/n8YfEu6a/GKcv2 4hcA== X-Forwarded-Encrypted: i=1; AJvYcCX6hJ+/RfNKARgLHyryE0Y6voXxV4ZYz7OUaeUgnxh0INhMI0opc2EKfQ0gs2T+wci6mHwzpOH1fA==@vger.kernel.org X-Gm-Message-State: AOJu0YzYxhyiUvUevxJ8sf1S4K6kQgSAOQLMrmXSXz7or6dSMS/8No5U noKGLX8KezZLle7SmeVFHa3cNWA0Qvsrlx8ub7BOTsdKtCQEyACHUWO9+q9HlAUcMnwrJ5b0KYr Rw80AfA== X-Gm-Gg: ASbGnct/hE5bc64g13T+qnli1hcvEG3rrWE3yWUHjIgyo7bhKSKk+/0CEYbAZzO9aDE RsjbvpC8cIU28Hi3RATRBLXlcaAL14YVBcWzSEXLgSS/uaMrvvna1GaBdZ4p/JBP39EMzwHKSlH eu0x9lXh3ZFRyvWYm9C2HfHklABKvguFyzZONiGQQRdUy7ABgwlqnIE/VGpFtvIftqjFKKgbqxu hid67itTeBQB3GMKlJ7ipc+Vn8fGztdqYHqOnf+WrMLZNe5Ozi5o2Wq11WILTLpuc/P5xGyvakN aSj4jXo3BfR5RqZqa9KZA5Ei X-Google-Smtp-Source: AGHT+IEvOzYzDE3OK1aWwXm/OR7uEa8n1PqjlBFhhOgiLnBlXaEoH+f2QL5Hu5OxP9ScIVikdF4peg== X-Received: by 2002:a05:6402:3506:b0:5d0:d63e:6f43 with SMTP id 4fb4d7f45d1cf-5d0d63e7053mr1386792a12.17.1733002801624; Sat, 30 Nov 2024 13:40:01 -0800 (PST) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com. [209.85.218.54]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d0ca3a644csm1071060a12.33.2024.11.30.13.40.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Nov 2024 13:40:00 -0800 (PST) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a9ec267b879so436313766b.2 for ; Sat, 30 Nov 2024 13:40:00 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCViupNLAH77IDMXXkthOFLpEfqNK9TAJFHECFr5TIfa2fs/HxSWDqPC04BNduqbTeItWCJCRRBBtg==@vger.kernel.org X-Received: by 2002:a17:906:3090:b0:aa5:1585:ef33 with SMTP id a640c23a62f3a-aa580f1ae0emr1355585766b.23.1733002401515; Sat, 30 Nov 2024 13:33:21 -0800 (PST) Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241130044909.work.541-kees@kernel.org> <202411301244.381F2B8D17@keescook> In-Reply-To: <202411301244.381F2B8D17@keescook> From: Linus Torvalds Date: Sat, 30 Nov 2024 13:33:05 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] exec: Make sure task->comm is always NUL-terminated To: Kees Cook Cc: Eric Biederman , Alexander Viro , Christian Brauner , Jan Kara , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Jens Axboe , Pavel Begunkov , Andrew Morton , Chen Yu , Shuah Khan , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Sat, 30 Nov 2024 at 13:05, Kees Cook wrote: > > Yeah, this just means it has greater potential to be garbled. Garbled is fine. Id' just rather it be "consistently padded". > This is fine, but it doesn't solve either an unstable source nor > concurrent writers to dest. Yeah, I guess concurrent writers will also cause possibly inconsistent padding. Maybe we just don't care. As long as it's NUL-terminated, it's a string. If somebody is messing with the kernel, they get to the garbled string parts. Linus