public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Allen Simpson <william.allen.simpson@gmail.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>, Greg KH <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, stable@kernel.org,
	stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Ben Hutchings <bhutchings@solarflare.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [058/152] tcp: protect sysctl_tcp_cookie_size reads
Date: Sat, 08 Jan 2011 07:57:15 -0500	[thread overview]
Message-ID: <4D285F2B.9070407@gmail.com> (raw)
In-Reply-To: <4D285158.1080804@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On 1/8/11 6:58 AM, William Allen Simpson wrote:
> Eric was *not* *truthful* saying there were "checkpatch.pl errors/warnings" in
> my code.
>
I've received a private email complaining that I've not properly attributed
the origin of the patch.  Given a person has already lied to me about this,
I'm not sure.  When it comes to personal integrity, it's "one strike and
you're out"!

Since Eric had previously reviewed the original code, surely any such error
would have been found by him at that time.  Perhaps he made a mistake?

However, I'm happy to add a Reported-by line.  If this is an error, hopefully
somebody will correct it.

[-- Attachment #2: sysctl_tcp_cookie_size-read-once.patch --]
[-- Type: text/plain, Size: 1680 bytes --]

>From bd6f04cbee4c924e07cf3a1819a24acc3cc2490b Mon Sep 17 00:00:00 2001
From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Sat, 8 Jan 2011 05:58:21 -0500
Subject: [PATCH] sysctl_tcp_cookie_size read once

Read sysctl_tcp_cookie_size only once in tcp_cookie_size_check(),
as it might be concurrently changed by another cpu.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: William.Allen.Simpson@gmail.com
---
 net/ipv4/tcp_output.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index de3bd84..49be4e3 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -392,27 +392,30 @@ struct tcp_out_options {
  */
 static u8 tcp_cookie_size_check(u8 desired)
 {
+	int cookie_size;
+
 	if (desired > 0) {
 		/* previously specified */
 		return desired;
 	}
-	if (sysctl_tcp_cookie_size <= 0) {
+	cookie_size = ACCESS_ONCE(sysctl_tcp_cookie_size);
+	if (cookie_size <= 0) {
 		/* no default specified */
 		return 0;
 	}
-	if (sysctl_tcp_cookie_size <= TCP_COOKIE_MIN) {
+	if (cookie_size <= TCP_COOKIE_MIN) {
 		/* value too small, specify minimum */
 		return TCP_COOKIE_MIN;
 	}
-	if (sysctl_tcp_cookie_size >= TCP_COOKIE_MAX) {
+	if (cookie_size >= TCP_COOKIE_MAX) {
 		/* value too large, specify maximum */
 		return TCP_COOKIE_MAX;
 	}
-	if (0x1 & sysctl_tcp_cookie_size) {
+	if (cookie_size & 0x1) {
 		/* 8-bit multiple, illegal, fix it */
-		return (u8)(sysctl_tcp_cookie_size + 0x1);
+		cookie_size += 0x1;
 	}
-	return (u8)sysctl_tcp_cookie_size;
+	return (u8)cookie_size;
 }
 
 /* Write previously computed TCP options to the packet.
-- 
1.7.1


  reply	other threads:[~2011-01-08 12:57 UTC|newest]

Thread overview: 177+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06  0:25 [000/152] 2.6.36.3-stable review Greg KH
2011-01-06  0:21 ` [001/152] x86, hotplug: Use mwait to offline a processor, fix the legacy case Greg KH
2011-01-06  0:21 ` [002/152] fuse: verify ioctl retries Greg KH
2011-01-06  0:21 ` [003/152] fuse: fix ioctl when server is 32bit Greg KH
2011-01-06  0:21 ` [004/152] ALSA: HDA: Quirk for Dell Vostro 320 to make microphone work Greg KH
2011-01-06  0:21 ` [005/152] ALSA: hda - Do not wrongly restrict min_channels based on ELD Greg KH
2011-01-06  0:21 ` [006/152] ALSA: hda - Always allow basic audio irrespective of ELD info Greg KH
2011-01-06  0:21 ` [007/152] ALSA: hda: Use position_fix=1 for Acer Aspire 5538 to enable capture on internal mic Greg KH
2011-01-06  0:21 ` [008/152] ALSA: hda: Use model=lg quirk for LG P1 Express to enable playback and capture Greg KH
2011-01-06  0:21 ` [009/152] drm/radeon/kms: dont apply 7xx HDP flush workaround on AGP Greg KH
2011-01-06  0:21 ` [010/152] drm/kms: remove spaces from connector names (v2) Greg KH
2011-01-06  0:21 ` [011/152] drm/radeon/kms: fix vram base calculation on rs780/rs880 Greg KH
2011-01-06  0:21 ` [012/152] drm/i915: Always set the DP transcoder config to 8BPC Greg KH
2011-01-06  0:21 ` [013/152] nohz: Fix printk_needs_cpu() return value on offline cpus Greg KH
2011-01-06  0:21 ` [014/152] nohz: Fix get_next_timer_interrupt() vs cpu hotplug Greg KH
2011-01-06  0:21 ` [015/152] firewire: ohci: fix regression with VIA VT6315, disable MSI Greg KH
2011-01-06  0:21 ` [016/152] firewire: ohci: fix regression with Agere FW643 rev 06, " Greg KH
2011-01-06  0:21 ` [017/152] NFS: Fix panic after nfs_umount() Greg KH
2011-01-06  0:21 ` [018/152] nfsd: Fix possible BUG_ON firing in set_change_info Greg KH
2011-01-06  0:21 ` [019/152] NFS: Fix fcntl F_GETLK not reporting some conflicts Greg KH
2011-01-06  0:21 ` [020/152] sunrpc: prevent use-after-free on clearing XPT_BUSY Greg KH
2011-01-06  0:22 ` [021/152] hwmon: (adm1026) Allow 1 as a valid divider value Greg KH
2011-01-06  0:22 ` [022/152] hwmon: (adm1026) Fix setting fan_div Greg KH
2011-01-06  0:22 ` [023/152] EDAC: Fix workqueue-related crashes Greg KH
2011-01-06  0:22 ` [024/152] amd64_edac: Fix interleaving check Greg KH
2011-01-06  0:22 ` [025/152] ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain Greg KH
2011-01-06  0:22 ` [026/152] ASoC: Fix off by one error in WM8994 EQ register bank size Greg KH
2011-01-06  0:22 ` [027/152] ASoC: WM8580: Fix R8 initial value Greg KH
2011-01-06  0:22 ` [028/152] ASoC: fix deemphasis control in wm8904/55/60 codecs Greg KH
2011-01-06  0:22 ` [029/152] bootmem: Add alloc_bootmem_align() Greg KH
2011-01-06  0:22 ` [030/152] x86, xsave: Use alloc_bootmem_align() instead of alloc_bootmem() Greg KH
2011-01-06  0:22 ` [031/152] IB/uverbs: Handle large number of entries in poll CQ Greg KH
2011-01-06  0:22 ` [032/152] PM / Hibernate: Fix PM_POST_* notification with user-space suspend Greg KH
2011-01-06  0:22 ` [033/152] ARM: 6535/1: V6 MPCore v6_dma_inv_range and v6_dma_flush_range RWFO fix Greg KH
2011-01-06  0:22 ` [034/152] [SCSI] qla2xxx: Correct issue where NPIV-config data was not being allocated for 82xx parts Greg KH
2011-01-06  0:22 ` [035/152] [SCSI] qla2xxx: Populate Command Type 6 LUN field properly Greg KH
2011-01-06  0:22 ` [036/152] llc: fix a device refcount imbalance Greg KH
2011-01-06  0:22 ` [037/152] ath9k: Disable SWBA interrupt on remove_interface Greg KH
2011-01-06  0:22 ` [038/152] ath9k: Fix STA disconnect issue due to received MIC failed bcast frames Greg KH
2011-01-06  0:22 ` [039/152] ath9k: Fix bug in reading input gpio state for ar9003 Greg KH
2011-01-06  0:22 ` [040/152] ath9k_hw: fix endian issues with CTLs on AR9003 Greg KH
2011-01-06  0:22 ` [041/152] ath9k: fix bug in tx power Greg KH
2011-01-06  0:22 ` [042/152] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs Greg KH
2011-01-06  0:22 ` [043/152] SPARC/LEON: removed constant timer initialization as if HZ=100, now it reflects the value of HZ Greg KH
2011-01-06  0:22 ` [044/152] sparc64: Delete prom_puts() unused Greg KH
2011-01-06  0:22 ` [045/152] sparc: Remove prom_pathtoinode() Greg KH
2011-01-06  0:22 ` [046/152] sparc: Kill prom devops_{32,64}.c Greg KH
2011-01-06  0:22 ` [047/152] sparc64: Unexport prom_service_exists() Greg KH
2011-01-06  0:22 ` [048/152] sparc64: Delete prom_setcallback() Greg KH
2011-01-06  0:22 ` [049/152] sparc: Do not export prom_nb{get,put}char() Greg KH
2011-01-06  0:22 ` [050/152] sparc: Pass buffer pointer all the way down to prom_{get,put}char() Greg KH
2011-01-06  0:22 ` [051/152] sparc: Delete prom_*getchar() Greg KH
2011-01-06  0:22 ` [052/152] sparc: Write to prom console using indirect buffer Greg KH
2011-01-06  0:22 ` [053/152] tcp: Dont change unlocked socket state in tcp_v4_err() Greg KH
2011-01-06  0:22 ` [054/152] tcp: Increase TCP_MAXSEG socket option minimum Greg KH
2011-01-06  0:22 ` [055/152] tcp: Make TCP_MAXSEG minimum more correct Greg KH
2011-01-06  0:22 ` [056/152] tcp: Bug fix in initialization of receive window Greg KH
2011-01-06  0:22 ` [057/152] tcp: avoid a possible divide by zero Greg KH
2011-01-06  0:22 ` [058/152] tcp: protect sysctl_tcp_cookie_size reads Greg KH
2011-01-07  4:08   ` William Allen Simpson
2011-01-07  8:30     ` Eric Dumazet
2011-01-07 13:05       ` William Allen Simpson
2011-01-07 13:25         ` Eric Dumazet
2011-01-07 13:36         ` Pekka Enberg
2011-01-08 11:58           ` William Allen Simpson
2011-01-08 12:57             ` William Allen Simpson [this message]
2011-01-06  0:22 ` [059/152] 8139cp: fix checksum broken Greg KH
2011-01-06  0:22 ` [060/152] r8169: fix sleeping while holding spinlock Greg KH
2011-01-06  0:22 ` [061/152] af_unix: limit unix_tot_inflight Greg KH
2011-01-06  0:22 ` [062/152] af_unix: limit recursion level Greg KH
2011-01-06  0:22 ` [063/152] net: ax25: fix information leak to userland Greg KH
2011-01-06  0:22 ` [064/152] driver/net/benet: fix be_cmd_multicast_set() memcpy bug Greg KH
2011-01-06  5:29   ` Sathya.Perla
2011-01-07 19:39   ` [stable] " Paul Gortmaker
2011-01-07 21:24     ` Greg KH
2011-01-06  0:22 ` [065/152] bonding: Fix slave selection bug Greg KH
2011-01-06  0:22 ` [066/152] bridge: fix IPv6 queries for bridge multicast snooping Greg KH
2011-01-06  0:22 ` [067/152] cls_cgroup: Fix crash on module unload Greg KH
2011-01-06  0:22 ` [068/152] filter: fix sk_filter rcu handling Greg KH
2011-01-06  0:22 ` [069/152] econet: Do the correct cleanup after an unprivileged SIOCSIFADDR Greg KH
2011-01-07 19:10   ` [stable] " Paul Gortmaker
2011-01-07 19:19     ` Greg KH
2011-01-08  1:33       ` David Miller
2011-01-06  0:22 ` [070/152] econet: Fix crash in aun_incoming() Greg KH
2011-01-06  0:22 ` [071/152] ifb: goto resched directly if error happens and dp->tq isnt empty Greg KH
2011-01-06  0:22 ` [072/152] l2tp: Fix modalias of l2tp_ip Greg KH
2011-01-06  0:22 ` [073/152] x25: decrement netdev reference counts on unload Greg KH
2011-01-06  0:22 ` [074/152] tehuti: Firmware filename is tehuti/bdx.bin Greg KH
2011-01-06  0:22 ` [075/152] net/dst: dst_dev_event() called after other notifiers Greg KH
2011-01-06  0:22 ` [076/152] net: Fix header size check for GSO case in recvmsg (af_packet) Greg KH
2011-01-06  0:22 ` [077/152] net: fix skb_defer_rx_timestamp() Greg KH
2011-01-06  0:22 ` [078/152] net: packet: fix information leak to userland Greg KH
2011-01-06  0:22 ` [079/152] pppoe.c: Fix kernel panic caused by __pppoe_xmit Greg KH
2011-01-06  0:22 ` [080/152] ACPICA: Fix Scope() op in module level code Greg KH
2011-01-06  0:23 ` [081/152] nouveau: Acknowledge HPD irq in handler, not bottom half Greg KH
2011-01-06  0:23 ` [082/152] printk: Fix wake_up_klogd() vs cpu hotplug Greg KH
2011-01-06  0:23 ` [083/152] xen: Provide a variant of __RING_SIZE() that is an integer constant expression Greg KH
2011-01-06  0:23 ` [084/152] sched: Cure more NO_HZ load average woes Greg KH
2011-01-06  0:23 ` [085/152] ACPI: EC: Add another dmi match entry for MSI hardware Greg KH
2011-01-06  0:23 ` [086/152] MIPS: jz4740: qi_lb60: Fix gpio for the 6th row of the keyboard matrix Greg KH
2011-01-06  0:23 ` [087/152] PM / Runtime: Fix pm_runtime_suspended() Greg KH
2011-01-06  0:23 ` [088/152] inotify: stop kernel memory leak on file creation failure Greg KH
2011-01-06  0:23 ` [089/152] orinoco: fix TKIP countermeasure behaviour Greg KH
2011-01-06  0:23 ` [090/152] orinoco: clear countermeasure setting on commit Greg KH
2011-01-06  0:23 ` [091/152] x86, amd: Fix panic on AMD CPU family 0x15 Greg KH
2011-01-06  0:23 ` [092/152] md: fix bug with re-adding of partially recovered device Greg KH
2011-01-06  0:23 ` [093/152] md: protect against NULL reference when waiting to start a raid10 Greg KH
2011-01-06  0:23 ` [094/152] tracing: Fix panic when lseek() called on "trace" opened for writing Greg KH
2011-01-06  0:23 ` [095/152] arch/tile: handle CLONE_SETTLS in copy_thread(), not user space Greg KH
2011-01-06  0:23 ` [096/152] x86, gcc-4.6: Use gcc -m options when building vdso Greg KH
2011-01-06  0:23 ` [097/152] x86: Enable the intr-remap fault handling after local APIC setup Greg KH
2011-01-06  0:23 ` [098/152] x86, vt-d: Handle previous faults after enabling fault handling Greg KH
2011-01-06  0:23 ` [099/152] x86, vt-d: Fix the vt-d fault handling irq migration in the x2apic mode Greg KH
2011-01-06  0:23 ` [100/152] x86, vt-d: Quirk for masking vtd spec errors to platform error handling logic Greg KH
2011-01-06  0:23 ` [101/152] rt2x00: Fix max TX power settings Greg KH
2011-01-06  0:23 ` [102/152] ALSA: hda - Enable jack sense for Thinkpad Edge 11 Greg KH
2011-01-06  0:23 ` [103/152] Input: synaptics - fix handling of 2-button ClickPads Greg KH
2011-01-06  0:23 ` [104/152] install_special_mapping skips security_file_mmap check Greg KH
2011-01-06  0:23 ` [105/152] USB: misc: uss720.c: add another vendor/product ID Greg KH
2011-01-06  0:23 ` [106/152] USB: ftdi_sio: Add D.O.Tec PID Greg KH
2011-01-06  0:23 ` [107/152] USB: usb-storage: unusual_devs entry for the Samsung YP-CP3 Greg KH
2011-01-06  0:23 ` [108/152] Revert "USB: gadget: Allow function access to device ID data during bind()" Greg KH
2011-01-06  0:23 ` [109/152] p54usb: add 5 more USBIDs Greg KH
2011-01-06  0:23 ` [110/152] p54usb: New USB ID for Gemtek WUBI-100GW Greg KH
2011-01-06  0:23 ` [111/152] n_gsm: Fix message length handling when building header Greg KH
2011-01-06  0:23 ` [112/152] n_gsm: gsm_data_alloc buffer allocation could fail and it is not being checked Greg KH
2011-01-06  0:23 ` [113/152] xhci: Fix issue with port array setup and buggy hosts Greg KH
2011-01-06  0:23 ` [114/152] gpio: Fix null pointer dereference while accessing rdc321x platform_data Greg KH
2011-01-06  0:23 ` [115/152] cs5535-gpio: dont apply errata #36 to edge detect GPIOs Greg KH
2011-01-06  0:23 ` [116/152] cs5535-gpio: handle GPIO regs where higher (clear) bits are set Greg KH
2011-01-06  0:23 ` [117/152] mmc: at91_mci: fix multiblock SDIO transfers Greg KH
2011-01-06  0:23 ` [118/152] mmc: atmel-mci: " Greg KH
2011-01-06  0:23 ` [119/152] mmc: Fix re-probing with PM_POST_RESTORE notification Greg KH
2011-01-06  0:23 ` [120/152] fix freeing user_struct in user cache Greg KH
2011-01-06  0:23 ` [121/152] rtc: rs5c372: fix buffer size Greg KH
2011-01-06  0:23 ` [122/152] RAMOOPS: Dont overflow over non-allocated regions Greg KH
2011-01-06  0:23 ` [123/152] watchdog: Fix null pointer dereference while accessing rdc321x platform_data Greg KH
2011-01-06  0:23 ` [124/152] watchdog: Improve initialisation error message and documentation Greg KH
2011-01-06  0:23 ` [125/152] arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU Greg KH
2011-01-06  0:23 ` [126/152] mfd: Support additional parent IDs for wm831x Greg KH
2011-01-06  0:23 ` [127/152] mfd: Supply IRQ base for WM832x devices Greg KH
2011-01-06  0:23 ` [128/152] drm/radeon/kms/evergreen: reset the grbm blocks at resume and init Greg KH
2011-01-06  0:23 ` [129/152] drm/radeon/kms: fix evergreen asic reset Greg KH
2011-01-06  0:23 ` [130/152] drm/radeon/kms: reorder display resume to avoid problems Greg KH
2011-01-06  0:23 ` [131/152] drm/i915/dp: Fix I2C/EDID handling with active DisplayPort to DVI converter Greg KH
2011-01-06  0:23 ` [132/152] drm/i915/bios: Reverse order of 100/120 Mhz SSC clocks Greg KH
2011-01-07 20:18   ` François Valenduc
2011-01-07 21:23     ` Greg KH
2011-01-06  0:23 ` [133/152] drm/i915, intel_ips: When i915 loads after IPS, make IPS relink to i915 Greg KH
2011-01-06  0:23 ` [134/152] memcg: fix wrong VM_BUG_ON() in try_charge()s mm->owner check Greg KH
2011-01-06  0:23 ` [135/152] sound: Prevent buffer overflow in OSS load_mixer_volumes Greg KH
2011-01-06  0:23 ` [136/152] KVM: enlarge number of possible CPUID leaves Greg KH
2011-01-06  0:23 ` [137/152] KVM: SVM: Do not report xsave in supported cpuid Greg KH
2011-01-06  0:23 ` [138/152] KVM: Fix OSXSAVE after migration Greg KH
2011-01-06  0:23 ` [139/152] mv_xor: fix race in tasklet function Greg KH
2011-01-06  0:23 ` [140/152] ima: fix add LSM rule bug Greg KH
2011-01-06  0:24 ` [141/152] libata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr() Greg KH
2011-01-06  0:24 ` [142/152] mac80211: fix mesh forwarding Greg KH
2011-01-06  0:24 ` [143/152] ALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120 Greg KH
2011-01-06  0:24 ` [144/152] Sched: fix skip_clock_update optimization Greg KH
2011-01-06  0:24 ` [145/152] block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead Greg KH
2011-01-06  0:24 ` [146/152] x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree() Greg KH
2011-01-06  0:24 ` [147/152] posix-cpu-timers: workaround to suppress the problems with mt exec Greg KH
2011-01-06  0:24 ` [148/152] [media] mx2_camera: fix pixel clock polarity configuration Greg KH
2011-01-06  0:24 ` [149/152] [media] Dont export format_by_forcc on two different drivers Greg KH
2011-01-06  0:24 ` [150/152] orinoco: initialise priv->hw before assigning the interrupt Greg KH
2011-01-06  0:24 ` [151/152] [media] gspca - sonixj: Set the flag for some devices Greg KH
2011-01-06  0:24 ` [152/152] [media] gspca - sonixj: Add a flag in the driver_info table Greg KH
2011-01-06 13:42 ` [000/152] 2.6.36.3-stable review Alan Cox
2011-01-06 21:57   ` Greg KH
2011-01-07 15:07     ` Pavel Machek
2011-01-07 18:37       ` Greg KH
2011-01-09  7:38         ` unbreak billionton CF card (was Re: [000/152] 2.6.36.3-stable review) Pavel Machek
2011-01-23 13:06         ` Pavel Machek
2011-01-23 16:31           ` Greg KH
2011-01-23 17:08             ` Pavel Machek
2011-01-23 17:59               ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D285F2B.9070407@gmail.com \
    --to=william.allen.simpson@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox