From patchwork Sat Nov 2 19:37:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 13860220 X-Patchwork-Delegate: paul@paul-moore.com Received: from sonic306-8.consmr.mail.bf2.yahoo.com (sonic306-8.consmr.mail.bf2.yahoo.com [74.6.132.47]) (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 1F0B71A2557 for ; Sat, 2 Nov 2024 19:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.6.132.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730576884; cv=none; b=B5MS3lWuDLGqo1JUwpEZnlrYSUImz6OaFccvBJT+RB3yZFxFOk+PfoGttxbZMGyM4jRXiKvg0p5COu4SJLTntYpM6R9aFEy0QFv7OxO2JqT5sZg2jgVS+TdL2WQarMYZOPC97Wv4zCrwiqht/BQh5db39ZbYD3vWfvzFVHgHd2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730576884; c=relaxed/simple; bh=7TaV/c+5EWmmeLmt6cb/HRqJJBvxZYqOAM7Gvnlu1Ac=; h=Message-ID:Date:MIME-Version:To:From:Subject:Cc:Content-Type: References; b=YX294UBqLZwPuxAZbvaGHZt3PopzZ/VuXaZSCx+Dq85AGFB023me0dgAtT1Ux+WuMkRwfWDJEDMiqJSW8X4VrfrFBYKS5FcQC5+x6Yae9t/7RMvGQiDv6lzql1CwaulgQpewqqXVcsErCjBDCRhuvNxijIhLaaZMmS7QzVGIxW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com; spf=none smtp.mailfrom=schaufler-ca.com; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=NtXwhwiq; arc=none smtp.client-ip=74.6.132.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=schaufler-ca.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="NtXwhwiq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1730576875; bh=UNaZ9mHktBR/5iT5lq+P5PzMIOjBTxIWBynAJr6XJV8=; h=Date:To:From:Subject:Cc:References:From:Subject:Reply-To; b=NtXwhwiqA0Oh0Id80VSbw4UjcBRyhq86otx2Z6jWExCWo1w067S0KWROZVWdq6pcmrrsKn+lDANiRiCUxWhsPciEV7fzY5NnGnWAoJZ6xVT0qgBEUKo8xQ2m8yGfD7T0w7Hj1kzL3U3kCh3uMWDeCHKV1cJF4JLrHl5TnU7BdGFrTp4YfqjTePk/d3Gz+qTIvUjwiuFhjzKTs0/hmWHoyBQ5/icbArxNTDVhfuwalFybNL+4amggbXoYBGeFcGXPwhSlPa4e4ReXmYa6rGn8IUnosejJ6do9bzgycswjQO73hBYdSa4NzFOP3XK06boCj1blvIW+LwjY9bBzWz08RQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1730576875; bh=kEihzEjp/K3cA9d6VqdtT1dYOmjMqwCDgO40qQhYSTm=; h=X-Sonic-MF:Date:To:From:Subject:From:Subject; b=drkk9SjOnrW9v1xFG+3xZWkOWWaebxKpKpkURSCuHbMPhQHBdj5NOr2Bu++tWTakOjnqaMdt6YSwSz/WGl1N/TUu2yIIhmI9Ieij5aZUg02HF5M75XxHyEADp3b9aH39+ifGiQVWZJidE9/uLAiPcbhKPVqTH8lhEfM0ryNanw68xvSjcnmxORm+JVvQL/Wilnnk2ei7rRudWjqZkQR42ARxMopPDr3xQfXu4dGJFfXGV6gUx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8d07K9KefPfvDtz1LtaHpJCZm1S7nKMkn4Imywga4yNjcca5VIcpAheBZ7M1nbNDQ u6cYOTI1lSUu..tdeGObdIiphweDIctkROlS9_6lgNm.5DH_Dj8TYznbWSAybWrq0sRRC4YBr7kR 857qHEfLYl2NbfP_qrCE8GTdwmMYgdk5gyBBgRt7u..Ujxqx3KXrJtOEqcq9mZEUfYqU7va9SyOd QVN6alF8oJ0WfFZucxQemrNjTM3M8hrU1MwGAVzT9RBg- X-Sonic-MF: X-Sonic-ID: 23079028-eb34-471b-933a-e411a3f4bc40 Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sat, 2 Nov 2024 19:47:55 +0000 Received: by hermes--production-gq1-5dd4b47f46-5kxd4 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID be2540088e62290e816fabcf92eccdf0; Sat, 02 Nov 2024 19:37:37 +0000 (UTC) Message-ID: <55401269-240e-43ca-83fa-97b089de5f19@schaufler-ca.com> Date: Sat, 2 Nov 2024 12:37:36 -0700 Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Paul Moore , Pablo Neira Ayuso From: Casey Schaufler Subject: [Patch lsm/dev-staging] selinux: Fix pointer use in selinux_dentry_init_security Cc: netfilter-devel@vger.kernel.org, LSM List , Casey Schaufler References: <55401269-240e-43ca-83fa-97b089de5f19.ref@schaufler-ca.com> X-Mailer: WebService/1.1.22806 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo The cast used while calling security_sid_to_context() is just wrong. Use the address of the pointer instead. Signed-off-by: Casey Schaufler --- security/selinux/hooks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 996e765b6823..93d2773bfda5 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2886,8 +2886,7 @@ static int selinux_dentry_init_security(struct dentry *dentry, int mode, *xattr_name = XATTR_NAME_SELINUX; cp->id = LSM_ID_SELINUX; - return security_sid_to_context(newsid, (char **)cp->context, - &cp->len); + return security_sid_to_context(newsid, &cp->context, &cp->len); } static int selinux_dentry_create_files_as(struct dentry *dentry, int mode,