Skip to content

Commit dd8aadf

Browse files
author
Avenger-285714
authored
Merge branch 'linux-6.6.y' into linux-6.6.y-2025-07-14-CVE-2024-27010
2 parents 5511928 + c1c4cde commit dd8aadf

31 files changed

Lines changed: 431 additions & 240 deletions

arch/arm64/configs/deepin_arm64_desktop_defconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,7 @@ CONFIG_FIREWIRE_NET=m
12561256
CONFIG_FIREWIRE_NOSY=m
12571257
CONFIG_BONDING=m
12581258
CONFIG_DUMMY=m
1259+
CONFIG_WIREGUARD=m
12591260
CONFIG_NET_FC=y
12601261
CONFIG_IFB=m
12611262
CONFIG_NET_TEAM=m
@@ -4004,6 +4005,7 @@ CONFIG_VT6656=m
40044005
CONFIG_STAGING_MEDIA=y
40054006
CONFIG_DVB_AV7110=m
40064007
CONFIG_DVB_BUDGET_PATCH=m
4008+
CONFIG_ASHMEM=y
40074009
CONFIG_LTE_GDM724X=m
40084010
CONFIG_PI433=m
40094011
CONFIG_QLGE=m
@@ -4517,9 +4519,7 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m
45174519
CONFIG_CRYPTO_USER_API_RNG=m
45184520
CONFIG_CRYPTO_USER_API_AEAD=m
45194521
CONFIG_CRYPTO_NHPOLY1305_NEON=m
4520-
CONFIG_CRYPTO_CHACHA20_NEON=m
45214522
CONFIG_CRYPTO_GHASH_ARM64_CE=m
4522-
CONFIG_CRYPTO_POLY1305_NEON=m
45234523
CONFIG_CRYPTO_SHA1_ARM64_CE=m
45244524
CONFIG_CRYPTO_SHA2_ARM64_CE=m
45254525
CONFIG_CRYPTO_SHA512_ARM64_CE=m

arch/x86/configs/deepin_x86_desktop_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4791,6 +4791,7 @@ CONFIG_STAGING_MEDIA=y
47914791
CONFIG_INTEL_ATOMISP=y
47924792
CONFIG_DVB_AV7110=m
47934793
CONFIG_VIDEO_IPU3_IMGU=m
4794+
CONFIG_ASHMEM=y
47944795
CONFIG_LTE_GDM724X=m
47954796
CONFIG_FB_TFT=m
47964797
CONFIG_FB_TFT_AGM1264K_FL=m

drivers/scsi/scsi_lib.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,7 @@ static void scsi_complete(struct request *rq)
14701470
static int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
14711471
{
14721472
struct Scsi_Host *host = cmd->device->host;
1473+
struct scsi_device *sdev = cmd->device;
14731474
int rtn = 0;
14741475

14751476
atomic_inc(&cmd->device->iorequest_cnt);
@@ -1518,6 +1519,17 @@ static int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
15181519
goto done;
15191520
}
15201521

1522+
/*
1523+
* Before we queue this command, check attribute use_192_bytes_for_3f.
1524+
* Because transmits data with a length of 0xff bytes via ioctl may
1525+
* cause some hard drives to hang and become unusable.
1526+
*/
1527+
if (cmd->cmnd[0] == MODE_SENSE && sdev->use_192_bytes_for_3f &&
1528+
cmd->cmnd[2] == 0x3f && cmd->cmnd[4] != 192) {
1529+
cmd->result = DID_ABORT << 16;
1530+
goto done;
1531+
}
1532+
15211533
if (unlikely(host->shost_state == SHOST_DEL)) {
15221534
cmd->result = (DID_NO_CONNECT << 16);
15231535
goto done;

drivers/staging/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ obj-$(CONFIG_IIO) += iio/
1717
obj-$(CONFIG_FB_SM750) += sm750fb/
1818
obj-$(CONFIG_USB_EMXX) += emxx_udc/
1919
obj-$(CONFIG_MFD_NVEC) += nvec/
20-
obj-$(CONFIG_ANDROID) += android/
20+
obj-y += android/
2121
obj-$(CONFIG_STAGING_BOARD) += board/
2222
obj-$(CONFIG_LTE_GDM724X) += gdm724x/
2323
obj-$(CONFIG_SB105X) += sb105x/

drivers/staging/android/ashmem.c

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
401401
ret = -EPERM;
402402
goto out;
403403
}
404-
vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
404+
vm_flags_clear(vma, calc_vm_may_flags(~asma->prot_mask));
405405

406406
if (!asma->file) {
407407
char *name = ASHMEM_NAME_DEF;
@@ -703,30 +703,33 @@ static int ashmem_pin(struct ashmem_area *asma, size_t pgstart, size_t pgend,
703703
static int ashmem_unpin(struct ashmem_area *asma, size_t pgstart, size_t pgend,
704704
struct ashmem_range **new_range)
705705
{
706-
struct ashmem_range *range, *next;
706+
struct ashmem_range *range = NULL, *iter, *next;
707707
unsigned int purged = ASHMEM_NOT_PURGED;
708708

709709
restart:
710-
list_for_each_entry_safe(range, next, &asma->unpinned_list, unpinned) {
710+
list_for_each_entry_safe(iter, next, &asma->unpinned_list, unpinned) {
711711
/* short circuit: this is our insertion point */
712-
if (range_before_page(range, pgstart))
712+
if (range_before_page(iter, pgstart)) {
713+
range = iter;
713714
break;
715+
}
714716

715717
/*
716718
* The user can ask us to unpin pages that are already entirely
717719
* or partially pinned. We handle those two cases here.
718720
*/
719-
if (page_range_subsumed_by_range(range, pgstart, pgend))
721+
if (page_range_subsumed_by_range(iter, pgstart, pgend))
720722
return 0;
721-
if (page_range_in_range(range, pgstart, pgend)) {
722-
pgstart = min(range->pgstart, pgstart);
723-
pgend = max(range->pgend, pgend);
724-
purged |= range->purged;
725-
range_del(range);
723+
if (page_range_in_range(iter, pgstart, pgend)) {
724+
pgstart = min(iter->pgstart, pgstart);
725+
pgend = max(iter->pgend, pgend);
726+
purged |= iter->purged;
727+
range_del(iter);
726728
goto restart;
727729
}
728730
}
729731

732+
range = list_prepare_entry(range, &asma->unpinned_list, unpinned);
730733
range_alloc(asma, range, purged, pgstart, pgend, new_range);
731734
return 0;
732735
}
@@ -817,6 +820,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
817820
static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
818821
{
819822
struct ashmem_area *asma = file->private_data;
823+
unsigned long ino;
820824
long ret = -ENOTTY;
821825

822826
switch (cmd) {
@@ -860,6 +864,23 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
860864
ashmem_shrink_scan(&ashmem_shrinker, &sc);
861865
}
862866
break;
867+
case ASHMEM_GET_FILE_ID:
868+
/* Lock around our check to avoid racing with ashmem_mmap(). */
869+
mutex_lock(&ashmem_mutex);
870+
if (!asma || !asma->file) {
871+
mutex_unlock(&ashmem_mutex);
872+
ret = -EINVAL;
873+
break;
874+
}
875+
ino = file_inode(asma->file)->i_ino;
876+
mutex_unlock(&ashmem_mutex);
877+
878+
if (copy_to_user((void __user *)arg, &ino, sizeof(ino))) {
879+
ret = -EFAULT;
880+
break;
881+
}
882+
ret = 0;
883+
break;
863884
}
864885

865886
return ret;
@@ -916,6 +937,15 @@ static const struct file_operations ashmem_fops = {
916937
#endif
917938
};
918939

940+
/*
941+
* is_ashmem_file - Check if struct file* is associated with ashmem
942+
*/
943+
int is_ashmem_file(struct file *file)
944+
{
945+
return file->f_op == &ashmem_fops;
946+
}
947+
EXPORT_SYMBOL_GPL(is_ashmem_file);
948+
919949
static struct miscdevice ashmem_misc = {
920950
.minor = MISC_DYNAMIC_MINOR,
921951
.name = "ashmem",
@@ -948,7 +978,7 @@ static int __init ashmem_init(void)
948978
goto out_free2;
949979
}
950980

951-
ret = register_shrinker(&ashmem_shrinker);
981+
ret = register_shrinker(&ashmem_shrinker, "android-ashmem");
952982
if (ret) {
953983
pr_err("failed to register shrinker!\n");
954984
goto out_demisc;

drivers/staging/android/ashmem.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
#define COMPAT_ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned int)
2222
#endif
2323

24+
int is_ashmem_file(struct file *file);
25+
2426
#endif /* _LINUX_ASHMEM_H */

drivers/staging/android/uapi/ashmem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ struct ashmem_pin {
3939
#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
4040
#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
4141
#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
42+
#define ASHMEM_GET_FILE_ID _IOR(__ASHMEMIOC, 11, unsigned long)
4243

4344
#endif /* _UAPI_LINUX_ASHMEM_H */

include/net/dropreason-core.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
FN(IPV6_NDISC_BAD_OPTIONS) \
8181
FN(IPV6_NDISC_NS_OTHERHOST) \
8282
FN(QUEUE_PURGE) \
83+
FN(TC_COOKIE_ERROR) \
84+
FN(PACKET_SOCK_ERROR) \
85+
FN(TC_CHAIN_NOTFOUND) \
86+
FN(TC_RECLASSIFY_LOOP) \
8387
FNe(MAX)
8488

8589
/**
@@ -345,6 +349,23 @@ enum skb_drop_reason {
345349
SKB_DROP_REASON_IPV6_NDISC_NS_OTHERHOST,
346350
/** @SKB_DROP_REASON_QUEUE_PURGE: bulk free. */
347351
SKB_DROP_REASON_QUEUE_PURGE,
352+
/**
353+
* @SKB_DROP_REASON_TC_COOKIE_ERROR: An error occurred whilst
354+
* processing a tc ext cookie.
355+
*/
356+
SKB_DROP_REASON_TC_COOKIE_ERROR,
357+
/**
358+
* @SKB_DROP_REASON_PACKET_SOCK_ERROR: generic packet socket errors
359+
* after its filter matches an incoming packet.
360+
*/
361+
SKB_DROP_REASON_PACKET_SOCK_ERROR,
362+
/** @SKB_DROP_REASON_TC_CHAIN_NOTFOUND: tc chain lookup failed. */
363+
SKB_DROP_REASON_TC_CHAIN_NOTFOUND,
364+
/**
365+
* @SKB_DROP_REASON_TC_RECLASSIFY_LOOP: tc exceeded max reclassify loop
366+
* iterations.
367+
*/
368+
SKB_DROP_REASON_TC_RECLASSIFY_LOOP,
348369
/**
349370
* @SKB_DROP_REASON_MAX: the maximum of core drop reasons, which
350371
* shouldn't be used as a real 'reason' - only for tracing code gen

include/net/inet_connection_sock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ struct inet_connection_sock {
120120
#define ATO_BITS 8
121121
__u32 ato:ATO_BITS, /* Predicted tick of soft clock */
122122
lrcv_flowlabel:20, /* last received ipv6 flowlabel */
123-
unused:4;
123+
dst_quick_ack:1, /* cache dst RTAX_QUICKACK */
124+
unused:3;
124125
unsigned long timeout; /* Currently scheduled timeout */
125126
__u32 lrcvtime; /* timestamp of last received data packet */
126127
__u16 last_seg_size; /* Size of last incoming segment */

include/net/inet_hashtables.h

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,26 @@ struct inet_bind_bucket {
8888
unsigned short fast_sk_family;
8989
bool fast_ipv6_only;
9090
struct hlist_node node;
91-
struct hlist_head owners;
91+
struct hlist_head bhash2;
92+
struct rcu_head rcu;
9293
};
9394

9495
struct inet_bind2_bucket {
9596
possible_net_t ib_net;
9697
int l3mdev;
9798
unsigned short port;
9899
#if IS_ENABLED(CONFIG_IPV6)
99-
unsigned short family;
100-
#endif
101-
union {
102-
#if IS_ENABLED(CONFIG_IPV6)
103-
struct in6_addr v6_rcv_saddr;
100+
unsigned short addr_type;
101+
struct in6_addr v6_rcv_saddr;
102+
#define rcv_saddr v6_rcv_saddr.s6_addr32[3]
103+
#else
104+
__be32 rcv_saddr;
104105
#endif
105-
__be32 rcv_saddr;
106-
};
107106
/* Node in the bhash2 inet_bind_hashbucket chain */
108107
struct hlist_node node;
108+
struct hlist_node bhash_node;
109109
/* List of sockets hashed to this bucket */
110110
struct hlist_head owners;
111-
/* bhash has twsk in owners, but bhash2 has twsk in
112-
* deathrow not to add a member in struct sock_common.
113-
*/
114-
struct hlist_head deathrow;
115111
};
116112

117113
static inline struct net *ib_net(const struct inet_bind_bucket *ib)
@@ -231,8 +227,7 @@ struct inet_bind_bucket *
231227
inet_bind_bucket_create(struct kmem_cache *cachep, struct net *net,
232228
struct inet_bind_hashbucket *head,
233229
const unsigned short snum, int l3mdev);
234-
void inet_bind_bucket_destroy(struct kmem_cache *cachep,
235-
struct inet_bind_bucket *tb);
230+
void inet_bind_bucket_destroy(struct inet_bind_bucket *tb);
236231

237232
bool inet_bind_bucket_match(const struct inet_bind_bucket *tb,
238233
const struct net *net, unsigned short port,
@@ -241,7 +236,7 @@ bool inet_bind_bucket_match(const struct inet_bind_bucket *tb,
241236
struct inet_bind2_bucket *
242237
inet_bind2_bucket_create(struct kmem_cache *cachep, struct net *net,
243238
struct inet_bind_hashbucket *head,
244-
unsigned short port, int l3mdev,
239+
struct inet_bind_bucket *tb,
245240
const struct sock *sk);
246241

247242
void inet_bind2_bucket_destroy(struct kmem_cache *cachep,
@@ -534,7 +529,8 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
534529
struct sock *sk, u64 port_offset,
535530
int (*check_established)(struct inet_timewait_death_row *,
536531
struct sock *, __u16,
537-
struct inet_timewait_sock **));
532+
struct inet_timewait_sock **,
533+
bool rcu_lookup));
538534

539535
int inet_hash_connect(struct inet_timewait_death_row *death_row,
540536
struct sock *sk);

0 commit comments

Comments
 (0)