History

Merge tag 'Smack-for-6.10' of https://github.com/cschaufler/smack-next

Pull smack updates from Casey Schaufler: "Two fixes for Smack networking labeling by Konstantin Andreev" * tag 'Smack-for-6.10' of https://github.com/cschaufler/smack-next: smack: unix sockets: fix accept()ed socket label smack: tcp: ipv4, fix incorrect labeling

Linus Torvalds committed 2 years ago

Commit 42b5a012 parents 11ab4cd e86cac01 file · +10 −4Browse files

Unified · Split

security/smack/smack_lsm.c+10−4
@@ -3871,12 +3871,18 @@ static int smack_unix_stream_connect(struct sock *sock, · 3870 unmodified lines
38713871 }
38723872 }
38733873
3874− /*
3875− * Cross reference the peer labels for SO_PEERSEC.
3876− */
38773874 if (rc == 0) {
3875+ /*
3876+ * Cross reference the peer labels for SO_PEERSEC.
3877+ */
38783878 nsp->smk_packet = ssp->smk_out;
38793879 ssp->smk_packet = osp->smk_out;
3880+
3881+ /*
3882+ * new/child/established socket must inherit listening socket labels
3883+ */
3884+ nsp->smk_out = osp->smk_out;
3885+ nsp->smk_in = osp->smk_in;
38803886 }
38813887
38823888 return rc;
@@ -4456,7 +4462,7 @@ static int smack_inet_conn_request(const struct sock *sk, struct sk_buff *skb, · 573 unmodified lines
44564462 rcu_read_unlock();
44574463
44584464 if (hskp == NULL)
4459− rc = netlbl_req_setattr(req, &skp->smk_netlabel);
4465+ rc = netlbl_req_setattr(req, &ssp->smk_out->smk_netlabel);
44604466 else
44614467 netlbl_req_delattr(req);
44624468

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t