From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 2280E25B0AB for ; Mon, 24 Aug 2026 08:26:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787560011; cv=none; b=Zf6GGe3iCBrP4rSSy2D5A8urwdfstJQwJQ6M5+lBhtN/j7n/RgKtYOTQTwURefcUrnokY6aDGY3QJDS3pguXbJt3Y60cjkMZYqMywHpbc6efhUrePqbmyp4t20FcxS9YjFw5UVfWNJvbjMP8nNRCld94oZHtHlRGvfN0WSHiXKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787560011; c=relaxed/simple; bh=7K3qF4MHbnXOzGNTTxNufyBZaxyiQ5GnnlzSoo75z0Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MwpAK7MjjY6yb+JNyBK93MlTms6ykG5zbJFwcHXeqjkYh0cAB8HE1gXkZgCq8+DrVLQfkMVJyUnXpTd0Zjx3BB8BEErZZ2fDqDLgXA+WziTW2IB5VFcNnruTMsumKDiaaafTEELA8SOVSwznyQ6RHlF9R6mHMOHVgxPelv2mKn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DNr4iTTu; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DNr4iTTu" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2cc61541f8cso44128525ad.0 for ; Mon, 24 Aug 2026 01:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787560009; x=1788164809; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=CgyNog9WpL8OyqKZAIeKVr+B+H34q6AdaVPTiDSA/FQ=; b=DNr4iTTubhQ6dm0c/QIQ6DNZiFtuLzmaMz2JdufRvScAFmo0x+QbZT4JRzW+q0RDtD 7eWPuPvSEOURouxihhrUcmW09fIR4evbyPxOfXwO/vgevTaPzzQN9iZ4TegUngX3I9iW 3pWFeQojv/Qivww045K8yWFNtXKulBqsckg47H6kH/Q8CIi7GlK33GcYQPVxp6Hk+Yz7 CYEmQQZ4aDX1KJuBcesE/MGLxdgavYTDSPLoJrEOaq1kpHGltMufXaGDWCnFZZYfHwiX D+qRhqDMi0tdo2jbmynGC8oZ8CCb4zPD7diJ2fs4a9dVyMrloKDZlCGXceJ47YbJC0Pm PWfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787560009; x=1788164809; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CgyNog9WpL8OyqKZAIeKVr+B+H34q6AdaVPTiDSA/FQ=; b=LZGeagtosT/Uw3EuY7H1ppqS02EsVZuJiguZ489IM44cy34QS4UCjfkhPTgf6Kk7oh TCZO+EgeMOI3nG8BH60p25nQ99WvKq7HsKGGGbNHMLEa9gOWGKKFn8zK3XpW6UpRISPi MBZDZl5XWiOsseir261/j+Jp+wii8PohnDLCjifhnZnfcSOFqTtc2L0rOyhpLaCWYLu9 0L6sw/Ml5/eg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3ICISJdSaam8xmac+O8eM5E= X-Received: by 2002:a17:90b:4ac8:b0:380:ce69:2669 with SMTP id 98e67ed59e1d1-395a0510f96mr35860154a91.9.1787560009190; Mon, 24 Aug 2026 01:26:49 -0700 (PDT) Received: from localhost.localdomain ([101.251.7.10]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327f90c0dd3sm25994595eec.7.2026.08.24.01.26.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Aug 2026 01:26:48 -0700 (PDT) From: Laxman Acharya Padhya To: Sven Peter , Janne Grunau Cc: Neal Gompa , Arnd Bergmann , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v2 0/4] soc: apple: rtkit: harden syslog shared-buffer handling Date: Mon, 24 Aug 2026 14:11:36 +0545 Message-ID: X-Mailer: git-send-email 2.51.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Split the syslog hardening into focused changes as requested. The first patch fixes the SYSLOG_INIT reinitialization leak. The second prevents zero-sized messages and out-of-bounds shared-memory copies. The third corrects the entry-count boundary, and the fourth rate limits validation warnings controlled by the coprocessor. The index-boundary change has not been tested on Apple hardware running Linux. Asahi m1n1 describes the initialization field as COUNT, consistent with the kernel's syslog_n_entries name, but patch 3 is kept independent so it can be reverted without removing the shared-memory bounds protection. Testing: - arm64 GCC build of drivers/soc/apple/rtkit.o with W=1 in Docker - scripts/checkpatch.pl --strict on each patch Changes since v1: - inline the one-use shared-memory bounds check - use == 0 for the crashlog copy and < 0 for syslog copies - split the SYSLOG_INIT leak fix into patch 1 - split the idx == n_entries change into patch 3 - make the zero-size guard independent of the leak fix - rate limit existing malformed-syslog warnings in patch 4 - rebase onto upstream commit 0a0d1d55dad5 Laxman Acharya Padhya (4): soc: apple: rtkit: free syslog buffer before reinitializing soc: apple: rtkit: bound syslog copies to the shared buffer soc: apple: rtkit: reject syslog indices outside the entry count soc: apple: rtkit: rate limit malformed syslog warnings drivers/soc/apple/rtkit.c | 75 +++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 26 deletions(-) base-commit: 0a0d1d55dad570724bf8c7ea83409639cfb4be9b -- 2.51.2