~canonical-kernel/ubuntu/+source/linux-oem/+git/jammy:oem-6.1-next--s2024.02.05-1--auto

Last commit made on 2024-03-15
Get this branch:
git clone -b oem-6.1-next--s2024.02.05-1--auto https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/jammy
Members of Canonical Kernel can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
oem-6.1-next--s2024.02.05-1--auto
Repository:
lp:~canonical-kernel/ubuntu/+source/linux-oem/+git/jammy

Recent commits

3ab1552... by Ubuntu Kernel Bot <email address hidden>

UBUNTU: Ubuntu-oem-6.1-6.1.0-1036.36

Signed-off-by: Ubuntu Kernel Bot <email address hidden>

7308b3b... by Ubuntu Kernel Bot <email address hidden>

UBUNTU: Start new release

Ignore: yes
Signed-off-by: Ubuntu Kernel Bot <email address hidden>

b29fc91... by Ubuntu Kernel Bot <email address hidden>

UBUNTU: [Packaging] update annotations scripts

BugLink: https://bugs.launchpad.net/bugs/2056027
Signed-off-by: Ubuntu Kernel Bot <email address hidden>

4eae260... by Ubuntu Kernel Bot <email address hidden>

UBUNTU: [Packaging] remove helper scripts

BugLink: https://bugs.launchpad.net/bugs/2056027
Signed-off-by: Ubuntu Kernel Bot <email address hidden>

a8f2175... by Ubuntu Kernel Bot <email address hidden>

UBUNTU: [Packaging] resync git-ubuntu-log

BugLink: https://bugs.launchpad.net/bugs/2056027
Signed-off-by: Ubuntu Kernel Bot <email address hidden>

4832c40... by Ubuntu Kernel Bot <email address hidden>

UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/2056027

Properties: no-test-build
Signed-off-by: Ubuntu Kernel Bot <email address hidden>

b0e22b5... by Duoming Zhou

net: usb: lan78xx: reorder cleanup operations to avoid UAF bugs

The timer dev->stat_monitor can schedule the delayed work dev->wq and
the delayed work dev->wq can also arm the dev->stat_monitor timer.

When the device is detaching, the net_device will be deallocated. but
the net_device private data could still be dereferenced in delayed work
or timer handler. As a result, the UAF bugs will happen.

One racy situation is shown below:

      (Thread 1) | (Thread 2)
lan78xx_stat_monitor() |
 ... | lan78xx_disconnect()
 lan78xx_defer_kevent() | ...
  ... | cancel_delayed_work_sync(&dev->wq);
  schedule_delayed_work() | ...
  (wait some time) | free_netdev(net); //free net_device
  lan78xx_delayedwork() |
  //use net_device private data |
  dev-> //use |

Although we use cancel_delayed_work_sync() to cancel the delayed work
in lan78xx_disconnect(), it could still be scheduled in timer handler
lan78xx_stat_monitor().

Another racy situation is shown below:

      (Thread 1) | (Thread 2)
lan78xx_delayedwork |
 mod_timer() | lan78xx_disconnect()
                                | cancel_delayed_work_sync()
 (wait some time) | if (timer_pending(&dev->stat_monitor))
                              | del_timer_sync(&dev->stat_monitor);
 lan78xx_stat_monitor() | ...
  lan78xx_defer_kevent() | free_netdev(net); //free
   //use net_device private data|
   dev-> //use |

Although we use del_timer_sync() to delete the timer, the function
timer_pending() returns 0 when the timer is activated. As a result,
the del_timer_sync() will not be executed and the timer could be
re-armed.

In order to mitigate this bug, We use timer_shutdown_sync() to shutdown
the timer and then use cancel_delayed_work_sync() to cancel the delayed
work. As a result, the net_device could be deallocated safely.

What's more, the dev->flags is set to EVENT_DEV_DISCONNECT in
lan78xx_disconnect(). But it could still be set to EVENT_STAT_UPDATE
in lan78xx_stat_monitor(). So this patch put the set_bit() behind
timer_shutdown_sync().

Fixes: 77dfff5bb7e2 ("lan78xx: Fix race condition in disconnect handling")
Signed-off-by: Duoming Zhou <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 1e7417c188d0a83fb385ba2dbe35fd2563f2b6f3)
CVE-2023-6039
Signed-off-by: Yuxuan Luo <email address hidden>
Signed-off-by: Timo Aaltonen <email address hidden>

a7b1652... by tglx

timers: Provide timer_shutdown[_sync]()

Tearing down timers which have circular dependencies to other
functionality, e.g. workqueues, where the timer can schedule work and work
can arm timers, is not trivial.

In those cases it is desired to shutdown the timer in a way which prevents
rearming of the timer. The mechanism to do so is to set timer->function to
NULL and use this as an indicator for the timer arming functions to ignore
the (re)arm request.

Expose new interfaces for this: timer_shutdown_sync() and timer_shutdown().

timer_shutdown_sync() has the same functionality as timer_delete_sync()
plus the NULL-ification of the timer function.

timer_shutdown() has the same functionality as timer_delete() plus the
NULL-ification of the timer function.

In both cases the rearming of the timer is prevented by silently discarding
rearm attempts due to timer->function being NULL.

Co-developed-by: Steven Rostedt <email address hidden>
Signed-off-by: Steven Rostedt <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>
Tested-by: Guenter Roeck <email address hidden>
Reviewed-by: Jacob Keller <email address hidden>
Reviewed-by: Anna-Maria Behnsen <email address hidden>
Link: https://<email address hidden>
Link: https://<email address hidden>
Link: https://<email address hidden>

(cherry picked from commit f571faf6e443b6011ccb585d57866177af1f643c)
CVE-2023-6039
Signed-off-by: Yuxuan Luo <email address hidden>
Signed-off-by: Timo Aaltonen <email address hidden>

2e0835e... by tglx

timers: Add shutdown mechanism to the internal functions

Tearing down timers which have circular dependencies to other
functionality, e.g. workqueues, where the timer can schedule work and work
can arm timers, is not trivial.

In those cases it is desired to shutdown the timer in a way which prevents
rearming of the timer. The mechanism to do so is to set timer->function to
NULL and use this as an indicator for the timer arming functions to ignore
the (re)arm request.

Add a shutdown argument to the relevant internal functions which makes the
actual deactivation code set timer->function to NULL which in turn prevents
rearming of the timer.

Co-developed-by: Steven Rostedt <email address hidden>
Signed-off-by: Steven Rostedt <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>
Tested-by: Guenter Roeck <email address hidden>
Reviewed-by: Jacob Keller <email address hidden>
Reviewed-by: Anna-Maria Behnsen <email address hidden>
Link: https://<email address hidden>
Link: https://<email address hidden>
Link: https://<email address hidden>

(cherry picked from commit 0cc04e80458a822300b93f82ed861a513edde194)
CVE-2023-6039
Signed-off-by: Yuxuan Luo <email address hidden>
Signed-off-by: Timo Aaltonen <email address hidden>

ab4eef2... by tglx

timers: Split [try_to_]del_timer[_sync]() to prepare for shutdown mode

Tearing down timers which have circular dependencies to other
functionality, e.g. workqueues, where the timer can schedule work and work
can arm timers, is not trivial.

In those cases it is desired to shutdown the timer in a way which prevents
rearming of the timer. The mechanism to do so is to set timer->function to
NULL and use this as an indicator for the timer arming functions to ignore
the (re)arm request.

Split the inner workings of try_do_del_timer_sync(), del_timer_sync() and
del_timer() into helper functions to prepare for implementing the shutdown
functionality.

No functional change.

Co-developed-by: Steven Rostedt <email address hidden>
Signed-off-by: Steven Rostedt <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>
Tested-by: Guenter Roeck <email address hidden>
Reviewed-by: Jacob Keller <email address hidden>
Reviewed-by: Anna-Maria Behnsen <email address hidden>
Link: https://<email address hidden>
Link: https://<email address hidden>
Link: https://<email address hidden>

(cherry picked from commit 8553b5f2774a66b1f293b7d783934210afb8f23c)
CVE-2023-6039
Signed-off-by: Yuxuan Luo <email address hidden>
Signed-off-by: Timo Aaltonen <email address hidden>