<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/security/smack/smackfs.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-10-04T14:32:57Z</updated>
<entry>
<title>smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso</title>
<updated>2024-10-04T14:32:57Z</updated>
<author>
<name>Jiawei Ye</name>
</author>
<published>2024-09-02T08:47:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df480091e6f71f4d2b40636eeb549518571cc123'/>
<id>urn:sha1:df480091e6f71f4d2b40636eeb549518571cc123</id>
<content type='text'>
[ Upstream commit 2749749afa071f8a0e405605de9da615e771a7ce ]

In the `smk_set_cipso` function, the `skp-&gt;smk_netlabel.attr.mls.cat`
field is directly assigned to a new value without using the appropriate
RCU pointer assignment functions. According to RCU usage rules, this is
illegal and can lead to unpredictable behavior, including data
inconsistencies and impossible-to-diagnose memory corruption issues.

This possible bug was identified using a static analysis tool developed
by myself, specifically designed to detect RCU-related issues.

To address this, the assignment is now done using rcu_assign_pointer(),
which ensures that the pointer assignment is done safely, with the
necessary memory barriers and synchronization. This change prevents
potential RCU dereference issues by ensuring that the `cat` field is
safely updated while still adhering to RCU's requirements.

Fixes: 0817534ff9ea ("smackfs: Fix use-after-free in netlbl_catmap_walk()")
Signed-off-by: Jiawei Ye &lt;jiawei.ye@foxmail.com&gt;
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>smackfs: Prevent underflow in smk_set_cipso()</title>
<updated>2023-08-07T21:09:23Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2023-07-06T05:52:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ad49d37cf5759c3b8b68d02e3563f633d9c1aee'/>
<id>urn:sha1:3ad49d37cf5759c3b8b68d02e3563f633d9c1aee</id>
<content type='text'>
There is a upper bound to "catlen" but no lower bound to prevent
negatives.  I don't see that this necessarily causes a problem but we
may as well be safe.

Fixes: e114e473771c ("Smack: Simplified Mandatory Access Control Kernel")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
<entry>
<title>security: smack: smackfs: fix typo (lables-&gt;labels)</title>
<updated>2023-08-07T21:09:23Z</updated>
<author>
<name>Tóth János</name>
</author>
<published>2023-07-06T13:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c47b65840024153f6a1c931d6c7c772b3482a0a4'/>
<id>urn:sha1:c47b65840024153f6a1c931d6c7c772b3482a0a4</id>
<content type='text'>
Fix a spelling error in smakcfs.

Signed-off-by: Tóth János &lt;gomba007@gmail.com&gt;
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
<entry>
<title>smackfs: Added check catlen</title>
<updated>2023-02-21T19:22:02Z</updated>
<author>
<name>Denis Arefev</name>
</author>
<published>2023-01-24T10:50:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccfd889acb06eab10b98deb4b5eef0ec74157ea0'/>
<id>urn:sha1:ccfd889acb06eab10b98deb4b5eef0ec74157ea0</id>
<content type='text'>
  If the catlen is 0, the memory for the netlbl_lsm_catmap
  structure must be allocated anyway, otherwise the check of
  such rules is not completed correctly.

Signed-off-by: Denis Arefev &lt;arefev@swemel.ru&gt;
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2022-06-05T02:00:05Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2022-06-05T02:00:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cbd76edeabd5ed078391abb2323b7aee790cdc04'/>
<id>urn:sha1:cbd76edeabd5ed078391abb2323b7aee790cdc04</id>
<content type='text'>
Pull mount handling updates from Al Viro:
 "Cleanups (and one fix) around struct mount handling.

  The fix is usermode_driver.c one - once you've done kern_mount(), you
  must kern_unmount(); simple mntput() will end up with a leak. Several
  failure exits in there messed up that way... In practice you won't hit
  those particular failure exits without fault injection, though"

* tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  move mount-related externs from fs.h to mount.h
  blob_to_mnt(): kern_unmount() is needed to undo kern_mount()
  m-&gt;mnt_root-&gt;d_inode-&gt;i_sb is a weird way to spell m-&gt;mnt_sb...
  linux/mount.h: trim includes
  uninline may_mount() and don't opencode it in fspick(2)/fsopen(2)
</content>
</entry>
<entry>
<title>smack: Remove redundant assignments</title>
<updated>2022-05-23T18:12:08Z</updated>
<author>
<name>Michal Orzel</name>
</author>
<published>2022-03-31T17:33:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eaff451d4b7c86e3db3c03611426f5ce1d3826fd'/>
<id>urn:sha1:eaff451d4b7c86e3db3c03611426f5ce1d3826fd</id>
<content type='text'>
Get rid of redundant assignments which end up in values not being
read either because they are overwritten or the function ends.

Reported by clang-tidy [deadcode.DeadStores]

Signed-off-by: Michal Orzel &lt;michalorzel.eng@gmail.com&gt;
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
<entry>
<title>move mount-related externs from fs.h to mount.h</title>
<updated>2022-05-20T03:25:48Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2022-03-02T22:49:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=70f8d9c5750bbb0ca4ef7e23d6abcb05e6061138'/>
<id>urn:sha1:70f8d9c5750bbb0ca4ef7e23d6abcb05e6061138</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>smackfs: use netlbl_cfg_cipsov4_del() for deleting cipso_v4_doi</title>
<updated>2021-10-22T15:46:53Z</updated>
<author>
<name>Tetsuo Handa</name>
</author>
<published>2021-10-19T11:27:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0934ad42bb2c5df90a1b9de690f93de735b622fe'/>
<id>urn:sha1:0934ad42bb2c5df90a1b9de690f93de735b622fe</id>
<content type='text'>
syzbot is reporting UAF at cipso_v4_doi_search() [1], for smk_cipso_doi()
is calling kfree() without removing from the cipso_v4_doi_list list after
netlbl_cfg_cipsov4_map_add() returned an error. We need to use
netlbl_cfg_cipsov4_del() in order to remove from the list and wait for
RCU grace period before kfree().

Link: https://syzkaller.appspot.com/bug?extid=93dba5b91f0fed312cbd [1]
Reported-by: syzbot &lt;syzbot+93dba5b91f0fed312cbd@syzkaller.appspotmail.com&gt;
Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Fixes: 6c2e8ac0953fccdd ("netlabel: Update kernel configuration API")
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
<entry>
<title>smackfs: use __GFP_NOFAIL for smk_cipso_doi()</title>
<updated>2021-10-22T15:46:44Z</updated>
<author>
<name>Tetsuo Handa</name>
</author>
<published>2021-10-19T11:54:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f91488ee15bd3cac467e2d6a361fc2d34d1052ae'/>
<id>urn:sha1:f91488ee15bd3cac467e2d6a361fc2d34d1052ae</id>
<content type='text'>
syzbot is reporting kernel panic at smk_cipso_doi() due to memory
allocation fault injection [1]. The reason for need to use panic() was
not explained. But since no fix was proposed for 18 months, for now
let's use __GFP_NOFAIL for utilizing syzbot resource on other bugs.

Link: https://syzkaller.appspot.com/bug?extid=89731ccb6fec15ce1c22 [1]
Reported-by: syzbot &lt;syzbot+89731ccb6fec15ce1c22@syzkaller.appspotmail.com&gt;
Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
<entry>
<title>smackfs: Fix use-after-free in netlbl_catmap_walk()</title>
<updated>2021-09-15T23:42:25Z</updated>
<author>
<name>Pawan Gupta</name>
</author>
<published>2021-08-29T06:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0817534ff9ea809fac1322c5c8c574be8483ea57'/>
<id>urn:sha1:0817534ff9ea809fac1322c5c8c574be8483ea57</id>
<content type='text'>
Syzkaller reported use-after-free bug as described in [1]. The bug is
triggered when smk_set_cipso() tries to free stale category bitmaps
while there are concurrent reader(s) using the same bitmaps.

Wait for RCU grace period to finish before freeing the category bitmaps
in smk_set_cipso(). This makes sure that there are no more readers using
the stale bitmaps and freeing them should be safe.

[1] https://lore.kernel.org/netdev/000000000000a814c505ca657a4e@google.com/

Reported-by: syzbot+3f91de0b813cc3d19a80@syzkaller.appspotmail.com
Signed-off-by: Pawan Gupta &lt;pawan.kumar.gupta@linux.intel.com&gt;
Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
</feed>
